radeonsi/nir: add primitive id to inputs scan
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 19 Jan 2018 11:44:58 +0000 (22:44 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 22 Jan 2018 22:11:21 +0000 (09:11 +1100)
Fixes the following piglit tests:

arb_tessellation_shader/fs-primitiveid-instanced
glsl-1.50/primitive-id-no-gs
glsl-1.50/primitive-id-no-gs-first-vertex
glsl-1.50/primitive-id-no-gs-instanced
glsl-1.50/primitive-id-no-gs-strip
glsl-1.50/primitive-id-no-gs-strip-first-vertex

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

index 56594fcd0e2e41f9b21e04ec9a14d5342a09a8ca..e26994c06b926885c284522f99573a5803554fcd 100644 (file)
@@ -239,6 +239,9 @@ void si_nir_scan_shader(const struct nir_shader *nir,
                info->input_semantic_name[i] = semantic_name;
                info->input_semantic_index[i] = semantic_index;
 
+               if (semantic_name == TGSI_SEMANTIC_PRIMID)
+                       info->uses_primid = true;
+
                if (variable->data.sample)
                        info->input_interpolate_loc[i] = TGSI_INTERPOLATE_LOC_SAMPLE;
                else if (variable->data.centroid)