zink: store num_inlinable_uniforms separately for cs programs

compute is a special case because the zink_shader itself is created
in a thread, which means it cannot be accessed directly at bind time
since it may not have finished creating itself yet

to avoid prematurely waiting on an async fence, the one value needed
at bind time can instead be stored separately

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22266>
This commit is contained in:
Mike Blumenkrantz
2023-03-29 08:40:14 -04:00
committed by Marge Bot
parent 517146f540
commit 4e1668384d
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -1282,6 +1282,7 @@ create_compute_program(struct zink_context *ctx, nir_shader *nir)
if (!comp)
return NULL;
comp->nir = nir;
comp->num_inlinable_uniforms = nir->info.num_inlinable_uniforms;
comp->use_local_size = !(nir->info.workgroup_size[0] ||
nir->info.workgroup_size[1] ||
@@ -1837,7 +1838,7 @@ zink_bind_cs_state(struct pipe_context *pctx,
{
struct zink_context *ctx = zink_context(pctx);
struct zink_compute_program *comp = cso;
if (comp && comp->nir->info.num_inlinable_uniforms)
if (comp && comp->num_inlinable_uniforms)
ctx->shader_has_inlinable_uniforms_mask |= 1 << MESA_SHADER_COMPUTE;
else
ctx->shader_has_inlinable_uniforms_mask &= ~(1 << MESA_SHADER_COMPUTE);
+1
View File
@@ -1064,6 +1064,7 @@ struct zink_compute_program {
bool use_local_size;
unsigned num_inlinable_uniforms;
nir_shader *nir;
struct zink_shader_module *curr;