OSDN Git Service

radv/ac: add support for patch inputs to unique index code.
authorDave Airlie <airlied@redhat.com>
Thu, 30 Mar 2017 07:12:27 +0000 (08:12 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 31 Mar 2017 21:15:57 +0000 (07:15 +1000)
This add support for tessellation patch inputs to the code
that finds the unique parameter index.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 6f096dd..cb74691 100644 (file)
@@ -179,6 +179,14 @@ static unsigned radeon_llvm_reg_index_soa(unsigned index, unsigned chan)
 
 static unsigned shader_io_get_unique_index(gl_varying_slot slot)
 {
+       /* handle patch indices separate */
+       if (slot == VARYING_SLOT_TESS_LEVEL_OUTER)
+               return 0;
+       if (slot == VARYING_SLOT_TESS_LEVEL_INNER)
+               return 1;
+       if (slot >= VARYING_SLOT_PATCH0 && slot <= VARYING_SLOT_TESS_MAX)
+               return 2 + (slot - VARYING_SLOT_PATCH0);
+
        if (slot == VARYING_SLOT_POS)
                return 0;
        if (slot == VARYING_SLOT_PSIZ)