GL: Fix half-float texture formats.

This matches the ps3 output/channels for these textures per the
rsx/texture_formats test.
This commit is contained in:
Unknown W. Brackets 2014-05-18 14:21:41 -07:00
parent 4f63f57d26
commit 06c4c45200

View File

@ -288,8 +288,14 @@ public:
break;
case CELL_GCM_TEXTURE_W16_Z16_Y16_X16_FLOAT: // Four fp16 values
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_BGRA, GL_HALF_FLOAT, pixels);
glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_TRUE);
checkForGlError("GLTexture::Init() -> glPixelStorei");
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_RGBA, GL_HALF_FLOAT, pixels);
checkForGlError("GLTexture::Init() -> glTexImage2D");
glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
checkForGlError("GLTexture::Init() -> glPixelStorei");
break;
case CELL_GCM_TEXTURE_W32_Z32_Y32_X32_FLOAT: // Four fp32 values
@ -336,10 +342,16 @@ public:
case CELL_GCM_TEXTURE_Y16_X16_FLOAT: // Two fp16 values
{
glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_TRUE);
checkForGlError("GLTexture::Init() -> glPixelStorei");
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.GetWidth(), tex.GetHeight(), 0, GL_RG, GL_HALF_FLOAT, pixels);
checkForGlError("GLTexture::Init() -> glTexImage2D");
static const GLint swizzleMaskX32_Y16_X16_FLOAT[] = { GL_GREEN, GL_RED, GL_GREEN, GL_RED };
glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
checkForGlError("GLTexture::Init() -> glPixelStorei");
static const GLint swizzleMaskX32_Y16_X16_FLOAT[] = { GL_RED, GL_GREEN, GL_RED, GL_GREEN };
glRemap = swizzleMaskX32_Y16_X16_FLOAT;
}
break;