radeonsi: remove info::samplers_declared, image_buffers, msaa_images_declared

They are redundant with shader_info.

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-06 02:10:33 -04:00 committed by Marge Bot
parent cb7bc983ae
commit cb63e4afc9
8 changed files with 13 additions and 21 deletions

View File

@ -152,10 +152,10 @@ static void si_create_compute_state_async(void *job, int thread_index)
}
/* Images in user SGPRs. */
unsigned non_msaa_images = sel->info.images_declared & ~sel->info.msaa_images_declared;
unsigned non_msaa_images = sel->info.images_declared & ~sel->info.base.msaa_images;
for (unsigned i = 0; i < 3 && non_msaa_images & (1 << i); i++) {
unsigned num_sgprs = sel->info.image_buffers & (1 << i) ? 4 : 8;
unsigned num_sgprs = sel->info.base.image_buffers & (1 << i) ? 4 : 8;
if (align(user_sgprs, num_sgprs) + num_sgprs > 16)
break;

View File

@ -791,7 +791,7 @@ static void si_dump_descriptors(struct si_context *sctx, gl_shader_stage stage,
if (info) {
enabled_constbuf = info->const_buffers_declared;
enabled_shaderbuf = info->shader_buffers_declared;
enabled_samplers = info->samplers_declared;
enabled_samplers = info->base.textures_used;
enabled_images = info->images_declared;
} else {
enabled_constbuf =

View File

@ -2210,7 +2210,7 @@ void si_emit_compute_shader_pointers(struct si_context *sctx)
unsigned num_sgprs = 8;
/* Image buffers are in desc[4..7]. */
if (shader->info.image_buffers & (1 << i)) {
if (shader->info.base.image_buffers & (1 << i)) {
desc_offset += 4;
num_sgprs = 4;
}
@ -2803,7 +2803,7 @@ bool si_gfx_resources_check_encrypted(struct si_context *sctx)
si_buffer_resources_check_encrypted(sctx, &sctx->const_and_shader_buffers[i]);
use_encrypted_bo |=
si_sampler_views_check_encrypted(sctx, &sctx->samplers[i],
current_shader[i]->cso->info.samplers_declared);
current_shader[i]->cso->info.base.textures_used);
use_encrypted_bo |= si_image_views_check_encrypted(sctx, &sctx->images[i],
current_shader[i]->cso->info.images_declared);
}
@ -2857,7 +2857,7 @@ bool si_compute_resources_check_encrypted(struct si_context *sctx)
* or all writable buffers are encrypted.
*/
return si_buffer_resources_check_encrypted(sctx, &sctx->const_and_shader_buffers[sh]) ||
si_sampler_views_check_encrypted(sctx, &sctx->samplers[sh], info->samplers_declared) ||
si_sampler_views_check_encrypted(sctx, &sctx->samplers[sh], info->base.textures_used) ||
si_image_views_check_encrypted(sctx, &sctx->images[sh], info->images_declared) ||
si_buffer_resources_check_encrypted(sctx, &sctx->rw_buffers);
}

View File

@ -715,7 +715,7 @@ void si_create_function(struct si_shader_context *ctx, bool ngg_cull_shader)
}
/* Images in user SGPRs. */
for (unsigned i = 0; i < shader->selector->cs_num_images_in_user_sgprs; i++) {
unsigned num_sgprs = shader->selector->info.image_buffers & (1 << i) ? 4 : 8;
unsigned num_sgprs = shader->selector->info.base.image_buffers & (1 << i) ? 4 : 8;
while (ctx->args.num_sgprs_used % num_sgprs != 0)
ac_add_arg(&ctx->args, AC_ARG_SGPR, 1, AC_ARG_INT, NULL);
@ -1345,7 +1345,7 @@ static bool si_build_main_function(struct si_shader_context *ctx, struct si_shad
ctx->num_const_buffers = util_last_bit(info->const_buffers_declared);
ctx->num_shader_buffers = util_last_bit(info->shader_buffers_declared);
ctx->num_samplers = util_last_bit(info->samplers_declared);
ctx->num_samplers = util_last_bit(info->base.textures_used);
ctx->num_images = util_last_bit(info->images_declared);
si_llvm_init_resource_callbacks(ctx);

View File

@ -336,7 +336,6 @@ struct si_shader_info {
int constbuf0_num_slots;
unsigned const_buffers_declared; /**< bitmask of declared const buffers */
unsigned samplers_declared; /**< bitmask of declared samplers */
ubyte num_stream_output_components[4];
uint num_memory_instructions; /**< sampler, buffer, and image instructions */
@ -389,8 +388,6 @@ struct si_shader_info {
unsigned num_written_clipdistance;
unsigned images_declared; /**< bitmask of declared images */
unsigned image_buffers; /**< bitmask of images that are buffers */
unsigned msaa_images_declared; /**< bitmask of declared MSAA images */
unsigned shader_buffers_declared; /**< bitmask of declared shader buffers */
/** Whether all codepaths write tess factors in all invocations. */

View File

@ -250,9 +250,7 @@ static void scan_instruction(const struct nir_shader *nir, struct si_shader_info
const nir_deref_instr *deref = tex_get_texture_deref(tex);
nir_variable *var = deref ? nir_deref_instr_get_variable(deref) : NULL;
if (!var) {
info->samplers_declared |= u_bit_consecutive(tex->sampler_index, 1);
} else {
if (var) {
if (deref->mode != nir_var_uniform || var->data.bindless)
info->uses_bindless_samplers = true;
}
@ -484,9 +482,6 @@ void si_nir_scan_shader(const struct nir_shader *nir, struct si_shader_info *inf
info->shader_buffers_declared = u_bit_consecutive(0, nir->info.num_ssbos);
info->const_buffers_declared = u_bit_consecutive(0, nir->info.num_ubos);
info->images_declared = u_bit_consecutive(0, nir->info.num_images);
info->msaa_images_declared = nir->info.msaa_images;
info->image_buffers = nir->info.image_buffers;
info->samplers_declared = nir->info.textures_used;
info->num_written_clipdistance = nir->info.clip_distance_array_size;
info->num_written_culldistance = nir->info.cull_distance_array_size;

View File

@ -1549,8 +1549,8 @@ static bool si_all_vs_resources_read_only(struct si_context *sctx, struct pipe_r
/* Samplers. */
struct si_shader_selector *vs = sctx->vs_shader.cso;
if (vs->info.samplers_declared) {
unsigned num_samplers = util_last_bit(vs->info.samplers_declared);
if (vs->info.base.textures_used) {
unsigned num_samplers = util_last_bit(vs->info.base.textures_used);
for (unsigned i = 0; i < num_samplers; i++) {
struct pipe_sampler_view *view = sctx->samplers[PIPE_SHADER_VERTEX].views[i];

View File

@ -2547,8 +2547,8 @@ void si_get_active_slot_masks(const struct si_shader_info *info, uint64_t *const
num_constbufs = util_last_bit(info->const_buffers_declared);
/* two 8-byte images share one 16-byte slot */
num_images = align(util_last_bit(info->images_declared), 2);
num_msaa_images = align(util_last_bit(info->msaa_images_declared), 2);
num_samplers = util_last_bit(info->samplers_declared);
num_msaa_images = align(util_last_bit(info->base.msaa_images), 2);
num_samplers = util_last_bit(info->base.textures_used);
/* The layout is: sb[last] ... sb[0], cb[0] ... cb[last] */
start = si_get_shaderbuf_slot(num_shaderbufs - 1);