Mesa (master): nv50,nvc0: fix blit 3d path for 1d array textures

Ilia Mirkin imirkin at kemper.freedesktop.org
Sun May 11 23:29:03 UTC 2014


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sat May 10 17:51:21 2014 -0400

nv50,nvc0: fix blit 3d path for 1d array textures

Need to adjust coordinates since the shader receives the array index as
depth in z, but the TEX instruction expects it to be the second
coordinate for a 1D array texture. This fixes fbo-generatemipmap-array.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Ben Skeggs <bskeggs at redhat.com>
Cc: "10.2" <mesa-stable at lists.freedesktop.org>

---

 src/gallium/drivers/nouveau/nv50/nv50_surface.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
index df3bc86..d02f5fe 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
@@ -698,6 +698,12 @@ nv50_blitter_make_fp(struct pipe_context *pipe,
    tc = ureg_DECL_fs_input(
       ureg, TGSI_SEMANTIC_GENERIC, 0, TGSI_INTERPOLATE_LINEAR);
 
+   if (ptarg == PIPE_TEXTURE_1D_ARRAY) {
+      /* Adjust coordinates. Depth is in z, but TEX expects it to be in y. */
+      tc = ureg_swizzle(tc, TGSI_SWIZZLE_X, TGSI_SWIZZLE_Z,
+                        TGSI_SWIZZLE_Z, TGSI_SWIZZLE_Z);
+   }
+
    data = ureg_DECL_temporary(ureg);
 
    if (tex_s) {




More information about the mesa-commit mailing list