ir3: Allow tesselation to use all 32 varying slots
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Thu, 10 Dec 2020 17:18:18 +0000 (19:18 +0200)
committerDanylo Piliaiev <dpiliaiev@igalia.com>
Mon, 21 Dec 2020 14:06:20 +0000 (16:06 +0200)
POS, PSIZE, CLIP_DIST0, and CLIP_DIST1 have their own predefined
indices, map's size should take this into account.

Fixes: 9e063b01 "ir3: Switch tess lowering to use location"

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7917>

src/freedreno/ir3/ir3_nir_lower_tess.c
src/freedreno/ir3/ir3_shader.h

index 87b49c9..fbb0541 100644 (file)
@@ -29,7 +29,7 @@ struct state {
        uint32_t topology;
 
        struct primitive_map {
-               unsigned loc[32];
+               unsigned loc[32 + 4]; /* +POSITION +PSIZE +CLIP_DIST0 +CLIP_DIST1 */
                unsigned stride;
        } map;
 
index 6b5e2af..1218b18 100644 (file)
@@ -597,7 +597,7 @@ struct ir3_shader_variant {
         * HS, where varyings are read in the next stage via ldg with a dword
         * offset, and in bytes for all other stages.
         */
-       unsigned output_loc[32];
+       unsigned output_loc[32 + 4]; /* +POSITION +PSIZE +CLIP_DIST0 +CLIP_DIST1 */
 
        /* attributes (VS) / varyings (FS):
         * Note that sysval's should come *after* normal inputs.