aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_program.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-11-09 12:49:49 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:10 -0800
commit1b5d35319e549882dc52d3a63d081f40e61cffe7 (patch)
treee449bb4c0c43e1e5e6733084eb5fb026944da5ae /src/gallium/drivers/iris/iris_program.c
parentf4829a2fe107519691a2c7a7b565baa51e006d48 (diff)
iris: don't trip on param asserts
I'd rather not rewrite i965's compute system value handling right now :(
Diffstat (limited to 'src/gallium/drivers/iris/iris_program.c')
-rw-r--r--src/gallium/drivers/iris/iris_program.c10
1 files changed, 7 insertions, 3 deletions
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);