Mesa (master): st/mesa: set correct baseInternalFormat for _mesa_texstore in DrawPixels

Marek Olšák mareko at kemper.freedesktop.org
Fri May 13 23:55:34 UTC 2011


Module: Mesa
Branch: master
Commit: ad2999d2113356d526b39774eb8114e974dac048
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ad2999d2113356d526b39774eb8114e974dac048

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sat May 14 00:54:44 2011 +0200

st/mesa: set correct baseInternalFormat for _mesa_texstore in DrawPixels

GL_RGBA was always used for baseInternalFormat regardless of the chosen
texture internal format.

https://bugs.freedesktop.org/show_bug.cgi?id=37154

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/state_tracker/st_cb_drawpixels.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index e377861..9948f8d 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -39,6 +39,7 @@
 #include "main/pack.h"
 #include "main/pbo.h"
 #include "main/texformat.h"
+#include "main/teximage.h"
 #include "main/texstore.h"
 #include "program/program.h"
 #include "program/prog_print.h"
@@ -419,10 +420,10 @@ make_texture(struct st_context *st,
    gl_format mformat;
    struct pipe_resource *pt;
    enum pipe_format pipeFormat;
-   GLenum baseFormat, intFormat;
+   GLenum baseInternalFormat, intFormat;
 
-   baseFormat = base_format(format);
    intFormat = internal_format(ctx, format, type);
+   baseInternalFormat = _mesa_base_tex_format(ctx, intFormat);
 
    mformat = st_ChooseTextureFormat_renderable(ctx, intFormat,
                                                format, type, GL_FALSE);
@@ -465,7 +466,7 @@ make_texture(struct st_context *st,
        * the texture.  We deal with that with texcoords.
        */
       success = _mesa_texstore(ctx, 2,           /* dims */
-                               baseFormat,       /* baseInternalFormat */
+                               baseInternalFormat, /* baseInternalFormat */
                                mformat,          /* gl_format */
                                dest,             /* dest */
                                0, 0, 0,          /* dstX/Y/Zoffset */




More information about the mesa-commit mailing list