radeonsi: fix passing gl_ClipVertex for GS and tess
authorMarek Olšák <marek.olsak@amd.com>
Wed, 23 May 2018 04:34:38 +0000 (00:34 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 25 May 2018 20:46:00 +0000 (16:46 -0400)
Also add the fprintf call.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_state_shaders.c

index 6734a1628f58c8e19663ce419605a3ca563c9ddc..d2b9b73e0398fb7ce7475491207555837ecd46c5 100644 (file)
@@ -233,9 +233,12 @@ unsigned si_shader_io_get_unique_index(unsigned semantic_name, unsigned index,
                        return SI_MAX_IO_GENERIC + 10 + index;
        case TGSI_SEMANTIC_TEXCOORD:
                assert(index < 8);
-               STATIC_ASSERT(SI_MAX_IO_GENERIC + 12 + 8 <= 64);
+               STATIC_ASSERT(SI_MAX_IO_GENERIC + 12 + 8 <= 63);
                return SI_MAX_IO_GENERIC + 12 + index;
+       case TGSI_SEMANTIC_CLIPVERTEX:
+               return 63;
        default:
+               fprintf(stderr, "invalid semantic name = %u\n", semantic_name);
                assert(!"invalid semantic name");
                return 0;
        }
index 555ca598d2c6d4498de3e5680f3a2895697244f2..9e8d5736259d2b53da6e4c4be2bff1ca0a24e60c 100644 (file)
@@ -152,7 +152,7 @@ struct si_context;
 /* Shader IO unique indices are supported for TGSI_SEMANTIC_GENERIC with an
  * index smaller than this.
  */
-#define SI_MAX_IO_GENERIC       44
+#define SI_MAX_IO_GENERIC       43
 
 /* SGPR user data indices */
 enum {
index 1f443667cd6e924abc2bcf807f177ceb77273834..707bb4187ef2476c8389aef38c68e7f74fcd39b1 100644 (file)
@@ -1226,9 +1226,10 @@ static void si_shader_selector_key_hw_vs(struct si_context *sctx,
        uint64_t outputs_written = vs->outputs_written_before_ps;
        uint64_t inputs_read = 0;
 
-       /* ignore POSITION, PSIZE */
+       /* Ignore outputs that are not passed from VS to PS. */
        outputs_written &= ~((1ull << si_shader_io_get_unique_index(TGSI_SEMANTIC_POSITION, 0, true)) |
-                            (1ull << si_shader_io_get_unique_index(TGSI_SEMANTIC_PSIZE, 0, true)));
+                            (1ull << si_shader_io_get_unique_index(TGSI_SEMANTIC_PSIZE, 0, true)) |
+                            (1ull << si_shader_io_get_unique_index(TGSI_SEMANTIC_CLIPVERTEX, 0, true)));
 
        if (!ps_disabled) {
                inputs_read = ps->inputs_read;