ac/nir: don't rely on data.patch for tess factors
authorMarek Olšák <marek.olsak@amd.com>
Thu, 7 Nov 2019 01:19:10 +0000 (20:19 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 28 Nov 2019 00:28:10 +0000 (19:28 -0500)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/amd/llvm/ac_nir_to_llvm.c

index 210a37a39061158ffae3fa5a968279cb0dbff509..589f39c3c0350994cdd337a9758ef4a8c6938285 100644 (file)
@@ -2000,7 +2000,9 @@ static LLVMValueRef load_tess_varyings(struct ac_nir_context *ctx,
 
        unsigned location = var->data.location;
        unsigned driver_location = var->data.driver_location;
-       const bool is_patch =  var->data.patch;
+       const bool is_patch = var->data.patch ||
+                             var->data.location == VARYING_SLOT_TESS_LEVEL_INNER ||
+                             var->data.location == VARYING_SLOT_TESS_LEVEL_OUTER;
        const bool is_compact = var->data.compact;
 
        get_deref_offset(ctx, nir_instr_as_deref(instr->src[0].ssa->parent_instr),
@@ -2247,7 +2249,9 @@ visit_store_var(struct ac_nir_context *ctx,
                        LLVMValueRef vertex_index = NULL;
                        LLVMValueRef indir_index = NULL;
                        unsigned const_index = 0;
-                       const bool is_patch = var->data.patch;
+                       const bool is_patch = var->data.patch ||
+                                             var->data.location == VARYING_SLOT_TESS_LEVEL_INNER ||
+                                             var->data.location == VARYING_SLOT_TESS_LEVEL_OUTER;
 
                        get_deref_offset(ctx, deref, false, NULL,
                                         is_patch ? NULL : &vertex_index,