anv: Allocate prog_data->param array when making internal kernels

As we set prog_data->nr_params, allocate the array like elsewhere.
Current code is getting by because the logic for adding a new element
will realloc it.  But later changes will make the array be accessed
before this reallocation.

This will make sure later patches won't cause tests like

  dEQP-VK.query_pool.statistics_query.compute_shader_invocations.32bits_cmdcopyquerypoolresults_secondary

to fail in gfxver < 125.  Note the bug appears when DRI option
to tweak the thresold to use these shaders is set to 0.  This is
done by the GitLab CI, which allowed testing later patches to find
this issue.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33541>
This commit is contained in:
Caio Oliveira
2025-04-18 16:59:27 -07:00
committed by Marge Bot
parent b8a35a8a27
commit 0b4d62d340
+3 -2
View File
@@ -144,12 +144,13 @@ compile_shader(struct anv_device *device,
nir->num_uniforms = uniform_size;
void *temp_ctx = ralloc_context(NULL);
prog_data.base.nr_params = nir->num_uniforms / 4;
prog_data.base.param = rzalloc_array(temp_ctx, uint32_t, prog_data.base.nr_params);
brw_nir_analyze_ubo_ranges(compiler, nir, prog_data.base.ubo_ranges);
void *temp_ctx = ralloc_context(NULL);
const unsigned *program;
if (stage == MESA_SHADER_FRAGMENT) {
struct brw_compile_stats stats[3];