aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_program_cache.c
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-01-19 11:32:37 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:11 -0800
commit4fd1f70e62e1bbba228712065f756a1c30650432 (patch)
treeb21f524c719e8572c93f742c76ecfe362d96fe1c /src/gallium/drivers/iris/iris_program_cache.c
parent4801af2f26ced530b6a8c86a79a16857e670959a (diff)
iris: always include an extra constbuf0 if using UBOs
In st_nir_lower_uniforms_to_ubo() all UBO access in the shader have its index incremented to open room for uniforms in constbuf0. So if we use UBOs, we always need to include the extra binding entry in the table. To avoid doing this checks both when compiling the shader and when assigning binding tables, store the num_cbufs in iris_compiled_shader. Fixes a bunch of tests from Piglit and CTS that use UBOs but don't use uniforms or system values. Note that some tests fitting this criteria were passing because the UBOs were moved to be push constants (avoiding the problem). Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris/iris_program_cache.c')
-rw-r--r--src/gallium/drivers/iris/iris_program_cache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/iris/iris_program_cache.c b/src/gallium/drivers/iris/iris_program_cache.c
index 1bc380e3df3..849f96906ca 100644
--- a/src/gallium/drivers/iris/iris_program_cache.c
+++ b/src/gallium/drivers/iris/iris_program_cache.c
@@ -166,7 +166,8 @@ iris_upload_shader(struct iris_context *ice,
struct brw_stage_prog_data *prog_data,
uint32_t *streamout,
enum brw_param_builtin *system_values,
- unsigned num_system_values)
+ unsigned num_system_values,
+ unsigned num_cbufs)
{
struct hash_table *cache = ice->shaders.cache;
struct iris_compiled_shader *shader =
@@ -197,6 +198,7 @@ iris_upload_shader(struct iris_context *ice,
shader->streamout = streamout;
shader->system_values = system_values;
shader->num_system_values = num_system_values;
+ shader->num_cbufs = num_cbufs;
ralloc_steal(shader, shader->prog_data);
ralloc_steal(shader->prog_data, prog_data->param);
@@ -254,7 +256,7 @@ iris_blorp_upload_shader(struct blorp_batch *blorp_batch,
struct iris_compiled_shader *shader =
iris_upload_shader(ice, IRIS_CACHE_BLORP, key_size, key, kernel,
- prog_data, NULL, NULL, 0);
+ prog_data, NULL, NULL, 0, 0);
struct iris_bo *bo = iris_resource_bo(shader->assembly.res);
*kernel_out =