summaryrefslogtreecommitdiff
path: root/src/mesa/main/dlist.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-11-10 15:46:52 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-11-10 15:46:52 +0000
commit60909388ab136d849d99eab49e782a53772a618f (patch)
tree84a981ea2e79b5e6477d05991119a23efa4429a5 /src/mesa/main/dlist.c
parentf00d7edd746e4d1eec2d497419f21fb3b04f8bd4 (diff)
GL_(UN)PACK_SKIP_IMAGES should only be applied to 3D texture pack/unpacking
and ignored for 1D and 2D images. Need to pass in image dimensions (1,2,3) to the _mesa_image_address() function. This change gets propogated to some other routines. Also added new _mesa_image_address[123]d() convenience functions.
Diffstat (limited to 'src/mesa/main/dlist.c')
-rw-r--r--src/mesa/main/dlist.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 9f4b9119a7..1f36411a94 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -810,19 +810,19 @@ _mesa_init_lists( void )
* \todo This won't suffice when the PBO is really in VRAM/GPU memory.
*/
static GLvoid *
-unpack_image( GLsizei width, GLsizei height, GLsizei depth,
+unpack_image( GLuint dimensions, GLsizei width, GLsizei height, GLsizei depth,
GLenum format, GLenum type, const GLvoid *pixels,
const struct gl_pixelstore_attrib *unpack )
{
if (unpack->BufferObj->Name == 0) {
/* no PBO */
- return _mesa_unpack_image(width, height, depth, format, type,
+ return _mesa_unpack_image(dimensions, width, height, depth, format, type,
pixels, unpack);
}
- else if (_mesa_validate_pbo_access(unpack, width, height, depth, format,
- type, pixels)) {
+ else if (_mesa_validate_pbo_access(dimensions, unpack, width, height, depth,
+ format, type, pixels)) {
const GLubyte *src = ADD_POINTERS(unpack->BufferObj->Data, pixels);
- return _mesa_unpack_image(width, height, depth, format, type,
+ return _mesa_unpack_image(dimensions, width, height, depth, format, type,
src, unpack);
}
/* bad access! */
@@ -1296,7 +1296,7 @@ static void GLAPIENTRY save_ColorTable( GLenum target, GLenum internalFormat,
format, type, table );
}
else {
- GLvoid *image = unpack_image(width, 1, 1, format, type, table,
+ GLvoid *image = unpack_image(1, width, 1, 1, format, type, table,
&ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
@@ -1385,7 +1385,7 @@ static void GLAPIENTRY save_ColorSubTable( GLenum target, GLsizei start, GLsizei
const GLvoid *table)
{
GET_CURRENT_CONTEXT(ctx);
- GLvoid *image = unpack_image(count, 1, 1, format, type, table,
+ GLvoid *image = unpack_image(1, count, 1, 1, format, type, table,
&ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
@@ -1456,7 +1456,7 @@ save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width,
GLenum format, GLenum type, const GLvoid *filter)
{
GET_CURRENT_CONTEXT(ctx);
- GLvoid *image = unpack_image(width, 1, 1, format, type, filter,
+ GLvoid *image = unpack_image(1, width, 1, 1, format, type, filter,
&ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
@@ -1485,7 +1485,7 @@ save_ConvolutionFilter2D(GLenum target, GLenum internalFormat,
GLenum type, const GLvoid *filter)
{
GET_CURRENT_CONTEXT(ctx);
- GLvoid *image = unpack_image(width, height, 1, format, type, filter,
+ GLvoid *image = unpack_image(2, width, height, 1, format, type, filter,
&ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
@@ -1850,7 +1850,7 @@ static void GLAPIENTRY save_DrawPixels( GLsizei width, GLsizei height,
const GLvoid *pixels )
{
GET_CURRENT_CONTEXT(ctx);
- GLvoid *image = unpack_image(width, height, 1, format, type,
+ GLvoid *image = unpack_image(2, width, height, 1, format, type,
pixels, &ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
@@ -3418,7 +3418,7 @@ static void GLAPIENTRY save_TexImage1D( GLenum target,
border, format, type, pixels );
}
else {
- GLvoid *image = unpack_image(width, 1, 1, format, type,
+ GLvoid *image = unpack_image(1, width, 1, 1, format, type,
pixels, &ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
@@ -3457,7 +3457,7 @@ static void GLAPIENTRY save_TexImage2D( GLenum target,
height, border, format, type, pixels );
}
else {
- GLvoid *image = unpack_image(width, height, 1, format, type,
+ GLvoid *image = unpack_image(2, width, height, 1, format, type,
pixels, &ctx->Unpack);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
@@ -3499,7 +3499,7 @@ static void GLAPIENTRY save_TexImage3D( GLenum target,
}
else {
Node *n;
- GLvoid *image = unpack_image(width, height, depth, format, type,
+ GLvoid *image = unpack_image(3, width, height, depth, format, type,
pixels, &ctx->Unpack);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = ALLOC_INSTRUCTION( ctx, OPCODE_TEX_IMAGE3D, 10 );
@@ -3532,7 +3532,7 @@ static void GLAPIENTRY save_TexSubImage1D( GLenum target, GLint level, GLint xof
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- GLvoid *image = unpack_image(width, 1, 1, format, type,
+ GLvoid *image = unpack_image(1, width, 1, 1, format, type,
pixels, &ctx->Unpack);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = ALLOC_INSTRUCTION( ctx, OPCODE_TEX_SUB_IMAGE1D, 7 );
@@ -3563,7 +3563,7 @@ static void GLAPIENTRY save_TexSubImage2D( GLenum target, GLint level,
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- GLvoid *image = unpack_image(width, height, 1, format, type,
+ GLvoid *image = unpack_image(2, width, height, 1, format, type,
pixels, &ctx->Unpack);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = ALLOC_INSTRUCTION( ctx, OPCODE_TEX_SUB_IMAGE2D, 9 );
@@ -3596,7 +3596,7 @@ static void GLAPIENTRY save_TexSubImage3D( GLenum target, GLint level,
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
- GLvoid *image = unpack_image(width, height, depth, format, type,
+ GLvoid *image = unpack_image(3, width, height, depth, format, type,
pixels, &ctx->Unpack);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
n = ALLOC_INSTRUCTION( ctx, OPCODE_TEX_SUB_IMAGE3D, 11 );