tgsi: ureg_DECL_gs_input() accepts shader semantics.
authorMichal Krol <michal@vmware.com>
Tue, 2 Feb 2010 09:42:13 +0000 (10:42 +0100)
committerMichal Krol <michal@vmware.com>
Tue, 2 Feb 2010 09:42:13 +0000 (10:42 +0100)
src/gallium/auxiliary/tgsi/tgsi_ureg.c
src/gallium/auxiliary/tgsi/tgsi_ureg.h

index 0ae46785bbe4492069a99a490f02791ced9323f0..e31ae8b4550395ac5108b827804d21b8315fe103 100644 (file)
@@ -103,6 +103,8 @@ struct ureg_program
 
    struct {
       unsigned index;
+      unsigned semantic_name;
+      unsigned semantic_index;
    } gs_input[UREG_MAX_INPUT];
    unsigned nr_gs_inputs;
 
@@ -325,10 +327,14 @@ ureg_DECL_vs_input( struct ureg_program *ureg,
 
 struct ureg_src
 ureg_DECL_gs_input(struct ureg_program *ureg,
-                   unsigned index)
+                   unsigned index,
+                   unsigned semantic_name,
+                   unsigned semantic_index)
 {
    if (ureg->nr_gs_inputs < UREG_MAX_INPUT) {
       ureg->gs_input[ureg->nr_gs_inputs].index = index;
+      ureg->gs_input[ureg->nr_gs_inputs].semantic_name = semantic_name;
+      ureg->gs_input[ureg->nr_gs_inputs].semantic_index = semantic_index;
       ureg->nr_gs_inputs++;
    } else {
       set_bad(ureg);
@@ -1251,10 +1257,12 @@ static void emit_decls( struct ureg_program *ureg )
       }
    } else {
       for (i = 0; i < ureg->nr_gs_inputs; i++) {
-         emit_decl_range(ureg, 
-                         TGSI_FILE_INPUT, 
-                         ureg->gs_input[i].index,
-                         1);
+         emit_decl(ureg,
+                   TGSI_FILE_INPUT,
+                   ureg->gs_input[i].index,
+                   ureg->gs_input[i].semantic_name,
+                   ureg->gs_input[i].semantic_index,
+                   TGSI_INTERPOLATE_CONSTANT);
       }
    }
 
index e25f35c6dc3bae182a917ece3e78830c0c2d9ddd..d6e8e5d553cada4a01249e9701b0ca70909ee4aa 100644 (file)
@@ -160,7 +160,9 @@ ureg_DECL_vs_input( struct ureg_program *,
 
 struct ureg_src
 ureg_DECL_gs_input(struct ureg_program *,
-                   unsigned index);
+                   unsigned index,
+                   unsigned semantic_name,
+                   unsigned semantic_index);
 
 struct ureg_src
 ureg_DECL_system_value(struct ureg_program *,