Open lemoon opened 2 years ago
The problem is that blockWidth is incorrect when the texture is supported only by emulation. When emulation used instead of the real format an rgba8/bgra8 texture format is used.
One solution would be to modify example:
instead of this:
const bimg::ImageBlockInfo& blockInfo = getBlockInfo(imageContainer->m_format);
do this:
bimg::TextureFormat::Enum format = imageContainer->m_format;
if ( 0 == (bgfx::getCaps()->formats[imageContainer->m_format] & BGFX_CAPS_FORMAT_TEXTURE_2D) )
format = bimg::TextureFormat::BGRA8;
const bimg::ImageBlockInfo& blockInfo = getBlockInfo(format);
https://github.com/bkaradzic/bgfx/commit/17bb4dce49289ee16c783c2bc437c3a2aa2d8040 this commit will cause a crash on macOS
-[MTLDebugBlitCommandEncoder internalValidateCopyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:options:]:486: failed assertion `(destinationOrigin.x + destinationSize.width)(4) must be <= width(2).'
add back this code will be fine