[Mesa-dev] [PATCH] st/mesa: treat 1D ARRAY upload like a depth or 2D array upload.
Brian Paul
brianp at vmware.com
Fri Feb 18 10:30:04 PST 2011
On 02/17/2011 09:58 PM, Dave Airlie wrote:
> 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.
I took a quick look and this seems OK (plus the texsubimage case).
-Brian
More information about the mesa-dev
mailing list