From e07862d2c949bcae7c71e9fc8e90e4694ed25bb3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:27:59 -0600 Subject: [PATCH] st/mesa: use _mesa_get_texstore_func() --- src/mesa/state_tracker/st_cb_drawpixels.c | 26 +++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 99f3ba678bb..c56f987628c 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -35,6 +35,7 @@ #include "main/bufferobj.h" #include "main/macros.h" #include "main/texformat.h" +#include "main/texstore.h" #include "main/state.h" #include "shader/program.h" #include "shader/prog_parameter.h" @@ -391,6 +392,8 @@ make_texture(struct st_context *st, GLboolean success; GLubyte *dest; const GLbitfield imageTransferStateSave = ctx->_ImageTransferState; + const StoreTexImageFunc storeImage = + _mesa_get_texstore_func(mformat->MesaFormat); /* we'll do pixel transfer in a fragment shader */ ctx->_ImageTransferState = 0x0; @@ -402,21 +405,22 @@ make_texture(struct st_context *st, /* map texture transfer */ dest = screen->transfer_map(screen, transfer); + /* Put image into texture transfer. * Note that the image is actually going to be upside down in * the texture. We deal with that with texcoords. */ - success = mformat->StoreImage(ctx, 2, /* dims */ - baseFormat, /* baseInternalFormat */ - mformat, /* gl_texture_format */ - dest, /* dest */ - 0, 0, 0, /* dstX/Y/Zoffset */ - transfer->stride, /* dstRowStride, bytes */ - &dstImageOffsets, /* dstImageOffsets */ - width, height, 1, /* size */ - format, type, /* src format/type */ - pixels, /* data source */ - unpack); + success = storeImage(ctx, 2, /* dims */ + baseFormat, /* baseInternalFormat */ + mformat, /* gl_texture_format */ + dest, /* dest */ + 0, 0, 0, /* dstX/Y/Zoffset */ + transfer->stride, /* dstRowStride, bytes */ + &dstImageOffsets, /* dstImageOffsets */ + width, height, 1, /* size */ + format, type, /* src format/type */ + pixels, /* data source */ + unpack); /* unmap */ screen->transfer_unmap(screen, transfer); -- 2.30.2