summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pixelstore.c
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2014-05-20 22:37:13 +1200
committerChris Forbes <[email protected]>2014-06-10 07:38:42 +1200
commit75a5823749420bbbb71a00abe482bd40d4d2c97b (patch)
treef20d6f542656e6fd2441c4f93374e8ef719c3ede /src/mesa/main/pixelstore.c
parent1fca84e7a0542e98ee635fad970cf72ca598b05a (diff)
mesa: Add new pixel pack/unpack state for
ARB_compressed_texture_pixel_storage Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/pixelstore.c')
-rw-r--r--src/mesa/main/pixelstore.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/mesa/main/pixelstore.c b/src/mesa/main/pixelstore.c
index 86625e411e5..05f6583a481 100644
--- a/src/mesa/main/pixelstore.c
+++ b/src/mesa/main/pixelstore.c
@@ -97,6 +97,34 @@ _mesa_PixelStorei( GLenum pname, GLint param )
goto invalid_enum_error;
ctx->Pack.Invert = param;
break;
+ case GL_PACK_COMPRESSED_BLOCK_WIDTH:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ if (param<0)
+ goto invalid_value_error;
+ ctx->Pack.CompressedBlockWidth = param;
+ break;
+ case GL_PACK_COMPRESSED_BLOCK_HEIGHT:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ if (param<0)
+ goto invalid_value_error;
+ ctx->Pack.CompressedBlockHeight = param;
+ break;
+ case GL_PACK_COMPRESSED_BLOCK_DEPTH:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ if (param<0)
+ goto invalid_value_error;
+ ctx->Pack.CompressedBlockDepth = param;
+ break;
+ case GL_PACK_COMPRESSED_BLOCK_SIZE:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ if (param<0)
+ goto invalid_value_error;
+ ctx->Pack.CompressedBlockSize = param;
+ break;
case GL_UNPACK_SWAP_BYTES:
if (!_mesa_is_desktop_gl(ctx))
@@ -148,6 +176,34 @@ _mesa_PixelStorei( GLenum pname, GLint param )
goto invalid_value_error;
ctx->Unpack.Alignment = param;
break;
+ case GL_UNPACK_COMPRESSED_BLOCK_WIDTH:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ if (param<0)
+ goto invalid_value_error;
+ ctx->Unpack.CompressedBlockWidth = param;
+ break;
+ case GL_UNPACK_COMPRESSED_BLOCK_HEIGHT:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ if (param<0)
+ goto invalid_value_error;
+ ctx->Unpack.CompressedBlockHeight = param;
+ break;
+ case GL_UNPACK_COMPRESSED_BLOCK_DEPTH:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ if (param<0)
+ goto invalid_value_error;
+ ctx->Unpack.CompressedBlockDepth = param;
+ break;
+ case GL_UNPACK_COMPRESSED_BLOCK_SIZE:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
+ if (param<0)
+ goto invalid_value_error;
+ ctx->Unpack.CompressedBlockSize = param;
+ break;
default:
goto invalid_enum_error;
}
@@ -188,6 +244,10 @@ _mesa_init_pixelstore( struct gl_context *ctx )
ctx->Pack.SwapBytes = GL_FALSE;
ctx->Pack.LsbFirst = GL_FALSE;
ctx->Pack.Invert = GL_FALSE;
+ ctx->Pack.CompressedBlockWidth = 0;
+ ctx->Pack.CompressedBlockHeight = 0;
+ ctx->Pack.CompressedBlockDepth = 0;
+ ctx->Pack.CompressedBlockSize = 0;
_mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj,
ctx->Shared->NullBufferObj);
ctx->Unpack.Alignment = 4;
@@ -199,6 +259,10 @@ _mesa_init_pixelstore( struct gl_context *ctx )
ctx->Unpack.SwapBytes = GL_FALSE;
ctx->Unpack.LsbFirst = GL_FALSE;
ctx->Unpack.Invert = GL_FALSE;
+ ctx->Unpack.CompressedBlockWidth = 0;
+ ctx->Unpack.CompressedBlockHeight = 0;
+ ctx->Unpack.CompressedBlockDepth = 0;
+ ctx->Unpack.CompressedBlockSize = 0;
_mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj,
ctx->Shared->NullBufferObj);