Mesa (main): intel/compiler: Track primitive id in domain/evaluation shader

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 26 18:35:39 UTC 2021


Module: Mesa
Branch: main
Commit: 3f3322242667c677013e2585b464ed18c9e9c5fc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3f3322242667c677013e2585b464ed18c9e9c5fc

Author: Sagar Ghuge <sagar.ghuge at intel.com>
Date:   Fri Oct 22 09:51:42 2021 -0700

intel/compiler: Track primitive id in domain/evaluation shader

Signed-off-by: Sagar Ghuge <sagar.ghuge at intel.com>
Suggeted-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13474>

---

 src/intel/compiler/brw_compiler.h | 1 +
 src/intel/compiler/brw_shader.cpp | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/src/intel/compiler/brw_compiler.h b/src/intel/compiler/brw_compiler.h
index 3247a2efc32..48be1354d0a 100644
--- a/src/intel/compiler/brw_compiler.h
+++ b/src/intel/compiler/brw_compiler.h
@@ -1332,6 +1332,7 @@ struct brw_tes_prog_data
    enum brw_tess_partitioning partitioning;
    enum brw_tess_output_topology output_topology;
    enum brw_tess_domain domain;
+   bool include_primitive_id;
 };
 
 struct brw_gs_prog_data
diff --git a/src/intel/compiler/brw_shader.cpp b/src/intel/compiler/brw_shader.cpp
index e178828427a..83ed047ac73 100644
--- a/src/intel/compiler/brw_shader.cpp
+++ b/src/intel/compiler/brw_shader.cpp
@@ -1374,6 +1374,9 @@ brw_compile_tes(const struct brw_compiler *compiler,
       ((1 << nir->info.cull_distance_array_size) - 1) <<
       nir->info.clip_distance_array_size;
 
+   prog_data->include_primitive_id =
+      BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_PRIMITIVE_ID);
+
    /* URB entry sizes are stored as a multiple of 64 bytes. */
    prog_data->base.urb_entry_size = ALIGN(output_size_bytes, 64) / 64;
 



More information about the mesa-commit mailing list