mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 13:00:32 +00:00
Remap BGRA textures during remote replay if necessary
With GL driver or if the required GLES extension is missing, than we display BGRA textures as RGBA.
This commit is contained in:
committed by
Baldur Karlsson
parent
3a0c55d0f7
commit
78cce78cb1
@@ -1733,6 +1733,10 @@ void ReplayProxy::RemapProxyTextureIfNeeded(TextureDescription &tex, GetTextureD
|
||||
params.remap = RemapTexture::RGBA8;
|
||||
}
|
||||
|
||||
// since the texture type is unsupported, remove the bgraOrder flag and remap it to RGBA
|
||||
if(tex.format.bgraOrder && m_APIProps.localRenderer == GraphicsAPI::OpenGL)
|
||||
tex.format.bgraOrder = false;
|
||||
|
||||
switch(params.remap)
|
||||
{
|
||||
case RemapTexture::NoRemap: RDCERR("IsTextureSupported == false, but we have no remap"); break;
|
||||
|
||||
@@ -450,6 +450,7 @@ extern bool IsGLES;
|
||||
EXT_TO_CHECK(99, 99, EXT_clip_cull_distance) \
|
||||
EXT_TO_CHECK(99, 99, EXT_multisample_compatibility) \
|
||||
EXT_TO_CHECK(99, 99, EXT_read_format_bgra) \
|
||||
EXT_TO_CHECK(99, 99, EXT_texture_format_BGRA8888) \
|
||||
EXT_TO_CHECK(99, 99, NV_polygon_mode) \
|
||||
EXT_TO_CHECK(99, 99, NV_read_depth) \
|
||||
EXT_TO_CHECK(99, 99, NV_read_stencil) \
|
||||
|
||||
@@ -3141,6 +3141,11 @@ bool GLReplay::IsTextureSupported(const ResourceFormat &format)
|
||||
if(format.type == ResourceFormatType::ASTC)
|
||||
return false;
|
||||
|
||||
// BGRA is not accepted as an internal format in case of GL
|
||||
// EXT_texture_format_BGRA8888 is required for creating BGRA proxy textures in case of GLES
|
||||
if(format.bgraOrder)
|
||||
return IsGLES && HasExt[EXT_texture_format_BGRA8888];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user