tgsi/scan: add uses_drawid
authorMarek Olšák <marek.olsak@amd.com>
Mon, 4 Feb 2019 19:31:59 +0000 (14:31 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 23 Apr 2019 15:28:56 +0000 (11:28 -0400)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h
src/gallium/drivers/radeonsi/si_shader_nir.c

index bfb415e439ae32414205edc36f07679949f0ed36..4cb1a3152c3b8faeb9d784a8d3bba647e4d80b00 100644 (file)
@@ -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;
index 09eac4da95ae278a1bc120a2361e00794662120c..51d85af4fcb8b613d23a3cb1adc62b18879d722f 100644 (file)
@@ -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;
index 5a925f19e092691f4b49a07de8368ef2815e19be..4fe01ba060798939064ce1cad8a82ecd40ea3f07 100644 (file)
@@ -171,6 +171,9 @@ static void scan_instruction(const struct nir_shader *nir,
                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;