ac/nir: pass the nir variable through tcs loading.
I was going to have to add another parameter to this monster,
so we should just pass the nir_variable in, I can't find any
reason this would be a bad idea.
This needed for the next fix.
Fixes: 94f9591995
(radv/ac: add support for TCS/TES inputs/outputs.)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
@@ -1804,19 +1804,15 @@ visit_store_var(struct ac_nir_context *ctx,
|
|||||||
LLVMValueRef vertex_index = NULL;
|
LLVMValueRef vertex_index = NULL;
|
||||||
LLVMValueRef indir_index = NULL;
|
LLVMValueRef indir_index = NULL;
|
||||||
unsigned const_index = 0;
|
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_patch = instr->variables[0]->var->data.patch;
|
||||||
const bool is_compact = instr->variables[0]->var->data.compact;
|
|
||||||
|
|
||||||
get_deref_offset(ctx, instr->variables[0],
|
get_deref_offset(ctx, instr->variables[0],
|
||||||
false, NULL, is_patch ? NULL : &vertex_index,
|
false, NULL, is_patch ? NULL : &vertex_index,
|
||||||
&const_index, &indir_index);
|
&const_index, &indir_index);
|
||||||
|
|
||||||
ctx->abi->store_tcs_outputs(ctx->abi, vertex_index, indir_index,
|
ctx->abi->store_tcs_outputs(ctx->abi, instr->variables[0]->var,
|
||||||
const_index, location, driver_location,
|
vertex_index, indir_index,
|
||||||
src, comp, is_patch, is_compact, writemask);
|
const_index, src, writemask);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#include "compiler/shader_enums.h"
|
#include "compiler/shader_enums.h"
|
||||||
|
|
||||||
|
struct nir_variable;
|
||||||
|
|
||||||
#define AC_LLVM_MAX_OUTPUTS (VARYING_SLOT_VAR31 + 1)
|
#define AC_LLVM_MAX_OUTPUTS (VARYING_SLOT_VAR31 + 1)
|
||||||
|
|
||||||
enum ac_descriptor_type {
|
enum ac_descriptor_type {
|
||||||
@@ -111,15 +113,11 @@ struct ac_shader_abi {
|
|||||||
bool load_inputs);
|
bool load_inputs);
|
||||||
|
|
||||||
void (*store_tcs_outputs)(struct ac_shader_abi *abi,
|
void (*store_tcs_outputs)(struct ac_shader_abi *abi,
|
||||||
|
const struct nir_variable *var,
|
||||||
LLVMValueRef vertex_index,
|
LLVMValueRef vertex_index,
|
||||||
LLVMValueRef param_index,
|
LLVMValueRef param_index,
|
||||||
unsigned const_index,
|
unsigned const_index,
|
||||||
unsigned location,
|
|
||||||
unsigned driver_location,
|
|
||||||
LLVMValueRef src,
|
LLVMValueRef src,
|
||||||
unsigned component,
|
|
||||||
bool is_patch,
|
|
||||||
bool is_compact,
|
|
||||||
unsigned writemask);
|
unsigned writemask);
|
||||||
|
|
||||||
LLVMValueRef (*load_tess_coord)(struct ac_shader_abi *abi);
|
LLVMValueRef (*load_tess_coord)(struct ac_shader_abi *abi);
|
||||||
|
@@ -1296,18 +1296,18 @@ load_tcs_varyings(struct ac_shader_abi *abi,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
store_tcs_output(struct ac_shader_abi *abi,
|
store_tcs_output(struct ac_shader_abi *abi,
|
||||||
|
const nir_variable *var,
|
||||||
LLVMValueRef vertex_index,
|
LLVMValueRef vertex_index,
|
||||||
LLVMValueRef param_index,
|
LLVMValueRef param_index,
|
||||||
unsigned const_index,
|
unsigned const_index,
|
||||||
unsigned location,
|
|
||||||
unsigned driver_location,
|
|
||||||
LLVMValueRef src,
|
LLVMValueRef src,
|
||||||
unsigned component,
|
|
||||||
bool is_patch,
|
|
||||||
bool is_compact,
|
|
||||||
unsigned writemask)
|
unsigned writemask)
|
||||||
{
|
{
|
||||||
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 = 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 dw_addr;
|
||||||
LLVMValueRef stride = NULL;
|
LLVMValueRef stride = NULL;
|
||||||
LLVMValueRef buf_addr = NULL;
|
LLVMValueRef buf_addr = NULL;
|
||||||
|
@@ -1487,19 +1487,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,
|
static void si_nir_store_output_tcs(struct ac_shader_abi *abi,
|
||||||
|
const struct nir_variable *var,
|
||||||
LLVMValueRef vertex_index,
|
LLVMValueRef vertex_index,
|
||||||
LLVMValueRef param_index,
|
LLVMValueRef param_index,
|
||||||
unsigned const_index,
|
unsigned const_index,
|
||||||
unsigned location,
|
|
||||||
unsigned driver_location,
|
|
||||||
LLVMValueRef src,
|
LLVMValueRef src,
|
||||||
unsigned component,
|
|
||||||
bool is_patch,
|
|
||||||
bool is_compact,
|
|
||||||
unsigned writemask)
|
unsigned writemask)
|
||||||
{
|
{
|
||||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||||
struct tgsi_shader_info *info = &ctx->shader->selector->info;
|
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 dw_addr, stride;
|
||||||
LLVMValueRef buffer, base, addr;
|
LLVMValueRef buffer, base, addr;
|
||||||
LLVMValueRef values[4];
|
LLVMValueRef values[4];
|
||||||
|
Reference in New Issue
Block a user