radeonsi/nir: don't rely on data.patch for tess factors
authorMarek Olšák <marek.olsak@amd.com>
Thu, 7 Nov 2019 01:18:23 +0000 (20:18 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 28 Nov 2019 00:28:30 +0000 (19:28 -0500)
GLCTS SPIR-V tests have this issue.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index b1ab398ba71d8ae07b899801256e9e705a466b99..2be1485733429aea7aa7ea0ae356e4eb5e9ecd52 100644 (file)
@@ -1341,7 +1341,6 @@ static void si_nir_store_output_tcs(struct ac_shader_abi *abi,
        struct si_shader_context *ctx = si_shader_context_from_abi(abi);
        struct tgsi_shader_info *info = &ctx->shader->selector->info;
        const unsigned component = var->data.location_frac;
-       const bool is_patch = var->data.patch;
        unsigned driver_location = var->data.driver_location;
        LLVMValueRef dw_addr, stride;
        LLVMValueRef buffer, base, addr;
@@ -1357,6 +1356,10 @@ static void si_nir_store_output_tcs(struct ac_shader_abi *abi,
        if (!param_index)
                param_index = LLVMConstInt(ctx->i32, const_index, 0);
 
+       const bool is_patch = var->data.patch ||
+                             var->data.location == VARYING_SLOT_TESS_LEVEL_INNER ||
+                             var->data.location == VARYING_SLOT_TESS_LEVEL_OUTER;
+
        assert((name == TGSI_SEMANTIC_PATCH ||
                name == TGSI_SEMANTIC_TESSINNER ||
                name == TGSI_SEMANTIC_TESSOUTER) == is_patch);