[Mesa-dev] [PATCH v2 16/20] gallium/tgsi: add patch support to tgsi_get_gl_varying_semantic()

Timothy Arceri tarceri at itsqueeze.com
Wed Dec 13 07:53:08 UTC 2017


Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
 src/gallium/auxiliary/tgsi/tgsi_from_mesa.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_from_mesa.c b/src/gallium/auxiliary/tgsi/tgsi_from_mesa.c
index c014115918e..659156b5190 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_from_mesa.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_from_mesa.c
@@ -147,23 +147,28 @@ tgsi_get_gl_varying_semantic(gl_varying_slot attr,
       if (needs_texcoord_semantic) {
          *semantic_name = TGSI_SEMANTIC_TEXCOORD;
          *semantic_index = attr - VARYING_SLOT_TEX0;
          break;
       }
       /* fall through */
    case VARYING_SLOT_VAR0:
    default:
       assert(attr >= VARYING_SLOT_VAR0 ||
              (attr >= VARYING_SLOT_TEX0 && attr <= VARYING_SLOT_TEX7));
-      *semantic_name = TGSI_SEMANTIC_GENERIC;
-      *semantic_index =
-         tgsi_get_generic_gl_varying_index(attr, needs_texcoord_semantic);
+      if (attr >= VARYING_SLOT_PATCH0) {
+         *semantic_name = TGSI_SEMANTIC_PATCH;
+         *semantic_index = attr - VARYING_SLOT_PATCH0;
+      } else {
+         *semantic_name = TGSI_SEMANTIC_GENERIC;
+         *semantic_index =
+            tgsi_get_generic_gl_varying_index(attr, needs_texcoord_semantic);
+      }
       break;
    }
 }
 
 /**
  * Determine the semantic name and index used for the given fragment shader
  * result.
  */
 void
 tgsi_get_gl_frag_result_semantic(gl_frag_result frag_result,
-- 
2.14.3



More information about the mesa-dev mailing list