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:
Janos Pantos
2017-12-20 16:11:57 +01:00
committed by Baldur Karlsson
parent 3a0c55d0f7
commit 78cce78cb1
3 changed files with 10 additions and 0 deletions
+4
View File
@@ -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;
+1
View File
@@ -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) \
+5
View File
@@ -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;
}