Added support for SRGB textures.
TRAC #23046
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Geoff Lang
git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2380 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/formatutils.cpp b/src/libGLESv2/formatutils.cpp
index 7552998..6faf728 100644
--- a/src/libGLESv2/formatutils.cpp
+++ b/src/libGLESv2/formatutils.cpp
@@ -1022,7 +1022,13 @@
if (conversionSet.find(conversion) != conversionSet.end())
{
// Section 3.8.5 of the GLES3 3.0.2 spec states that source and destination formats
- // must both be signed or unsigned or fixed/floating point
+ // must both be signed or unsigned or fixed/floating point and both source and destinations
+ // must be either both SRGB or both not SRGB
+
+ if (textureInternalFormatInfo.mIsSRGB != framebufferInternalFormatInfo.mIsSRGB)
+ {
+ return false;
+ }
if ((textureInternalFormatInfo.mStorageType == SignedInteger && framebufferInternalFormatInfo.mStorageType == SignedInteger ) ||
(textureInternalFormatInfo.mStorageType == UnsignedInteger && framebufferInternalFormatInfo.mStorageType == UnsignedInteger))