mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-06-08 03:13:52 +00:00
Metal: Warn about drawable size mismatch. (#3712)
This commit is contained in:
committed by
GitHub
parent
de332e5937
commit
651985d860
@@ -3957,6 +3957,21 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames
|
||||
? s_textureFormat[formatColor].m_fmtSrgb
|
||||
: s_textureFormat[formatColor].m_fmt) )
|
||||
;
|
||||
|
||||
const CGSize actualSize = m_metalLayer->drawableSize();
|
||||
BX_WARN(true
|
||||
&& uint32_t(actualSize.width) == _width
|
||||
&& uint32_t(actualSize.height) == _height
|
||||
, "CAMetalLayer drawableSize is %ux%u after requesting %ux%u. "
|
||||
"The host layer (MTKView? with autoReizeDrawable=YES) "
|
||||
"is overriding the size requested via bgfx::init/reset. "
|
||||
"Either disable host auto-resizable, or pass the post-layout "
|
||||
"drawable size to bgfx."
|
||||
, uint32_t(actualSize.width)
|
||||
, uint32_t(actualSize.height)
|
||||
, _width
|
||||
, _height
|
||||
);
|
||||
}
|
||||
|
||||
MTL::TextureDescriptor* desc = newTextureDescriptor();
|
||||
|
||||
Reference in New Issue
Block a user