Some cleanup after the previous sized internal format patches

TRAC #21609 Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/trunk@1304 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 8e91d25a
...@@ -80,8 +80,8 @@ enum ...@@ -80,8 +80,8 @@ enum
MAX_FRAGMENT_UNIFORM_VECTORS_SM3 = 224 - 3, MAX_FRAGMENT_UNIFORM_VECTORS_SM3 = 224 - 3,
MAX_DRAW_BUFFERS = 1, MAX_DRAW_BUFFERS = 1,
GL_BGRA4_REV = 0x6ABC, GL_BGRA4_ANGLEX = 0x6ABC,
GL_BGR5_A1_REV = 0x6ABD GL_BGR5_A1_ANGLEX = 0x6ABD
}; };
enum QueryType enum QueryType
......
...@@ -28,7 +28,7 @@ namespace gl ...@@ -28,7 +28,7 @@ namespace gl
{ {
unsigned int TextureStorage::mCurrentTextureSerial = 1; unsigned int TextureStorage::mCurrentTextureSerial = 1;
static D3DFORMAT ConvertTextureFormatType(GLint internalformat) static D3DFORMAT ConvertTextureInternalFormat(GLint internalformat)
{ {
switch (internalformat) switch (internalformat)
{ {
...@@ -168,7 +168,7 @@ bool Image::redefine(GLint internalformat, GLsizei width, GLsizei height, bool f ...@@ -168,7 +168,7 @@ bool Image::redefine(GLint internalformat, GLsizei width, GLsizei height, bool f
mHeight = height; mHeight = height;
mInternalFormat = internalformat; mInternalFormat = internalformat;
// compute the d3d format that will be used // compute the d3d format that will be used
mD3DFormat = ConvertTextureFormatType(internalformat); mD3DFormat = ConvertTextureInternalFormat(internalformat);
if (mSurface) if (mSurface)
{ {
...@@ -1717,7 +1717,7 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo ...@@ -1717,7 +1717,7 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo
void Texture2D::storage(GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) void Texture2D::storage(GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
{ {
D3DFORMAT d3dfmt = ConvertTextureFormatType(internalformat); D3DFORMAT d3dfmt = ConvertTextureInternalFormat(internalformat);
DWORD d3dusage = GetTextureUsage(d3dfmt, mUsage, false); DWORD d3dusage = GetTextureUsage(d3dfmt, mUsage, false);
delete mTexStorage; delete mTexStorage;
...@@ -1776,8 +1776,8 @@ bool Texture2D::isSamplerComplete() const ...@@ -1776,8 +1776,8 @@ bool Texture2D::isSamplerComplete() const
default: UNREACHABLE(); default: UNREACHABLE();
} }
if ((gl::ExtractType(getInternalFormat(0)) == GL_FLOAT && !getContext()->supportsFloat32LinearFilter()) || if ((IsFloat32Format(getInternalFormat(0)) && !getContext()->supportsFloat32LinearFilter()) ||
(gl::ExtractType(getInternalFormat(0)) == GL_HALF_FLOAT_OES && !getContext()->supportsFloat16LinearFilter())) (IsFloat16Format(getInternalFormat(0)) && !getContext()->supportsFloat16LinearFilter()))
{ {
if (mMagFilter != GL_NEAREST || (mMinFilter != GL_NEAREST && mMinFilter != GL_NEAREST_MIPMAP_NEAREST)) if (mMagFilter != GL_NEAREST || (mMinFilter != GL_NEAREST && mMinFilter != GL_NEAREST_MIPMAP_NEAREST))
{ {
...@@ -2675,7 +2675,7 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi ...@@ -2675,7 +2675,7 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi
void TextureCubeMap::storage(GLsizei levels, GLenum internalformat, GLsizei size) void TextureCubeMap::storage(GLsizei levels, GLenum internalformat, GLsizei size)
{ {
D3DFORMAT d3dfmt = ConvertTextureFormatType(internalformat); D3DFORMAT d3dfmt = ConvertTextureInternalFormat(internalformat);
DWORD d3dusage = GetTextureUsage(d3dfmt, mUsage, false); DWORD d3dusage = GetTextureUsage(d3dfmt, mUsage, false);
delete mTexStorage; delete mTexStorage;
......
...@@ -1337,14 +1337,6 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma ...@@ -1337,14 +1337,6 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma
} }
break; break;
case GL_LUMINANCE: case GL_LUMINANCE:
if (colorbufferFormat != GL_RGB565 &&
colorbufferFormat != GL_RGB8_OES &&
colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA8_OES)
{
return error(GL_INVALID_OPERATION);
}
case GL_RGB: case GL_RGB:
if (colorbufferFormat != GL_RGB565 && if (colorbufferFormat != GL_RGB565 &&
colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_RGB8_OES &&
...@@ -1544,16 +1536,6 @@ void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GL ...@@ -1544,16 +1536,6 @@ void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GL
} }
break; break;
case GL_LUMINANCE: case GL_LUMINANCE:
if (colorbufferFormat != GL_RGB565 &&
colorbufferFormat != GL_RGB8_OES &&
colorbufferFormat != GL_RGBA &&
colorbufferFormat != GL_RGBA4 &&
colorbufferFormat != GL_RGB5_A1 &&
colorbufferFormat != GL_RGBA8_OES)
{
return error(GL_INVALID_OPERATION);
}
break;
case GL_RGB: case GL_RGB:
if (colorbufferFormat != GL_RGB565 && if (colorbufferFormat != GL_RGB565 &&
colorbufferFormat != GL_RGB8_OES && colorbufferFormat != GL_RGB8_OES &&
......
...@@ -323,8 +323,8 @@ int ComputePixelSize(GLint internalformat) ...@@ -323,8 +323,8 @@ int ComputePixelSize(GLint internalformat)
case GL_RGBA32F_EXT: return sizeof(float) * 4; case GL_RGBA32F_EXT: return sizeof(float) * 4;
case GL_RGBA16F_EXT: return sizeof(unsigned short) * 4; case GL_RGBA16F_EXT: return sizeof(unsigned short) * 4;
case GL_BGRA8_EXT: return sizeof(unsigned char) * 4; case GL_BGRA8_EXT: return sizeof(unsigned char) * 4;
case GL_BGRA4_REV: return sizeof(unsigned short); case GL_BGRA4_ANGLEX: return sizeof(unsigned short);
case GL_BGR5_A1_REV: return sizeof(unsigned short); case GL_BGR5_A1_ANGLEX: return sizeof(unsigned short);
default: UNREACHABLE(); default: UNREACHABLE();
} }
...@@ -398,8 +398,8 @@ GLint ConvertSizedInternalFormat(GLenum format, GLenum type) ...@@ -398,8 +398,8 @@ GLint ConvertSizedInternalFormat(GLenum format, GLenum type)
switch (type) switch (type)
{ {
case GL_UNSIGNED_BYTE: return GL_BGRA8_EXT; case GL_UNSIGNED_BYTE: return GL_BGRA8_EXT;
case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT: return GL_BGRA4_REV; case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT: return GL_BGRA4_ANGLEX;
case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT: return GL_BGR5_A1_REV; case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT: return GL_BGR5_A1_ANGLEX;
default: UNIMPLEMENTED(); default: UNIMPLEMENTED();
} }
break; break;
......
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