unsigned i;
unsigned num_sets = ctx->options->layout ? ctx->options->layout->num_sets : 0;
unsigned user_sgpr_idx;
- bool need_push_constants;
bool need_ring_offsets = false;
/* until we sort out scratch/global buffers always assign ring offsets for gs/vs/es */
ctx->is_gs_copy_shader)
need_ring_offsets = true;
- need_push_constants = true;
- if (!ctx->options->layout)
- need_push_constants = false;
- else if (!ctx->options->layout->push_constant_size &&
- !ctx->options->layout->dynamic_offset_count)
- need_push_constants = false;
-
if (need_ring_offsets && !ctx->options->supports_spill) {
arg_types[arg_idx++] = const_array(ctx->v16i8, 16); /* address of rings */
}
}
}
- if (need_push_constants) {
+ if (ctx->shader_info->info.needs_push_constants) {
/* 1 for push constants and dynamic descriptors */
array_params_mask |= (1 << arg_idx);
arg_types[arg_idx++] = const_array(ctx->i8, 1024 * 1024);
ctx->descriptor_sets[i] = NULL;
}
- if (need_push_constants) {
+ if (ctx->shader_info->info.needs_push_constants) {
ctx->push_constants = LLVMGetParam(ctx->main_function, arg_idx++);
set_userdata_location_shader(ctx, AC_UD_PUSH_CONSTANTS, user_sgpr_idx, 2);
user_sgpr_idx += 2;
struct ac_shader_info *info)
{
struct nir_function *func = (struct nir_function *)exec_list_get_head(&nir->functions);
+
+ info->needs_push_constants = true;
+ if (!options->layout)
+ info->needs_push_constants = false;
+ else if (!options->layout->push_constant_size &&
+ !options->layout->dynamic_offset_count)
+ info->needs_push_constants = false;
+
nir_foreach_variable(variable, &nir->inputs)
gather_info_input_decl(nir, options, variable, info);