From: Kenneth Graunke Date: Fri, 9 Nov 2018 20:49:49 +0000 (-0800) Subject: iris: don't trip on param asserts X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b5d35319e549882dc52d3a63d081f40e61cffe7;p=mesa.git iris: don't trip on param asserts I'd rather not rewrite i965's compute system value handling right now :( --- diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 9634075196e..10b41e3e457 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -415,6 +415,13 @@ iris_setup_uniforms(const struct brw_compiler *compiler, enum brw_param_builtin **out_system_values, unsigned *out_num_system_values) { + /* We don't use params[], but fs_visitor::nir_setup_uniforms() asserts + * about it for compute shaders, so go ahead and make some fake ones + * which the backend will dead code eliminate. + */ + prog_data->nr_params = nir->num_uniforms; + prog_data->param = rzalloc_array(mem_ctx, uint32_t, prog_data->nr_params); + /* The intel compiler assumes that num_uniforms is in bytes. For * scalar that means 4 bytes per uniform slot. * @@ -422,9 +429,6 @@ iris_setup_uniforms(const struct brw_compiler *compiler, */ nir->num_uniforms *= 4; - prog_data->nr_params = 0; - prog_data->param = rzalloc_array(mem_ctx, uint32_t, 1); - const unsigned IRIS_MAX_SYSTEM_VALUES = 32; enum brw_param_builtin *system_values = rzalloc_array(mem_ctx, enum brw_param_builtin, IRIS_MAX_SYSTEM_VALUES);