Support copying R5G6B5 to L8.

TRAC #13792 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@463 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent dd438af8
...@@ -1006,6 +1006,26 @@ void Texture::copyNonRenderable(Image *image, GLenum internalFormat, GLint xoffs ...@@ -1006,6 +1006,26 @@ void Texture::copyNonRenderable(Image *image, GLenum internalFormat, GLint xoffs
UNREACHABLE(); UNREACHABLE();
} }
break; break;
case D3DFMT_R5G6B5:
switch(getD3DFormat())
{
case D3DFMT_L8:
for(int y = 0; y < height; y++)
{
for(int x = 0; x < height; x++)
{
unsigned char red = source[x * 2 + 1] & 0xF8;
dest[x] = red | (red >> 5);
}
source += sourceLock.Pitch;
dest += destLock.Pitch;
}
break;
default:
UNREACHABLE();
}
break;
default: default:
UNREACHABLE(); UNREACHABLE();
} }
......
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