Commit eab70768 by Nicolas Capens Committed by Nicolas Capens

Remove redundant compressed format lookup.

glCompressedTexSubImage2D() takes an internalformat parameter which is already always a sized internal format. Change-Id: Iaf783e019e08d941053d5f347ee495bdd179f1ce Reviewed-on: https://swiftshader-review.googlesource.com/17050Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 1529c2ce
......@@ -316,85 +316,6 @@ bool Texture::setSwizzleA(GLenum swizzleA)
}
}
GLenum Texture::getMinFilter() const
{
return mMinFilter;
}
GLenum Texture::getMagFilter() const
{
return mMagFilter;
}
GLenum Texture::getWrapS() const
{
return mWrapS;
}
GLenum Texture::getWrapT() const
{
return mWrapT;
}
GLenum Texture::getWrapR() const
{
return mWrapR;
}
GLfloat Texture::getMaxAnisotropy() const
{
return mMaxAnisotropy;
}
GLint Texture::getBaseLevel() const
{
return mBaseLevel;
}
GLenum Texture::getCompareFunc() const
{
return mCompareFunc;
}
GLenum Texture::getCompareMode() const
{
return mCompareMode;
}
GLboolean Texture::getImmutableFormat() const
{
return mImmutableFormat;
}
GLsizei Texture::getImmutableLevels() const
{
return mImmutableLevels;
}
GLint Texture::getMaxLevel() const
{
return mMaxLevel;
}
GLfloat Texture::getMaxLOD() const
{
return mMaxLOD;
}
GLfloat Texture::getMinLOD() const
{
return mMinLOD;
}
GLenum Texture::getSwizzleR() const
{
return mSwizzleR;
}
GLenum Texture::getSwizzleG() const
{
return mSwizzleG;
}
GLenum Texture::getSwizzleB() const
{
return mSwizzleB;
}
GLenum Texture::getSwizzleA() const
{
return mSwizzleA;
}
GLsizei Texture::getDepth(GLenum target, GLint level) const
{
return 1;
......
......@@ -71,24 +71,24 @@ public:
bool setSwizzleB(GLenum swizzleB);
bool setSwizzleA(GLenum swizzleA);
GLenum getMinFilter() const;
GLenum getMagFilter() const;
GLenum getWrapS() const;
GLenum getWrapT() const;
GLenum getWrapR() const;
GLfloat getMaxAnisotropy() const;
GLint getBaseLevel() const;
GLenum getCompareFunc() const;
GLenum getCompareMode() const;
GLboolean getImmutableFormat() const;
GLsizei getImmutableLevels() const;
GLint getMaxLevel() const;
GLfloat getMaxLOD() const;
GLfloat getMinLOD() const;
GLenum getSwizzleR() const;
GLenum getSwizzleG() const;
GLenum getSwizzleB() const;
GLenum getSwizzleA() const;
GLenum getMinFilter() const { return mMinFilter; }
GLenum getMagFilter() const { return mMagFilter; }
GLenum getWrapS() const { return mWrapS; }
GLenum getWrapT() const { return mWrapT; }
GLenum getWrapR() const { return mWrapR; }
GLfloat getMaxAnisotropy() const { return mMaxAnisotropy; }
GLint getBaseLevel() const { return mBaseLevel; }
GLenum getCompareFunc() const { return mCompareFunc; }
GLenum getCompareMode() const { return mCompareMode; }
GLboolean getImmutableFormat() const { return mImmutableFormat; }
GLsizei getImmutableLevels() const { return mImmutableLevels; }
GLint getMaxLevel() const { return mMaxLevel; }
GLfloat getMaxLOD() const { return mMaxLOD; }
GLfloat getMinLOD() const { return mMinLOD; }
GLenum getSwizzleR() const { return mSwizzleR; }
GLenum getSwizzleG() const { return mSwizzleG; }
GLenum getSwizzleB() const { return mSwizzleB; }
GLenum getSwizzleA() const { return mSwizzleA; }
virtual GLsizei getWidth(GLenum target, GLint level) const = 0;
virtual GLsizei getHeight(GLenum target, GLint level) const = 0;
......
......@@ -882,8 +882,6 @@ void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yo
return error(GL_INVALID_OPERATION);
}
GLenum sizedInternalFormat = GetSizedInternalFormat(format, GL_NONE);
if(target == GL_TEXTURE_2D || target == GL_TEXTURE_RECTANGLE_ARB)
{
es2::Texture2D *texture = context->getTexture2D(target);
......@@ -900,7 +898,7 @@ void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yo
return error(validationError);
}
texture->subImageCompressed(level, xoffset, yoffset, width, height, sizedInternalFormat, imageSize, data);
texture->subImageCompressed(level, xoffset, yoffset, width, height, format, imageSize, data);
}
else if(es2::IsCubemapTextureTarget(target))
{
......@@ -918,7 +916,7 @@ void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yo
return error(validationError);
}
texture->subImageCompressed(target, level, xoffset, yoffset, width, height, sizedInternalFormat, imageSize, data);
texture->subImageCompressed(target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
else UNREACHABLE(target);
}
......
......@@ -127,11 +127,6 @@ namespace es2
InsertFormatMapping(&map, GL_SRGB_EXT, GL_UNSIGNED_BYTE, GL_SRGB8);
InsertFormatMapping(&map, GL_SRGB_ALPHA_EXT, GL_UNSIGNED_BYTE, GL_SRGB8_ALPHA8);
InsertFormatMapping(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGB_S3TC_DXT1_EXT);
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT);
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE);
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE);
InsertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_DEPTH_COMPONENT16);
InsertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_DEPTH_COMPONENT32_OES);
InsertFormatMapping(&map, GL_DEPTH_COMPONENT, GL_FLOAT, GL_DEPTH_COMPONENT32F);
......
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