radeonsi: stop using TGSI_PROPERTY_CS_*

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6624>
This commit is contained in:
Marek Olšák 2020-09-01 18:14:57 -04:00 committed by Marge Bot
parent e627528e27
commit ba7b87a8a2
4 changed files with 12 additions and 24 deletions

View File

@ -137,9 +137,9 @@ static void si_create_compute_state_async(void *job, int thread_index)
program->shader.is_monolithic = true;
program->reads_variable_block_size =
sel->info.uses_block_size && sel->info.properties[TGSI_PROPERTY_CS_FIXED_BLOCK_WIDTH] == 0;
sel->info.uses_block_size && sel->info.base.cs.local_size[0] == 0;
program->num_cs_user_data_dwords =
sel->info.properties[TGSI_PROPERTY_CS_USER_DATA_COMPONENTS_AMD];
sel->info.base.cs.user_data_components_amd;
unsigned user_sgprs = SI_NUM_RESOURCE_SGPRS + (sel->info.uses_grid_size ? 3 : 0) +
(program->reads_variable_block_size ? 3 : 0) +

View File

@ -211,10 +211,10 @@ unsigned si_get_max_workgroup_size(const struct si_shader *shader)
return 0;
}
const unsigned *properties = shader->selector->info.properties;
unsigned max_work_group_size = properties[TGSI_PROPERTY_CS_FIXED_BLOCK_WIDTH] *
properties[TGSI_PROPERTY_CS_FIXED_BLOCK_HEIGHT] *
properties[TGSI_PROPERTY_CS_FIXED_BLOCK_DEPTH];
uint16_t *local_size = shader->selector->info.base.cs.local_size;
unsigned max_work_group_size = (uint32_t)local_size[0] *
(uint32_t)local_size[1] *
(uint32_t)local_size[2];
if (!max_work_group_size) {
/* This is a variable group size compute shader,
@ -696,11 +696,11 @@ void si_create_function(struct si_shader_context *ctx, bool ngg_cull_shader)
if (shader->selector->info.uses_grid_size)
ac_add_arg(&ctx->args, AC_ARG_SGPR, 3, AC_ARG_INT, &ctx->args.num_work_groups);
if (shader->selector->info.uses_block_size &&
shader->selector->info.properties[TGSI_PROPERTY_CS_FIXED_BLOCK_WIDTH] == 0)
shader->selector->info.base.cs.local_size[0] == 0)
ac_add_arg(&ctx->args, AC_ARG_SGPR, 3, AC_ARG_INT, &ctx->block_size);
unsigned cs_user_data_dwords =
shader->selector->info.properties[TGSI_PROPERTY_CS_USER_DATA_COMPONENTS_AMD];
shader->selector->info.base.cs.user_data_components_amd;
if (cs_user_data_dwords) {
ac_add_arg(&ctx->args, AC_ARG_SGPR, cs_user_data_dwords, AC_ARG_INT, &ctx->cs_user_data);
}

View File

@ -370,15 +370,11 @@ LLVMValueRef si_llvm_get_block_size(struct ac_shader_abi *abi)
LLVMValueRef values[3];
LLVMValueRef result;
unsigned i;
unsigned *properties = ctx->shader->selector->info.properties;
if (properties[TGSI_PROPERTY_CS_FIXED_BLOCK_WIDTH] != 0) {
unsigned sizes[3] = {properties[TGSI_PROPERTY_CS_FIXED_BLOCK_WIDTH],
properties[TGSI_PROPERTY_CS_FIXED_BLOCK_HEIGHT],
properties[TGSI_PROPERTY_CS_FIXED_BLOCK_DEPTH]};
uint16_t *local_size = ctx->shader->selector->info.base.cs.local_size;
if (local_size[0] != 0) {
for (i = 0; i < 3; ++i)
values[i] = LLVMConstInt(ctx->ac.i32, sizes[i], 0);
values[i] = LLVMConstInt(ctx->ac.i32, local_size[i], 0);
result = ac_build_gather_values(&ctx->ac, values, 3);
} else {

View File

@ -289,7 +289,7 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
break;
case nir_intrinsic_load_local_group_size:
/* The block size is translated to IMM with a fixed block size. */
if (info->properties[TGSI_PROPERTY_CS_FIXED_BLOCK_WIDTH] == 0)
if (info->base.cs.local_size[0] == 0)
info->uses_block_size = true;
break;
case nir_intrinsic_load_local_invocation_id:
@ -504,14 +504,6 @@ void si_nir_scan_shader(const struct nir_shader *nir, struct si_shader_info *inf
TGSI_INTERPOLATE_LOC_CENTER;
}
if (gl_shader_stage_is_compute(nir->info.stage)) {
info->properties[TGSI_PROPERTY_CS_FIXED_BLOCK_WIDTH] = nir->info.cs.local_size[0];
info->properties[TGSI_PROPERTY_CS_FIXED_BLOCK_HEIGHT] = nir->info.cs.local_size[1];
info->properties[TGSI_PROPERTY_CS_FIXED_BLOCK_DEPTH] = nir->info.cs.local_size[2];
info->properties[TGSI_PROPERTY_CS_USER_DATA_COMPONENTS_AMD] =
nir->info.cs.user_data_components_amd;
}
info->constbuf0_num_slots = nir->num_uniforms;
info->shader_buffers_declared = u_bit_consecutive(0, nir->info.num_ssbos);
info->const_buffers_declared = u_bit_consecutive(0, nir->info.num_ubos);