radeonsi/gfx10: improve performance for TES using PrimID but not exporting it
authorMarek Olšák <marek.olsak@amd.com>
Tue, 17 Dec 2019 02:05:05 +0000 (21:05 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 27 Dec 2019 18:50:57 +0000 (13:50 -0500)
This field is really for the primitive export to the pixel shader.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 6fa9c37bf86da0b3ce69bb587a388ac5a0ef55bf..941a397525e2daca680523f5202f10c0a24aa1a8 100644 (file)
@@ -1202,7 +1202,8 @@ static void gfx10_shader_ngg(struct si_screen *sscreen, struct si_shader *shader
 
        shader->ctx_reg.ngg.vgt_primitiveid_en =
                S_028A84_PRIMITIVEID_EN(es_enable_prim_id) |
-               S_028A84_NGG_DISABLE_PROVOK_REUSE(es_enable_prim_id);
+               S_028A84_NGG_DISABLE_PROVOK_REUSE(shader->key.mono.u.vs_export_prim_id ||
+                                                 gs_sel->info.writes_primid);
 
        if (gs_type == PIPE_SHADER_GEOMETRY) {
                shader->ctx_reg.ngg.vgt_esgs_ring_itemsize = es_sel->esgs_itemsize / 4;