freedreno/a4xx: deal with VS which do not write position
authorRob Clark <robclark@freedesktop.org>
Tue, 3 May 2016 16:43:12 +0000 (12:43 -0400)
committerRob Clark <robclark@freedesktop.org>
Wed, 4 May 2016 15:25:55 +0000 (11:25 -0400)
Fixes $piglit/bin/glsl-1.40-tf-no-position

a3xx may need similar?

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a4xx/fd4_program.c

index 4396383eef9a3b57cc1cc5bfb087a81e34d71825..9dc4ebbf0867118824f3a74c5b6da73cece2bd82 100644 (file)
@@ -229,6 +229,13 @@ fd4_program_emit(struct fd_ringbuffer *ring, struct fd4_emit *emit,
        constmode = 1;
 
        pos_regid = ir3_find_output_regid(s[VS].v, VARYING_SLOT_POS);
+       if (pos_regid == regid(63, 0)) {
+               /* hw dislikes when there is no position output, which can
+                * happen for transform-feedback vertex shaders.  Just tell
+                * the hw to use r0.x, with whatever random value is there:
+                */
+               pos_regid = regid(0, 0);
+       }
        posz_regid = ir3_find_output_regid(s[FS].v, FRAG_RESULT_DEPTH);
        psize_regid = ir3_find_output_regid(s[VS].v, VARYING_SLOT_PSIZ);
        if (s[FS].v->color0_mrt) {