}
}
ctx->shader_info->fs.num_interp = index;
- if (ctx->input_mask & (1 << VARYING_SLOT_PNTC))
- ctx->shader_info->fs.has_pcoord = true;
- if (ctx->input_mask & (1 << VARYING_SLOT_PRIMITIVE_ID))
- ctx->shader_info->fs.prim_id_input = true;
- if (ctx->input_mask & (1 << VARYING_SLOT_LAYER))
- ctx->shader_info->fs.layer_input = true;
ctx->shader_info->fs.input_mask = ctx->input_mask >> VARYING_SLOT_VAR0;
if (ctx->shader_info->info.needs_multiview_view_index)
struct ac_shader_info *info)
{
const struct glsl_type *type = glsl_without_array(var->type);
+ int idx = var->data.location;
+
+ switch (idx) {
+ case VARYING_SLOT_PNTC:
+ info->ps.has_pcoord = true;
+ break;
+ case VARYING_SLOT_PRIMITIVE_ID:
+ info->ps.prim_id_input = true;
+ break;
+ case VARYING_SLOT_LAYER:
+ info->ps.layer_input = true;
+ break;
+ default:
+ break;
+ }
if (glsl_get_base_type(type) == GLSL_TYPE_FLOAT) {
if (var->data.sample)
/* TODO: These are no longer used as keys we should refactor this */
keys[MESA_SHADER_VERTEX].vs.export_prim_id =
- pipeline->shaders[MESA_SHADER_FRAGMENT]->info.fs.prim_id_input;
+ pipeline->shaders[MESA_SHADER_FRAGMENT]->info.info.ps.prim_id_input;
keys[MESA_SHADER_TESS_EVAL].tes.export_prim_id =
- pipeline->shaders[MESA_SHADER_FRAGMENT]->info.fs.prim_id_input;
+ pipeline->shaders[MESA_SHADER_FRAGMENT]->info.info.ps.prim_id_input;
}
if (device->physical_device->rad_info.chip_class >= GFX9 && modules[MESA_SHADER_TESS_CTRL]) {
unsigned ps_offset = 0;
- if (ps->info.fs.prim_id_input) {
+ if (ps->info.info.ps.prim_id_input) {
unsigned vs_offset = outinfo->vs_output_param_offset[VARYING_SLOT_PRIMITIVE_ID];
if (vs_offset != AC_EXP_PARAM_UNDEFINED) {
ps_input_cntl[ps_offset] = offset_to_ps_input(vs_offset, true);
}
}
- if (ps->info.fs.layer_input) {
+ if (ps->info.info.ps.layer_input ||
+ ps->info.info.ps.uses_input_attachments ||
+ ps->info.info.needs_multiview_view_index) {
unsigned vs_offset = outinfo->vs_output_param_offset[VARYING_SLOT_LAYER];
if (vs_offset != AC_EXP_PARAM_UNDEFINED)
ps_input_cntl[ps_offset] = offset_to_ps_input(vs_offset, true);
++ps_offset;
}
- if (ps->info.fs.has_pcoord) {
+ if (ps->info.info.ps.has_pcoord) {
unsigned val;
val = S_028644_PT_SPRITE_TEX(1) | S_028644_OFFSET(0x20);
ps_input_cntl[ps_offset] = val;
}
ia_multi_vgt_param.ia_switch_on_eoi = false;
- if (pipeline->shaders[MESA_SHADER_FRAGMENT]->info.fs.prim_id_input)
+ if (pipeline->shaders[MESA_SHADER_FRAGMENT]->info.info.ps.prim_id_input)
ia_multi_vgt_param.ia_switch_on_eoi = true;
if (radv_pipeline_has_gs(pipeline) &&
pipeline->shaders[MESA_SHADER_GEOMETRY]->info.info.uses_prim_id)