radeonsi: remove redundant si_shader_info::images_declared
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:
parent
c1af2f4bee
commit
0dabcb9e53
|
@ -152,7 +152,8 @@ 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.base.msaa_images;
|
||||
unsigned non_msaa_images = u_bit_consecutive(0, sel->info.base.num_images) &
|
||||
~sel->info.base.msaa_images;
|
||||
|
||||
for (unsigned i = 0; i < 3 && non_msaa_images & (1 << i); i++) {
|
||||
unsigned num_sgprs = sel->info.base.image_buffers & (1 << i) ? 4 : 8;
|
||||
|
|
|
@ -792,7 +792,7 @@ static void si_dump_descriptors(struct si_context *sctx, gl_shader_stage stage,
|
|||
enabled_constbuf = info->const_buffers_declared;
|
||||
enabled_shaderbuf = u_bit_consecutive(0, info->base.num_ssbos);
|
||||
enabled_samplers = info->base.textures_used;
|
||||
enabled_images = info->images_declared;
|
||||
enabled_images = u_bit_consecutive(0, info->base.num_images);
|
||||
} else {
|
||||
enabled_constbuf =
|
||||
sctx->const_and_shader_buffers[processor].enabled_mask >> SI_NUM_SHADER_BUFFERS;
|
||||
|
|
|
@ -2805,7 +2805,7 @@ bool si_gfx_resources_check_encrypted(struct si_context *sctx)
|
|||
si_sampler_views_check_encrypted(sctx, &sctx->samplers[i],
|
||||
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);
|
||||
u_bit_consecutive(0, current_shader[i]->cso->info.base.num_images));
|
||||
}
|
||||
use_encrypted_bo |= si_buffer_resources_check_encrypted(sctx, &sctx->rw_buffers);
|
||||
|
||||
|
@ -2858,7 +2858,7 @@ bool si_compute_resources_check_encrypted(struct si_context *sctx)
|
|||
*/
|
||||
return si_buffer_resources_check_encrypted(sctx, &sctx->const_and_shader_buffers[sh]) ||
|
||||
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_image_views_check_encrypted(sctx, &sctx->images[sh], u_bit_consecutive(0, info->base.num_images)) ||
|
||||
si_buffer_resources_check_encrypted(sctx, &sctx->rw_buffers);
|
||||
}
|
||||
|
||||
|
|
|
@ -1346,7 +1346,7 @@ static bool si_build_main_function(struct si_shader_context *ctx, struct si_shad
|
|||
ctx->num_shader_buffers = info->base.num_ssbos;
|
||||
|
||||
ctx->num_samplers = util_last_bit(info->base.textures_used);
|
||||
ctx->num_images = util_last_bit(info->images_declared);
|
||||
ctx->num_images = info->base.num_images;
|
||||
|
||||
si_llvm_init_resource_callbacks(ctx);
|
||||
|
||||
|
|
|
@ -387,8 +387,6 @@ struct si_shader_info {
|
|||
unsigned num_written_culldistance;
|
||||
unsigned num_written_clipdistance;
|
||||
|
||||
unsigned images_declared; /**< bitmask of declared images */
|
||||
|
||||
/** Whether all codepaths write tess factors in all invocations. */
|
||||
bool tessfactors_are_def_in_all_invocs;
|
||||
};
|
||||
|
|
|
@ -480,7 +480,6 @@ void si_nir_scan_shader(const struct nir_shader *nir, struct si_shader_info *inf
|
|||
|
||||
info->constbuf0_num_slots = nir->num_uniforms;
|
||||
info->const_buffers_declared = u_bit_consecutive(0, nir->info.num_ubos);
|
||||
info->images_declared = u_bit_consecutive(0, nir->info.num_images);
|
||||
|
||||
info->num_written_clipdistance = nir->info.clip_distance_array_size;
|
||||
info->num_written_culldistance = nir->info.cull_distance_array_size;
|
||||
|
|
|
@ -1563,9 +1563,8 @@ static bool si_all_vs_resources_read_only(struct si_context *sctx, struct pipe_r
|
|||
}
|
||||
|
||||
/* Images. */
|
||||
if (vs->info.images_declared) {
|
||||
unsigned num_images = util_last_bit(vs->info.images_declared);
|
||||
|
||||
unsigned num_images = vs->info.base.num_images;
|
||||
if (num_images) {
|
||||
for (unsigned i = 0; i < num_images; i++) {
|
||||
struct pipe_resource *res = sctx->images[PIPE_SHADER_VERTEX].views[i].resource;
|
||||
if (!res)
|
||||
|
|
|
@ -2546,7 +2546,7 @@ void si_get_active_slot_masks(const struct si_shader_info *info, uint64_t *const
|
|||
num_shaderbufs = info->base.num_ssbos;
|
||||
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_images = align(info->base.num_images, 2);
|
||||
num_msaa_images = align(util_last_bit(info->base.msaa_images), 2);
|
||||
num_samplers = util_last_bit(info->base.textures_used);
|
||||
|
||||
|
|
Loading…
Reference in New Issue