aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_drawpixels.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-10-30 13:55:56 -0600
committerBrian <[email protected]>2007-10-30 13:55:56 -0600
commitee70c02b62f7692de6293045928c47168652bd1c (patch)
tree2ba229eeab08eec270b5322c7c7b9f897226bc9d /src/mesa/state_tracker/st_cb_drawpixels.c
parent4836217850114e0972900a68fd7d93e2e241819b (diff)
Before calling texformat->StoreImage() set _ImageTransferState=0 since we'll do pixel transfer in the fragment program.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_drawpixels.c')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index ff7aa7d74b5..3359338385b 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -424,6 +424,7 @@ make_mipmap_tree(struct st_context *st,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels)
{
+ GLcontext *ctx = st->ctx;
struct pipe_context *pipe = st->pipe;
const struct gl_texture_format *mformat;
struct pipe_mipmap_tree *mt;
@@ -432,7 +433,7 @@ make_mipmap_tree(struct st_context *st,
baseFormat = _mesa_base_format(format);
- mformat = st_ChooseTextureFormat(st->ctx, baseFormat, format, type);
+ mformat = st_ChooseTextureFormat(ctx, baseFormat, format, type);
assert(mformat);
pipeFormat = st_mesa_format_to_pipe_format(mformat->MesaFormat);
@@ -455,6 +456,10 @@ make_mipmap_tree(struct st_context *st,
GLboolean success;
GLuint pitch = mt->region->pitch;
GLubyte *dest;
+ const GLbitfield imageTransferStateSave = ctx->_ImageTransferState;
+
+ /* we'll do pixel transfer in a fragment shader */
+ ctx->_ImageTransferState = 0x0;
/* map texture region */
dest = pipe->region_map(pipe, mt->region);
@@ -463,7 +468,7 @@ make_mipmap_tree(struct st_context *st,
* Note that the image is actually going to be upside down in
* the texture. We deal with that with texcoords.
*/
- success = mformat->StoreImage(st->ctx, 2, /* dims */
+ success = mformat->StoreImage(ctx, 2, /* dims */
baseFormat, /* baseInternalFormat */
mformat, /* gl_texture_format */
dest, /* dest */
@@ -478,6 +483,9 @@ make_mipmap_tree(struct st_context *st,
/* unmap */
pipe->region_unmap(pipe, mt->region);
assert(success);
+
+ /* restore */
+ ctx->_ImageTransferState = imageTransferStateSave;
}
#if 0