mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 17:20:10 +01:00
zink: init fbfetch/bindless ctx stuff on shader create
deferring until later will be problematic for threads Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>
This commit is contained in:
parent
7ddd8e428b
commit
68f319a9b8
2 changed files with 8 additions and 3 deletions
|
|
@ -402,7 +402,6 @@ zink_descriptor_program_init(struct zink_context *ctx, struct zink_program *pg)
|
|||
stages = ((struct zink_gfx_program*)pg)->shaders;
|
||||
|
||||
if (!pg->is_compute && stages[MESA_SHADER_FRAGMENT]->nir->info.fs.uses_fbfetch_output) {
|
||||
zink_descriptor_util_init_fbfetch(ctx);
|
||||
push_count = 1;
|
||||
pg->dd.fbfetch = true;
|
||||
}
|
||||
|
|
@ -452,8 +451,6 @@ zink_descriptor_program_init(struct zink_context *ctx, struct zink_program *pg)
|
|||
}
|
||||
pg->dd.bindless |= shader->bindless;
|
||||
}
|
||||
if (pg->dd.bindless)
|
||||
zink_descriptors_init_bindless(ctx);
|
||||
pg->dd.binding_usage = has_bindings;
|
||||
if (!has_bindings && !push_count && !pg->dd.bindless) {
|
||||
pg->layout = zink_pipeline_layout_create(screen, pg, &pg->compat_id);
|
||||
|
|
|
|||
|
|
@ -1213,6 +1213,9 @@ zink_create_cs_state(struct pipe_context *pctx,
|
|||
else
|
||||
nir = (struct nir_shader *)shader->prog;
|
||||
|
||||
if (nir->info.uses_bindless)
|
||||
zink_descriptors_init_bindless(zink_context(pctx));
|
||||
|
||||
return create_compute_program(zink_context(pctx), nir);
|
||||
}
|
||||
|
||||
|
|
@ -1267,6 +1270,11 @@ zink_create_gfx_shader_state(struct pipe_context *pctx, const struct pipe_shader
|
|||
else
|
||||
nir = (struct nir_shader *)shader->ir.nir;
|
||||
|
||||
if (nir->info.stage == MESA_SHADER_FRAGMENT && nir->info.fs.uses_fbfetch_output)
|
||||
zink_descriptor_util_init_fbfetch(zink_context(pctx));
|
||||
if (nir->info.uses_bindless)
|
||||
zink_descriptors_init_bindless(zink_context(pctx));
|
||||
|
||||
return zink_shader_create(zink_screen(pctx->screen), nir, &shader->stream_output);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue