ac,radv,radeonsi: remove unused parameters in the shader ABI IO
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6931>
This commit is contained in:
@@ -2145,8 +2145,8 @@ static void visit_store_output(struct ac_nir_context *ctx, nir_intrinsic_instr *
|
|||||||
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;
|
||||||
|
|
||||||
ctx->abi->store_tcs_outputs(ctx->abi, NULL, vertex_index, indir_index, 0, src, writemask,
|
ctx->abi->store_tcs_outputs(ctx->abi, vertex_index, indir_index, src,
|
||||||
component, base * 4);
|
writemask, component, base * 4);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3127,9 +3127,8 @@ static LLVMValueRef visit_load(struct ac_nir_context *ctx, nir_intrinsic_instr *
|
|||||||
(ctx->stage == MESA_SHADER_TESS_EVAL && !is_output)) {
|
(ctx->stage == MESA_SHADER_TESS_EVAL && !is_output)) {
|
||||||
LLVMValueRef result = ctx->abi->load_tess_varyings(ctx->abi, component_type,
|
LLVMValueRef result = ctx->abi->load_tess_varyings(ctx->abi, component_type,
|
||||||
vertex_index, indir_index,
|
vertex_index, indir_index,
|
||||||
0, 0, base * 4,
|
base * 4, component,
|
||||||
component, count,
|
count, !is_output);
|
||||||
false, false, !is_output);
|
|
||||||
if (instr->dest.ssa.bit_size == 16) {
|
if (instr->dest.ssa.bit_size == 16) {
|
||||||
result = ac_to_integer(&ctx->ac, result);
|
result = ac_to_integer(&ctx->ac, result);
|
||||||
result = LLVMBuildTrunc(ctx->ac.builder, result, dest_type, "");
|
result = LLVMBuildTrunc(ctx->ac.builder, result, dest_type, "");
|
||||||
@@ -3143,8 +3142,8 @@ static LLVMValueRef visit_load(struct ac_nir_context *ctx, nir_intrinsic_instr *
|
|||||||
if (ctx->stage == MESA_SHADER_GEOMETRY) {
|
if (ctx->stage == MESA_SHADER_GEOMETRY) {
|
||||||
assert(nir_src_is_const(*vertex_index_src));
|
assert(nir_src_is_const(*vertex_index_src));
|
||||||
|
|
||||||
return ctx->abi->load_inputs(ctx->abi, 0, base * 4, component, count,
|
return ctx->abi->load_inputs(ctx->abi, base * 4, component, count,
|
||||||
nir_src_as_uint(*vertex_index_src), 0, component_type);
|
nir_src_as_uint(*vertex_index_src), component_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->stage == MESA_SHADER_FRAGMENT && is_output &&
|
if (ctx->stage == MESA_SHADER_FRAGMENT && is_output &&
|
||||||
|
@@ -30,8 +30,6 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
struct nir_variable;
|
|
||||||
|
|
||||||
#define AC_LLVM_MAX_OUTPUTS (VARYING_SLOT_VAR31 + 1)
|
#define AC_LLVM_MAX_OUTPUTS (VARYING_SLOT_VAR31 + 1)
|
||||||
|
|
||||||
#define AC_MAX_INLINE_PUSH_CONSTS 8
|
#define AC_MAX_INLINE_PUSH_CONSTS 8
|
||||||
@@ -79,21 +77,20 @@ struct ac_shader_abi {
|
|||||||
void (*emit_vertex_with_counter)(struct ac_shader_abi *abi, unsigned stream,
|
void (*emit_vertex_with_counter)(struct ac_shader_abi *abi, unsigned stream,
|
||||||
LLVMValueRef vertexidx, LLVMValueRef *addrs);
|
LLVMValueRef vertexidx, LLVMValueRef *addrs);
|
||||||
|
|
||||||
LLVMValueRef (*load_inputs)(struct ac_shader_abi *abi, unsigned location,
|
LLVMValueRef (*load_inputs)(struct ac_shader_abi *abi,
|
||||||
unsigned driver_location, unsigned component,
|
unsigned driver_location, unsigned component,
|
||||||
unsigned num_components, unsigned vertex_index, unsigned const_index,
|
unsigned num_components, unsigned vertex_index,
|
||||||
LLVMTypeRef type);
|
LLVMTypeRef type);
|
||||||
|
|
||||||
LLVMValueRef (*load_tess_varyings)(struct ac_shader_abi *abi, LLVMTypeRef type,
|
LLVMValueRef (*load_tess_varyings)(struct ac_shader_abi *abi, LLVMTypeRef type,
|
||||||
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
||||||
unsigned const_index, unsigned location,
|
|
||||||
unsigned driver_location, unsigned component,
|
unsigned driver_location, unsigned component,
|
||||||
unsigned num_components, bool is_patch, bool is_compact,
|
unsigned num_components,
|
||||||
bool load_inputs);
|
bool load_inputs);
|
||||||
|
|
||||||
void (*store_tcs_outputs)(struct ac_shader_abi *abi, const struct nir_variable *var,
|
void (*store_tcs_outputs)(struct ac_shader_abi *abi,
|
||||||
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
||||||
unsigned const_index, LLVMValueRef src, unsigned writemask,
|
LLVMValueRef src, unsigned writemask,
|
||||||
unsigned component, unsigned driver_location);
|
unsigned component, unsigned driver_location);
|
||||||
|
|
||||||
LLVMValueRef (*load_tess_coord)(struct ac_shader_abi *abi);
|
LLVMValueRef (*load_tess_coord)(struct ac_shader_abi *abi);
|
||||||
|
@@ -530,13 +530,9 @@ load_tcs_varyings(struct ac_shader_abi *abi,
|
|||||||
LLVMTypeRef type,
|
LLVMTypeRef type,
|
||||||
LLVMValueRef vertex_index,
|
LLVMValueRef vertex_index,
|
||||||
LLVMValueRef indir_index,
|
LLVMValueRef indir_index,
|
||||||
unsigned const_index,
|
|
||||||
unsigned location,
|
|
||||||
unsigned driver_location,
|
unsigned driver_location,
|
||||||
unsigned component,
|
unsigned component,
|
||||||
unsigned num_components,
|
unsigned num_components,
|
||||||
bool unused,
|
|
||||||
bool is_compact,
|
|
||||||
bool load_input)
|
bool load_input)
|
||||||
{
|
{
|
||||||
struct radv_shader_context *ctx = radv_shader_context_from_abi(abi);
|
struct radv_shader_context *ctx = radv_shader_context_from_abi(abi);
|
||||||
@@ -573,10 +569,8 @@ 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,
|
|
||||||
LLVMValueRef src,
|
LLVMValueRef src,
|
||||||
unsigned writemask,
|
unsigned writemask,
|
||||||
unsigned component,
|
unsigned component,
|
||||||
@@ -648,13 +642,9 @@ load_tes_input(struct ac_shader_abi *abi,
|
|||||||
LLVMTypeRef type,
|
LLVMTypeRef type,
|
||||||
LLVMValueRef vertex_index,
|
LLVMValueRef vertex_index,
|
||||||
LLVMValueRef param_index,
|
LLVMValueRef param_index,
|
||||||
unsigned const_index,
|
|
||||||
unsigned location,
|
|
||||||
unsigned driver_location,
|
unsigned driver_location,
|
||||||
unsigned component,
|
unsigned component,
|
||||||
unsigned num_components,
|
unsigned num_components,
|
||||||
bool is_patch,
|
|
||||||
bool is_compact,
|
|
||||||
bool load_input)
|
bool load_input)
|
||||||
{
|
{
|
||||||
struct radv_shader_context *ctx = radv_shader_context_from_abi(abi);
|
struct radv_shader_context *ctx = radv_shader_context_from_abi(abi);
|
||||||
@@ -688,12 +678,10 @@ radv_emit_fetch_64bit(struct radv_shader_context *ctx,
|
|||||||
|
|
||||||
static LLVMValueRef
|
static LLVMValueRef
|
||||||
load_gs_input(struct ac_shader_abi *abi,
|
load_gs_input(struct ac_shader_abi *abi,
|
||||||
unsigned location,
|
|
||||||
unsigned driver_location,
|
unsigned driver_location,
|
||||||
unsigned component,
|
unsigned component,
|
||||||
unsigned num_components,
|
unsigned num_components,
|
||||||
unsigned vertex_index,
|
unsigned vertex_index,
|
||||||
unsigned const_index,
|
|
||||||
LLVMTypeRef type)
|
LLVMTypeRef type)
|
||||||
{
|
{
|
||||||
struct radv_shader_context *ctx = radv_shader_context_from_abi(abi);
|
struct radv_shader_context *ctx = radv_shader_context_from_abi(abi);
|
||||||
|
@@ -95,10 +95,10 @@ static LLVMValueRef si_llvm_load_input_gs(struct ac_shader_abi *abi, unsigned in
|
|||||||
return LLVMBuildBitCast(ctx->ac.builder, value, type, "");
|
return LLVMBuildBitCast(ctx->ac.builder, value, type, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
static LLVMValueRef si_nir_load_input_gs(struct ac_shader_abi *abi, unsigned location,
|
static LLVMValueRef si_nir_load_input_gs(struct ac_shader_abi *abi,
|
||||||
unsigned driver_location, unsigned component,
|
unsigned driver_location, unsigned component,
|
||||||
unsigned num_components, unsigned vertex_index,
|
unsigned num_components, unsigned vertex_index,
|
||||||
unsigned const_index, LLVMTypeRef type)
|
LLVMTypeRef type)
|
||||||
{
|
{
|
||||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||||
|
|
||||||
|
@@ -378,10 +378,8 @@ void si_llvm_preload_tes_rings(struct si_shader_context *ctx)
|
|||||||
|
|
||||||
static LLVMValueRef si_nir_load_tcs_varyings(struct ac_shader_abi *abi, LLVMTypeRef type,
|
static LLVMValueRef si_nir_load_tcs_varyings(struct ac_shader_abi *abi, LLVMTypeRef type,
|
||||||
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
||||||
unsigned const_index, unsigned location,
|
|
||||||
unsigned driver_location, unsigned component,
|
unsigned driver_location, unsigned component,
|
||||||
unsigned num_components, bool unused,
|
unsigned num_components, bool load_input)
|
||||||
bool is_compact, bool load_input)
|
|
||||||
{
|
{
|
||||||
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;
|
||||||
@@ -430,9 +428,8 @@ static LLVMValueRef si_nir_load_tcs_varyings(struct ac_shader_abi *abi, LLVMType
|
|||||||
|
|
||||||
static LLVMValueRef si_nir_load_input_tes(struct ac_shader_abi *abi, LLVMTypeRef type,
|
static LLVMValueRef si_nir_load_input_tes(struct ac_shader_abi *abi, LLVMTypeRef type,
|
||||||
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
||||||
unsigned const_index, unsigned location,
|
|
||||||
unsigned driver_location, unsigned component,
|
unsigned driver_location, unsigned component,
|
||||||
unsigned num_components, bool unused, bool is_compact,
|
unsigned num_components,
|
||||||
bool load_input)
|
bool load_input)
|
||||||
{
|
{
|
||||||
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
struct si_shader_context *ctx = si_shader_context_from_abi(abi);
|
||||||
@@ -466,9 +463,9 @@ static LLVMValueRef si_nir_load_input_tes(struct ac_shader_abi *abi, LLVMTypeRef
|
|||||||
return ac_build_varying_gather_values(&ctx->ac, value, num_components, component);
|
return ac_build_varying_gather_values(&ctx->ac, value, num_components, component);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void si_nir_store_output_tcs(struct ac_shader_abi *abi, const struct nir_variable *var,
|
static void si_nir_store_output_tcs(struct ac_shader_abi *abi,
|
||||||
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
LLVMValueRef vertex_index, LLVMValueRef param_index,
|
||||||
unsigned const_index, LLVMValueRef src, unsigned writemask,
|
LLVMValueRef src, unsigned writemask,
|
||||||
unsigned component, unsigned driver_location)
|
unsigned component, 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);
|
||||||
|
Reference in New Issue
Block a user