summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2014-05-30 17:33:54 -0700
committerCarl Worth <cworth@cworth.org>2014-08-06 14:35:17 -0700
commitd21e0d34fc10c01028daeced1adb4cf9142d9b33 (patch)
treea0b9dd778b686e3615933c2db2260e928a4d9b3c /src
parent8bb6628cb98a2c92197d9af3614d3bfdc0b4da53 (diff)
mesa: Turn target_can_be_compressed() in to a utility function
V2: Declare the function in teximage.h Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> (cherry picked from commit ac2adf66c1ce009fed9175c891f4d90c6d79b7ab)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/teximage.c12
-rw-r--r--src/mesa/main/teximage.h3
2 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index c7f301cbdd3..1d938630c4e 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1779,9 +1779,9 @@ compressedteximage_only_format(const struct gl_context *ctx, GLenum format)
* Helper function to determine whether a target and specific compression
* format are supported.
*/
-static GLboolean
-target_can_be_compressed(const struct gl_context *ctx, GLenum target,
- GLenum intFormat)
+GLboolean
+_mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
+ GLenum intFormat)
{
(void) intFormat; /* not used yet */
@@ -2204,7 +2204,7 @@ texture_error_check( struct gl_context *ctx,
/* additional checks for compressed textures */
if (_mesa_is_compressed_format(ctx, internalFormat)) {
- if (!target_can_be_compressed(ctx, target, internalFormat)) {
+ if (!_mesa_target_can_be_compressed(ctx, target, internalFormat)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glTexImage%dD(target can't be compressed)", dimensions);
return GL_TRUE;
@@ -2260,7 +2260,7 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
GLenum error = GL_NO_ERROR;
char *reason = ""; /* no error */
- if (!target_can_be_compressed(ctx, target, internalFormat)) {
+ if (!_mesa_target_can_be_compressed(ctx, target, internalFormat)) {
reason = "target";
error = GL_INVALID_ENUM;
goto error;
@@ -2694,7 +2694,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
}
if (_mesa_is_compressed_format(ctx, internalFormat)) {
- if (!target_can_be_compressed(ctx, target, internalFormat)) {
+ if (!_mesa_target_can_be_compressed(ctx, target, internalFormat)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glCopyTexImage%dD(target)", dimensions);
return GL_TRUE;
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 51d94d17e82..b6e65e3d478 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -123,6 +123,9 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
mesa_format format,
GLint width, GLint height, GLint depth, GLint border);
+extern GLboolean
+_mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target,
+ GLenum intFormat);
extern GLuint
_mesa_tex_target_to_face(GLenum target);