summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c20
-rw-r--r--src/amd/common/ac_shader_abi.h8
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c9
3 files changed, 15 insertions, 22 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 04b8ebd2b34..5588a723720 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -2936,18 +2936,18 @@ load_tcs_varyings(struct ac_shader_abi *abi,
static void
store_tcs_output(struct ac_shader_abi *abi,
+ const nir_variable *var,
LLVMValueRef vertex_index,
LLVMValueRef param_index,
unsigned const_index,
- unsigned location,
- unsigned driver_location,
LLVMValueRef src,
- unsigned component,
- bool is_patch,
- bool is_compact,
unsigned writemask)
{
struct nir_to_llvm_context *ctx = nir_to_llvm_context_from_abi(abi);
+ const unsigned location = var->data.location;
+ const unsigned component = var->data.location_frac;
+ const bool is_patch = var->data.patch;
+ const bool is_compact = var->data.compact;
LLVMValueRef dw_addr;
LLVMValueRef stride = NULL;
LLVMValueRef buf_addr = NULL;
@@ -3307,19 +3307,15 @@ visit_store_var(struct ac_nir_context *ctx,
LLVMValueRef vertex_index = NULL;
LLVMValueRef indir_index = NULL;
unsigned const_index = 0;
- const unsigned location = instr->variables[0]->var->data.location;
- const unsigned driver_location = instr->variables[0]->var->data.driver_location;
- const unsigned comp = instr->variables[0]->var->data.location_frac;
const bool is_patch = instr->variables[0]->var->data.patch;
- const bool is_compact = instr->variables[0]->var->data.compact;
get_deref_offset(ctx, instr->variables[0],
false, NULL, is_patch ? NULL : &vertex_index,
&const_index, &indir_index);
- ctx->abi->store_tcs_outputs(ctx->abi, vertex_index, indir_index,
- const_index, location, driver_location,
- src, comp, is_patch, is_compact, writemask);
+ ctx->abi->store_tcs_outputs(ctx->abi, instr->variables[0]->var,
+ vertex_index, indir_index,
+ const_index, src, writemask);
return;
}
diff --git a/src/amd/common/ac_shader_abi.h b/src/amd/common/ac_shader_abi.h
index 3aab3bf95b3..8d0738b6f94 100644
--- a/src/amd/common/ac_shader_abi.h
+++ b/src/amd/common/ac_shader_abi.h
@@ -26,6 +26,8 @@
#include <llvm-c/Core.h>
+struct nir_variable;
+
enum ac_descriptor_type {
AC_DESC_IMAGE,
AC_DESC_FMASK,
@@ -92,15 +94,11 @@ struct ac_shader_abi {
bool load_inputs);
void (*store_tcs_outputs)(struct ac_shader_abi *abi,
+ const struct nir_variable *var,
LLVMValueRef vertex_index,
LLVMValueRef param_index,
unsigned const_index,
- unsigned location,
- unsigned driver_location,
LLVMValueRef src,
- unsigned component,
- bool is_patch,
- bool is_compact,
unsigned writemask);
LLVMValueRef (*load_tess_coord)(struct ac_shader_abi *abi,
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 4717366d07b..1ea79f7c04c 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1451,19 +1451,18 @@ static void store_output_tcs(struct lp_build_tgsi_context *bld_base,
}
static void si_nir_store_output_tcs(struct ac_shader_abi *abi,
+ const struct nir_variable *var,
LLVMValueRef vertex_index,
LLVMValueRef param_index,
unsigned const_index,
- unsigned location,
- unsigned driver_location,
LLVMValueRef src,
- unsigned component,
- bool is_patch,
- bool is_compact,
unsigned writemask)
{
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;
LLVMValueRef values[4];