asahi: Use local_size from compiler directly

This avoids an unnecessary trip through agx_uncompiled_shader.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
This commit is contained in:
Alyssa Rosenzweig 2023-08-12 12:57:01 -04:00 committed by Marge Bot
parent 6247e617c1
commit 486fb75981
2 changed files with 2 additions and 10 deletions

View file

@ -1848,11 +1848,8 @@ agx_create_compute_state(struct pipe_context *pctx,
nir_shader *nir = (void *)cso->prog; nir_shader *nir = (void *)cso->prog;
agx_shader_initialize(dev, so, nir); agx_shader_initialize(dev, so, nir);
struct agx_compiled_shader *cs =
agx_get_shader_variant(agx_screen(pctx->screen), so, &pctx->debug, &key); agx_get_shader_variant(agx_screen(pctx->screen), so, &pctx->debug, &key);
so->static_shared_mem = cs->info.local_size;
/* We're done with the NIR, throw it away */ /* We're done with the NIR, throw it away */
ralloc_free(nir); ralloc_free(nir);
return so; return so;
@ -2247,9 +2244,7 @@ agx_build_pipeline(struct agx_batch *batch, struct agx_compiled_shader *cs,
if (stage == PIPE_SHADER_FRAGMENT) { if (stage == PIPE_SHADER_FRAGMENT) {
agx_usc_tilebuffer(&b, &batch->tilebuffer_layout); agx_usc_tilebuffer(&b, &batch->tilebuffer_layout);
} else if (stage == PIPE_SHADER_COMPUTE) { } else if (stage == PIPE_SHADER_COMPUTE) {
unsigned size = unsigned size = cs->info.local_size + variable_shared_mem;
ctx->stage[PIPE_SHADER_COMPUTE].shader->static_shared_mem +
variable_shared_mem;
agx_usc_pack(&b, SHARED, cfg) { agx_usc_pack(&b, SHARED, cfg) {
cfg.layout = AGX_SHARED_LAYOUT_VERTEX_COMPUTE; cfg.layout = AGX_SHARED_LAYOUT_VERTEX_COMPUTE;

View file

@ -186,9 +186,6 @@ struct agx_uncompiled_shader {
*/ */
bool internal_bindless; bool internal_bindless;
/* For compute kernels */
unsigned static_shared_mem;
/* Set on VS, passed to FS for linkage */ /* Set on VS, passed to FS for linkage */
unsigned base_varying; unsigned base_varying;
}; };