ac/nir: Add ac_nir_load_arg helper for shader arguments.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13155>
This commit is contained in:
parent
370f02bf02
commit
719678f891
|
@ -22,6 +22,18 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ac_nir.h"
|
#include "ac_nir.h"
|
||||||
|
#include "nir_builder.h"
|
||||||
|
|
||||||
|
nir_ssa_def *
|
||||||
|
ac_nir_load_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg)
|
||||||
|
{
|
||||||
|
unsigned num_components = ac_args->args[arg.arg_index].size;
|
||||||
|
|
||||||
|
if (ac_args->args[arg.arg_index].file == AC_ARG_SGPR)
|
||||||
|
return nir_load_scalar_arg_amd(b, num_components, .base = arg.arg_index);
|
||||||
|
else
|
||||||
|
return nir_load_vector_arg_amd(b, num_components, .base = arg.arg_index);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ac_nir_lower_indirect_derefs(nir_shader *shader,
|
ac_nir_lower_indirect_derefs(nir_shader *shader,
|
||||||
|
|
|
@ -52,6 +52,9 @@ enum
|
||||||
struct nir_builder;
|
struct nir_builder;
|
||||||
typedef struct nir_builder nir_builder;
|
typedef struct nir_builder nir_builder;
|
||||||
|
|
||||||
|
nir_ssa_def *
|
||||||
|
ac_nir_load_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg);
|
||||||
|
|
||||||
bool ac_nir_optimize_outputs(nir_shader *nir, bool sprite_tex_disallowed,
|
bool ac_nir_optimize_outputs(nir_shader *nir, bool sprite_tex_disallowed,
|
||||||
int8_t slot_remap[NUM_TOTAL_VARYING_SLOTS],
|
int8_t slot_remap[NUM_TOTAL_VARYING_SLOTS],
|
||||||
uint8_t param_export_index[NUM_TOTAL_VARYING_SLOTS]);
|
uint8_t param_export_index[NUM_TOTAL_VARYING_SLOTS]);
|
||||||
|
|
Loading…
Reference in New Issue