iris/elk: Restore setting nir->num_uniforms to zero.

Elk still uses param array, so it depends on this behavior. This fixes
an assertion failure on Broadwell in gfxbench4/carchase/339.shader_test.

src/intel/compiler/elk/elk_fs_nir.cpp:148: void fs_nir_setup_uniforms(elk_fs_visitor&): Assertion `s.uniforms == s.prog_data->nr_params' failed.

Fixes: f4a0e05970 ("anv/brw/iris: get rid of param array on prog_data")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39280>
This commit is contained in:
Ian Romanick 2026-01-12 17:55:55 -08:00 committed by Marge Bot
parent 6f076cdfda
commit d19ea686d3

View file

@ -1212,6 +1212,17 @@ iris_setup_uniforms(ASSERTED const struct intel_device_info *devinfo,
assert(num_cbufs < PIPE_MAX_CONSTANT_BUFFERS);
nir_validate_shader(nir, "after remap");
#ifdef INTEL_USE_ELK
/* We don't use params[] but gallium leaves num_uniforms set. We use this
* to detect when cbuf0 exists but we don't need it anymore when we get
* here. Instead, zero it out so that the back-end doesn't get confused
* when nr_params * 4 != num_uniforms != nr_params * 4.
*
* Elk still depends on this behavior.
*/
nir->num_uniforms = 0;
#endif
*out_system_values = system_values;
*out_num_system_values = num_system_values;
*out_num_cbufs = num_cbufs;