this should be identical to the previous code, except it also
handles depth/stencil (not yet supported)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
if (cso) {
shader_info *info = &ctx->gfx_stages[MESA_SHADER_FRAGMENT]->info;
if (info->fs.uses_fbfetch_output) {
- nir_foreach_shader_out_variable(var, ctx->gfx_stages[MESA_SHADER_FRAGMENT]->nir) {
- if (var->data.fb_fetch_output)
- ctx->fbfetch_outputs |= BITFIELD_BIT(var->data.location - FRAG_RESULT_DATA0);
- }
+ if (info->outputs_read & (BITFIELD_BIT(FRAG_RESULT_DEPTH) | BITFIELD_BIT(FRAG_RESULT_STENCIL)))
+ ctx->fbfetch_outputs |= BITFIELD_BIT(PIPE_MAX_COLOR_BUFS);
+ ctx->fbfetch_outputs |= info->outputs_read >> FRAG_RESULT_DATA0;
}
zink_update_fs_key_samples(ctx);
if (zink_screen(pctx->screen)->info.have_EXT_rasterization_order_attachment_access) {