Handle GL_RGBA2 texture format as if it were GL_RGBA8

This commit is contained in:
baldurk
2019-08-12 20:47:31 +01:00
parent ff4a152df7
commit 6b3dc39b68
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -1782,6 +1782,14 @@ ResourceFormat MakeResourceFormat(GLenum target, GLenum fmt)
ret.compType = CompType::UNorm;
return ret;
}
else if(fmt == eGL_RGBA2)
{
// pretend it's RGBA8 and hope for the best
ret.compByteWidth = 1;
ret.compCount = 4;
ret.compType = CompType::UNorm;
return ret;
}
if(IsCompressedFormat(fmt))
{
+1
View File
@@ -533,6 +533,7 @@ GLenum GetDataType(GLenum internalFormat)
case eGL_R3_G3_B2: return eGL_UNSIGNED_BYTE_3_3_2;
case eGL_RGB4:
case eGL_RGBA4: return eGL_UNSIGNED_SHORT_4_4_4_4;
case eGL_RGBA2: return eGL_UNSIGNED_BYTE;
case eGL_RGB5_A1: return eGL_UNSIGNED_SHORT_5_5_5_1;
case eGL_RGB565:
case eGL_RGB5: return eGL_UNSIGNED_SHORT_5_6_5;