Skip to contentSkip to conversation

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

PATCH In review Ilia Mirkin 2 participants 2 messages May 10, 2014 – May 11, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 src/gallium/drivers/nouveau/nv50/nv50_surface.c | 6 ++++++
 1 file changed, 6 insertions(+)
src/gallium/drivers/nouveau/nv50/nv50_surface.c +6 -0
index 8addefe..23613d8 100644
@@ -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) {
Signature · 1 line
1.8.5.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Ilia Mirkin

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.

Quoted 28 lines
---
 src/gallium/drivers/nouveau/nv50/nv50_surface.c | 6 ++++++
 1 file changed, 6 insertions(+)
src/gallium/drivers/nouveau/nv50/nv50_surface.c +6 -1
index 8addefe..23613d8 100644
@@ -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) {
--

1.8.5.5

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev