[Mesa-dev] [PATCH 01/26] tgsi/scan: add uses_drawid

Marek Olšák maraeo at gmail.com
Wed Feb 13 05:15:56 UTC 2019


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/auxiliary/tgsi/tgsi_scan.c       | 3 +++
 src/gallium/auxiliary/tgsi/tgsi_scan.h       | 1 +
 src/gallium/drivers/radeonsi/si_shader_nir.c | 3 +++
 3 files changed, 7 insertions(+)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c
index bfb415e439a..4cb1a3152c3 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c
@@ -683,6 +683,9 @@ scan_declaration(struct tgsi_shader_info *info,
          case TGSI_SEMANTIC_BASEVERTEX:
             info->uses_basevertex = TRUE;
             break;
+         case TGSI_SEMANTIC_DRAWID:
+            info->uses_drawid = TRUE;
+            break;
          case TGSI_SEMANTIC_PRIMID:
             info->uses_primid = TRUE;
             break;
diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h
index 64f2598a259..580c73a2814 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_scan.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h
@@ -118,6 +118,7 @@ struct tgsi_shader_info
    boolean uses_vertexid;
    boolean uses_vertexid_nobase;
    boolean uses_basevertex;
+   boolean uses_drawid;
    boolean uses_primid;
    boolean uses_frontface;
    boolean uses_invocationid;
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 7554f5b9f8b..d81fb5449bf 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -133,6 +133,9 @@ static void scan_instruction(struct tgsi_shader_info *info,
 		case nir_intrinsic_load_base_vertex:
 			info->uses_basevertex = 1;
 			break;
+		case nir_intrinsic_load_draw_id:
+			info->uses_drawid = 1;
+			break;
 		case nir_intrinsic_load_primitive_id:
 			info->uses_primid = 1;
 			break;
-- 
2.17.1



More information about the mesa-dev mailing list