Don't change an already sized internalformat. Closes #990

This commit is contained in:
baldurk
2018-05-23 16:02:09 +01:00
parent 921d5b7266
commit 54ce79d8ae
+9 -9
View File
@@ -568,15 +568,6 @@ int GetNumMips(const GLHookSet &gl, GLenum target, GLuint tex, GLuint w, GLuint
GLenum GetSizedFormat(const GLHookSet &gl, GLenum target, GLenum internalFormat, GLenum type)
{
switch(type)
{
// some types imply a sized internalFormat
case eGL_UNSIGNED_SHORT_5_6_5: return eGL_RGB565;
case eGL_UNSIGNED_SHORT_4_4_4_4: return eGL_RGBA4;
case eGL_UNSIGNED_SHORT_5_5_5_1: return eGL_RGB5_A1;
default: break;
}
switch(internalFormat)
{
// pick sized format ourselves for generic formats
@@ -604,6 +595,15 @@ GLenum GetSizedFormat(const GLHookSet &gl, GLenum target, GLenum internalFormat,
return internalFormat; // already explicitly sized
}
switch(type)
{
// some types imply a sized internalFormat
case eGL_UNSIGNED_SHORT_5_6_5: return eGL_RGB565;
case eGL_UNSIGNED_SHORT_4_4_4_4: return eGL_RGBA4;
case eGL_UNSIGNED_SHORT_5_5_5_1: return eGL_RGB5_A1;
default: break;
}
switch(target)
{
case eGL_TEXTURE_CUBE_MAP_POSITIVE_X: