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>
if (ctx->stage == MESA_SHADER_TESS_CTRL) {
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;
+ unsigned location = nir_intrinsic_io_semantics(instr).location;
ctx->abi->store_tcs_outputs(ctx->abi, vertex_index, indir_index, src,
- writemask, component, base);
+ writemask, component, location, base);
return;
}
void (*store_tcs_outputs)(struct ac_shader_abi *abi,
LLVMValueRef vertex_index, LLVMValueRef param_index,
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 src,
unsigned writemask,
unsigned component,
+ unsigned location,
unsigned driver_location)
{
struct radv_shader_context *ctx = radv_shader_context_from_abi(abi);
- const unsigned location = driver_location;
const bool is_patch = vertex_index == NULL;
LLVMValueRef dw_addr;
LLVMValueRef stride = NULL;
static void si_nir_store_output_tcs(struct ac_shader_abi *abi,
LLVMValueRef vertex_index, LLVMValueRef param_index,
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_info *info = &ctx->shader->selector->info;