Add support for GL_ETC1_RGB8_OES compressed texture format

This commit is contained in:
Janos Pantos
2017-05-18 13:47:56 +02:00
committed by Baldur Karlsson
parent 70514fc5ac
commit 1dcd39afd5
3 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -2024,7 +2024,8 @@ void ReplayProxy::RemapProxyTextureIfNeeded(ResourceFormat &format, GetTextureDa
case SpecialFormat::R5G6B5:
case SpecialFormat::ETC2: params.remap = eRemap_RGBA8; break;
default:
RDCERR("Don't know how to remap special format %u, falling back to RGBA32");
RDCERR("Don't know how to remap special format %u, falling back to RGBA32",
format.specialFormat);
params.remap = eRemap_RGBA32;
break;
}
+3
View File
@@ -1215,6 +1215,7 @@ ResourceFormat MakeResourceFormat(const GLHookSet &gl, GLenum target, GLenum fmt
case eGL_COMPRESSED_RG11_EAC:
case eGL_COMPRESSED_SIGNED_RG11_EAC: ret.compCount = 2; break;
case eGL_ETC1_RGB8_OES:
case eGL_COMPRESSED_RGB8_ETC2:
case eGL_COMPRESSED_SRGB8_ETC2: ret.compCount = 3; break;
case eGL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
@@ -1287,6 +1288,8 @@ ResourceFormat MakeResourceFormat(const GLHookSet &gl, GLenum target, GLenum fmt
case eGL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB:
ret.specialFormat = SpecialFormat::BC7;
break;
// ETC1
case eGL_ETC1_RGB8_OES: // handle it as ETC2
// ETC2
case eGL_COMPRESSED_RGB8_ETC2:
case eGL_COMPRESSED_SRGB8_ETC2:
+4
View File
@@ -72,6 +72,8 @@ size_t GetCompressedByteSize(GLsizei w, GLsizei h, GLsizei d, GLenum internalfor
case eGL_COMPRESSED_RGBA_BPTC_UNORM_ARB:
case eGL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB:
return (AlignUp4(w) * AlignUp4(h) * d);
// ETC1
case eGL_ETC1_RGB8_OES:
// ETC2
case eGL_COMPRESSED_RGB8_ETC2:
case eGL_COMPRESSED_SRGB8_ETC2:
@@ -807,6 +809,8 @@ bool IsCompressedFormat(GLenum internalFormat)
// BC7
case eGL_COMPRESSED_RGBA_BPTC_UNORM_ARB:
case eGL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB:
// ETC1
case eGL_ETC1_RGB8_OES:
// ETC2
case eGL_COMPRESSED_RGB8_ETC2:
case eGL_COMPRESSED_SRGB8_ETC2: