diff options
author | 2019-10-13 20:55:11 +0200 | |
---|---|---|
committer | 2019-10-13 20:59:35 +0200 | |
commit | 61b2a8afaf012e28ef14ad946ee0bb8319232aa6 (patch) | |
tree | 0aaf403f6258de9adbbeacaac92206fdf1c7aa27 /src/osd/modules/render/bgfx/texturemanager.cpp | |
parent | cd6b9ac9beb76e640f39227555ad6907a36d38f9 (diff) |
-bgfx: Do texture format conversion via a full-screen GPU pass. [Ryan Holtz]
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; |