Commit 9c857952 by apatrick@chromium.org

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: https://angleproject.googlecode.com/svn/trunk@481 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent f99fbb77
...@@ -191,6 +191,7 @@ bool Texture::isRenderableFormat() const ...@@ -191,6 +191,7 @@ bool Texture::isRenderableFormat() const
case D3DFMT_DXT1: case D3DFMT_DXT1:
return false; return false;
case D3DFMT_A8R8G8B8: case D3DFMT_A8R8G8B8:
case D3DFMT_X8R8G8B8:
case D3DFMT_A16B16G16R16F: case D3DFMT_A16B16G16R16F:
case D3DFMT_A32B32G32R32F: case D3DFMT_A32B32G32R32F:
return true; return true;
...@@ -227,6 +228,10 @@ D3DFORMAT Texture::selectFormat(GLenum format, GLenum type) ...@@ -227,6 +228,10 @@ D3DFORMAT Texture::selectFormat(GLenum format, GLenum type)
{ {
return D3DFMT_A8L8; return D3DFMT_A8L8;
} }
else if (format == GL_RGB)
{
return D3DFMT_X8R8G8B8;
}
return D3DFMT_A8R8G8B8; return D3DFMT_A8R8G8B8;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment