tgsi_to_nir: handle tess level inner/outer varyings
authorMarek Olšák <marek.olsak@amd.com>
Thu, 1 Aug 2019 18:16:01 +0000 (14:16 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 12 Aug 2019 18:52:17 +0000 (14:52 -0400)
for internal radeonsi shaders

Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/gallium/auxiliary/nir/tgsi_to_nir.c

index 24187503a30958ebdd3d4b552383f4b122577455..09d7f18881e0b0ad0c902ae7e3882fd22013abc4 100644 (file)
@@ -158,6 +158,10 @@ tgsi_varying_semantic_to_slot(unsigned semantic, unsigned index)
       return VARYING_SLOT_VIEWPORT;
    case TGSI_SEMANTIC_LAYER:
       return VARYING_SLOT_LAYER;
+   case TGSI_SEMANTIC_TESSINNER:
+      return VARYING_SLOT_TESS_LEVEL_INNER;
+   case TGSI_SEMANTIC_TESSOUTER:
+      return VARYING_SLOT_TESS_LEVEL_OUTER;
    default:
       fprintf(stderr, "Bad TGSI semantic: %d/%d\n", semantic, index);
       abort();
@@ -393,6 +397,9 @@ ttn_emit_declaration(struct ttn_compile *c)
             var->data.index = 0;
             var->data.interpolation =
                ttn_translate_interp_mode(decl->Interp.Interpolate);
+            var->data.patch = semantic_name == TGSI_SEMANTIC_TESSINNER ||
+                              semantic_name == TGSI_SEMANTIC_TESSOUTER ||
+                              semantic_name == TGSI_SEMANTIC_PATCH;
 
             if (c->scan->processor == PIPE_SHADER_FRAGMENT) {
                switch (semantic_name) {