GL3: Fix for texture formats

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 11 years ago
parent d415ff508e
commit 25cb297dcf

@ -359,7 +359,7 @@ static GLint getGlSrcTextureFormat(ITexture &tex, GLint glfmt)
H_AUTO_OGL(getGlSrcTextureFormat) H_AUTO_OGL(getGlSrcTextureFormat)
// Is destination format is alpha or lumiance ? // Is destination format is alpha or lumiance ?
if ((glfmt==GL_ALPHA8)||(glfmt==GL_LUMINANCE8_ALPHA8)||(glfmt==GL_LUMINANCE8)) if ((glfmt==GL_R8)||(glfmt==GL_RG8))
{ {
switch(tex.getPixelFormat()) switch(tex.getPixelFormat())
{ {
@ -416,23 +416,17 @@ uint CDriverGL3::computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const
#ifdef GL_RGB5 #ifdef GL_RGB5
case GL_RGB5: return w*h* 2; case GL_RGB5: return w*h* 2;
#endif #endif
#ifdef GL_LUMINANCE8 #ifdef GL_R8
case GL_LUMINANCE8: return w*h* 1; case GL_R8: return w*h* 1;
#endif #endif
#ifdef GL_LUMINANCE #ifdef GL_RED
case GL_LUMINANCE: return w*h* 1; case GL_RED: return w*h* 1;
#endif #endif
#ifdef GL_ALPHA8 #ifdef GL_RG8
case GL_ALPHA8: return w*h* 1; case GL_RG8: return w*h* 2;
#endif #endif
#ifdef GL_ALPHA #ifdef GL_RG
case GL_ALPHA: return w*h* 1; case GL_RG: return w*h* 2;
#endif
#ifdef GL_LUMINANCE8_ALPHA8
case GL_LUMINANCE8_ALPHA8: return w*h* 2;
#endif
#ifdef GL_LUMINANCE_ALPHA
case GL_LUMINANCE_ALPHA: return w*h* 2;
#endif #endif
#ifdef GL_COMPRESSED_RGB_S3TC_DXT1_EXT #ifdef GL_COMPRESSED_RGB_S3TC_DXT1_EXT
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: return w*h /2; case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: return w*h /2;
@ -446,9 +440,6 @@ uint CDriverGL3::computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const
#ifdef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT #ifdef GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: return w*h* 1; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: return w*h* 1;
#endif #endif
case GL_RG8:
return w * h * 2;
} }
// One format has not been coded. // One format has not been coded.

Loading…
Cancel
Save