Made GL_RGB textures map to D3DFMT_X8R8G8B8.

I suspect there is a subtle reason why this is the wrong thing to do.

The issue I am trying to address is glBlitFramebufferANGLE generating an error when bliting from a GL_RGB8_OES renderbuffer to a GL_RGB texture bound to the read framebuffer and draw framebuffer respectively. It verifies that both surfaces have the same underlying D3DFMT but GL_RGB8_OES renderbuffers are backed by X8R8G8B8 and GL_RGB textures were previously backed by A8R8G8B8.

Since textures cannot as far as I know be created GL_RGB8_OES, it would be useful to have a way to blit from a GL_RGB8_OES renderbuffer to a GL_RGB texture.




Review URL: http://codereview.appspot.com/2822041

git-svn-id: http://angleproject.googlecode.com/svn/trunk@481 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Texture.cpp b/src/libGLESv2/Texture.cpp
index abf2360..c9701d7 100644
--- a/src/libGLESv2/Texture.cpp
+++ b/src/libGLESv2/Texture.cpp
@@ -191,6 +191,7 @@
       case D3DFMT_DXT1:
         return false;
       case D3DFMT_A8R8G8B8:
+      case D3DFMT_X8R8G8B8:
       case D3DFMT_A16B16G16R16F:
       case D3DFMT_A32B32G32R32F:
         return true;
@@ -227,6 +228,10 @@
         {
             return D3DFMT_A8L8;
         }
+        else if (format == GL_RGB)
+        {
+            return D3DFMT_X8R8G8B8;
+        }
 
         return D3DFMT_A8R8G8B8;
     }