/* Fast path for compute shaders - some descriptors passed via user SGPRs. */
/* Shader buffers in user SGPRs. */
- for (unsigned i = 0; i < 3 && user_sgprs <= 12 && sel->info.shader_buffers_declared & (1 << i); i++) {
+ for (unsigned i = 0; i < MIN2(3, sel->info.base.num_ssbos) && user_sgprs <= 12; i++) {
user_sgprs = align(user_sgprs, 4);
if (i == 0)
sel->cs_shaderbufs_sgpr_index = user_sgprs;
enum ac_arg_type const_desc_type;
if (ctx->shader->selector->info.const_buffers_declared == 1 &&
- ctx->shader->selector->info.shader_buffers_declared == 0)
+ ctx->shader->selector->info.base.num_ssbos == 0)
const_desc_type = AC_ARG_CONST_FLOAT_PTR;
else
const_desc_type = AC_ARG_CONST_DESC_PTR;
if (info) {
enabled_constbuf = info->const_buffers_declared;
- enabled_shaderbuf = info->shader_buffers_declared;
+ enabled_shaderbuf = u_bit_consecutive(0, info->base.num_ssbos);
enabled_samplers = info->base.textures_used;
enabled_images = info->images_declared;
} else {
enum ac_arg_type const_shader_buf_type;
if (ctx->shader->selector->info.const_buffers_declared == 1 &&
- ctx->shader->selector->info.shader_buffers_declared == 0)
+ ctx->shader->selector->info.base.num_ssbos == 0)
const_shader_buf_type = AC_ARG_CONST_FLOAT_PTR;
else
const_shader_buf_type = AC_ARG_CONST_DESC_PTR;
ctx->stage = sel->info.stage;
ctx->num_const_buffers = util_last_bit(info->const_buffers_declared);
- ctx->num_shader_buffers = util_last_bit(info->shader_buffers_declared);
+ 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);
unsigned num_written_clipdistance;
unsigned images_declared; /**< bitmask of declared images */
- unsigned shader_buffers_declared; /**< bitmask of declared shader buffers */
/** Whether all codepaths write tess factors in all invocations. */
bool tessfactors_are_def_in_all_invocs;
LLVMValueRef ptr = ac_get_arg(&ctx->ac, ctx->const_and_shader_buffers);
- if (sel->info.const_buffers_declared == 1 && sel->info.shader_buffers_declared == 0) {
+ if (sel->info.const_buffers_declared == 1 && sel->info.base.num_ssbos == 0) {
return load_const_buffer_desc_fast_path(ctx);
}
}
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);
info->images_declared = u_bit_consecutive(0, nir->info.num_images);
{
unsigned start, num_shaderbufs, num_constbufs, num_images, num_msaa_images, num_samplers;
- num_shaderbufs = util_last_bit(info->shader_buffers_declared);
+ 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);