ac/nir: pass the variable location to store_tcs_outputs
It's actually simpler for the backend to know the variable location. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7022>
This commit is contained in:
@@ -2166,9 +2166,10 @@ static void visit_store_output(struct ac_nir_context *ctx, nir_intrinsic_instr *
|
|||||||
if (ctx->stage == MESA_SHADER_TESS_CTRL) {
|
if (ctx->stage == MESA_SHADER_TESS_CTRL) {
|
||||||
nir_src *vertex_index_src = nir_get_io_vertex_index_src(instr);
|
nir_src *vertex_index_src = nir_get_io_vertex_index_src(instr);
|
||||||
LLVMValueRef vertex_index = vertex_index_src ? get_src(ctx, *vertex_index_src) : NULL;
|
LLVMValueRef vertex_index = vertex_index_src ? get_src(ctx, *vertex_index_src) : NULL;
|
||||||
|
unsigned location = nir_intrinsic_io_semantics(instr).location;
|
||||||
|
|
||||||
ctx->abi->store_tcs_outputs(ctx->abi, vertex_index, indir_index, src,
|
ctx->abi->store_tcs_outputs(ctx->abi, vertex_index, indir_index, src,
|
||||||
writemask, component, base);
|
writemask, component, location, base);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -91,7 +91,7 @@ struct ac_shader_abi {
|
|||||||
void (*store_tcs_outputs)(struct ac_shader_abi *abi,
|
void (*store_tcs_outputs)(struct ac_shader_abi *abi,
|
||||||
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
||||||
LLVMValueRef src, unsigned writemask,
|
LLVMValueRef src, unsigned writemask,
|
||||||
unsigned component, unsigned driver_location);
|
unsigned component, unsigned location, unsigned driver_location);
|
||||||
|
|
||||||
LLVMValueRef (*load_tess_coord)(struct ac_shader_abi *abi);
|
LLVMValueRef (*load_tess_coord)(struct ac_shader_abi *abi);
|
||||||
|
|
||||||
|
@@ -548,10 +548,10 @@ store_tcs_output(struct ac_shader_abi *abi,
|
|||||||
LLVMValueRef src,
|
LLVMValueRef src,
|
||||||
unsigned writemask,
|
unsigned writemask,
|
||||||
unsigned component,
|
unsigned component,
|
||||||
|
unsigned location,
|
||||||
unsigned driver_location)
|
unsigned driver_location)
|
||||||
{
|
{
|
||||||
struct radv_shader_context *ctx = radv_shader_context_from_abi(abi);
|
struct radv_shader_context *ctx = radv_shader_context_from_abi(abi);
|
||||||
const unsigned location = driver_location;
|
|
||||||
const bool is_patch = vertex_index == NULL;
|
const bool is_patch = vertex_index == NULL;
|
||||||
LLVMValueRef dw_addr;
|
LLVMValueRef dw_addr;
|
||||||
LLVMValueRef stride = NULL;
|
LLVMValueRef stride = NULL;
|
||||||
|
@@ -463,7 +463,7 @@ static LLVMValueRef si_nir_load_input_tes(struct ac_shader_abi *abi, LLVMTypeRef
|
|||||||
static void si_nir_store_output_tcs(struct ac_shader_abi *abi,
|
static void si_nir_store_output_tcs(struct ac_shader_abi *abi,
|
||||||
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
||||||
LLVMValueRef src, unsigned writemask,
|
LLVMValueRef src, unsigned writemask,
|
||||||
unsigned component, unsigned driver_location)
|
unsigned component, unsigned location, unsigned driver_location)
|
||||||
{
|
{
|
||||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||||
struct si_shader_info *info = &ctx->shader->selector->info;
|
struct si_shader_info *info = &ctx->shader->selector->info;
|
||||||
|
Reference in New Issue
Block a user