[Mesa-dev] [PATCH] st/mesa: treat 1D ARRAY upload like a depth or 2D array upload.

Dave Airlie airlied at gmail.com
Thu Feb 17 20:58:43 PST 2011


From: Dave Airlie <airlied at redhat.com>

This is because the HW doesn't always store a 1D array like a
2D texture, it more likely stores it like 2D texture (i.e.
alignments etc).

This means we upload each slice separately and let the driver
work out where to put it.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/mesa/state_tracker/st_cb_texture.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index b758854..4da4e75 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -554,6 +554,12 @@ st_TexImage(struct gl_context * ctx,
 					   pixels, unpack, "glTexImage");
    }
 
+   /* for a 1D array upload the image as a series of layer with height = 1 */
+   if (target == GL_TEXTURE_1D_ARRAY) {
+      depth = height;
+      height = 1;
+   }
+
    /*
     * Prepare to store the texture data.  Either map the gallium texture buffer
     * memory or malloc space for it.
-- 
1.7.3.2



More information about the mesa-dev mailing list