nir: change "user_data_amd" sysval from 4 to 8 components
so that we can pass more fast constants to compute shaders (without reading memory in the shader). Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28606>
This commit is contained in:
@@ -12,6 +12,7 @@ void ac_add_arg(struct ac_shader_args *info, enum ac_arg_regfile regfile, unsign
|
|||||||
enum ac_arg_type type, struct ac_arg *arg)
|
enum ac_arg_type type, struct ac_arg *arg)
|
||||||
{
|
{
|
||||||
assert(info->arg_count < AC_MAX_ARGS);
|
assert(info->arg_count < AC_MAX_ARGS);
|
||||||
|
assert(nir_num_components_valid(size));
|
||||||
|
|
||||||
unsigned offset;
|
unsigned offset;
|
||||||
if (regfile == AC_ARG_SGPR) {
|
if (regfile == AC_ARG_SGPR) {
|
||||||
|
@@ -1012,7 +1012,7 @@ system_value("color0", 4)
|
|||||||
system_value("color1", 4)
|
system_value("color1", 4)
|
||||||
|
|
||||||
# System value for internal compute shaders in radeonsi.
|
# System value for internal compute shaders in radeonsi.
|
||||||
system_value("user_data_amd", 4)
|
system_value("user_data_amd", 8)
|
||||||
|
|
||||||
# In a fragment shader, the current sample mask. At the beginning of the shader,
|
# In a fragment shader, the current sample mask. At the beginning of the shader,
|
||||||
# this is the same as load_sample_mask_in, but as the shader is executed, it may
|
# this is the same as load_sample_mask_in, but as the shader is executed, it may
|
||||||
|
@@ -532,7 +532,7 @@ typedef struct shader_info {
|
|||||||
struct {
|
struct {
|
||||||
uint16_t workgroup_size_hint[3];
|
uint16_t workgroup_size_hint[3];
|
||||||
|
|
||||||
uint8_t user_data_components_amd:3;
|
uint8_t user_data_components_amd:4;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Arrangement of invocations used to calculate derivatives in a compute
|
* Arrangement of invocations used to calculate derivatives in a compute
|
||||||
|
@@ -746,7 +746,7 @@ static bool lower_intrinsic(nir_builder *b, nir_instr *instr, struct lower_abi_s
|
|||||||
}
|
}
|
||||||
case nir_intrinsic_load_user_data_amd:
|
case nir_intrinsic_load_user_data_amd:
|
||||||
replacement = ac_nir_load_arg(b, &args->ac, args->cs_user_data);
|
replacement = ac_nir_load_arg(b, &args->ac, args->cs_user_data);
|
||||||
replacement = nir_pad_vec4(b, replacement);
|
replacement = nir_pad_vector(b, replacement, 8);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@@ -1159,7 +1159,7 @@ struct si_context {
|
|||||||
unsigned border_color_count;
|
unsigned border_color_count;
|
||||||
unsigned num_vs_blit_sgprs;
|
unsigned num_vs_blit_sgprs;
|
||||||
uint32_t vs_blit_sh_data[MAX_SI_VS_BLIT_SGPRS];
|
uint32_t vs_blit_sh_data[MAX_SI_VS_BLIT_SGPRS];
|
||||||
uint32_t cs_user_data[4];
|
uint32_t cs_user_data[8];
|
||||||
|
|
||||||
/* Vertex buffers. */
|
/* Vertex buffers. */
|
||||||
bool vertex_buffers_dirty;
|
bool vertex_buffers_dirty;
|
||||||
|
Reference in New Issue
Block a user