diff options
Diffstat (limited to 'src/osd/modules/render/bgfx/texturemanager.cpp')
-rw-r--r-- | src/osd/modules/render/bgfx/texturemanager.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/osd/modules/render/bgfx/texturemanager.cpp b/src/osd/modules/render/bgfx/texturemanager.cpp index a5fbca97f35..e2614133205 100644 --- a/src/osd/modules/render/bgfx/texturemanager.cpp +++ b/src/osd/modules/render/bgfx/texturemanager.cpp @@ -116,8 +116,10 @@ bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t form } else { - const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(format, width, height, rowpixels, palette, base); - bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)width, (uint16_t)height, mem); + bgfx::TextureFormat::Enum dst_format = bgfx::TextureFormat::BGRA8; + uint16_t pitch = width; + const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(dst_format, format, width, height, rowpixels, palette, base, &pitch); + bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)width, (uint16_t)height, mem, pitch); return handle; } } @@ -142,8 +144,10 @@ bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t form } else { - const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(format, width, height, rowpixels, palette, base); - bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)width, (uint16_t)height, mem); + bgfx::TextureFormat::Enum dst_format = bgfx::TextureFormat::BGRA8; + uint16_t pitch = width; + const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(dst_format, format, width, height, rowpixels, palette, base, &pitch); + bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)width, (uint16_t)height, mem, pitch); return handle; } } @@ -151,9 +155,11 @@ bgfx::TextureHandle texture_manager::create_or_update_mame_texture(uint32_t form } } - const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(format, width, height, rowpixels, palette, base); - handle = bgfx::createTexture2D(width, height, false, 1, bgfx::TextureFormat::RGBA8, flags, nullptr); - bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)width, (uint16_t)height, mem); + bgfx::TextureFormat::Enum dst_format = bgfx::TextureFormat::BGRA8; + uint16_t pitch = width; + const bgfx::Memory* mem = bgfx_util::mame_texture_data_to_bgfx_texture_data(dst_format, format, width, height, rowpixels, palette, base, &pitch); + handle = bgfx::createTexture2D(width, height, false, 1, dst_format, flags, nullptr); + bgfx::updateTexture2D(handle, 0, 0, 0, 0, (uint16_t)width, (uint16_t)height, mem, pitch); m_mame_textures[key] = { handle, seqid, width, height }; return handle; |