aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno/ir3/ir3_nir.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-06-05 15:39:22 -0700
committerEric Anholt <[email protected]>2019-06-21 17:14:43 -0700
commit4449572c47c04e3974a30677259ff791b351a7ca (patch)
tree58e3a0f6c736d1e6bede17ce1c0b47792bfb53ab /src/freedreno/ir3/ir3_nir.c
parent01d0bad9efa1973293920f3c2bae78fca807f204 (diff)
freedreno: Only upload UBO pointers for UBOs that haven't been lowered.
total constlen in shared programs: 2485933 -> 2462236 (-0.95%) Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/freedreno/ir3/ir3_nir.c')
-rw-r--r--src/freedreno/ir3/ir3_nir.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3_nir.c b/src/freedreno/ir3/ir3_nir.c
index cb97a2202ed..1ef47aa3e06 100644
--- a/src/freedreno/ir3/ir3_nir.c
+++ b/src/freedreno/ir3/ir3_nir.c
@@ -328,6 +328,13 @@ ir3_nir_scan_driver_consts(nir_shader *shader,
layout->image_dims.count;
layout->image_dims.count += 3; /* three const per */
break;
+ case nir_intrinsic_load_ubo:
+ if (nir_src_is_const(intr->src[0])) {
+ layout->num_ubos = MAX2(layout->num_ubos,
+ nir_src_as_uint(intr->src[0]) + 1);
+ } else {
+ layout->num_ubos = shader->info.num_ubos;
+ }
default:
break;
}
@@ -347,7 +354,6 @@ ir3_setup_const_state(struct ir3_shader *shader, nir_shader *nir)
ir3_nir_scan_driver_consts(nir, const_state);
const_state->num_uniforms = nir->num_uniforms;
- const_state->num_ubos = nir->info.num_ubos;
debug_assert((shader->ubo_state.size % 16) == 0);
unsigned constoff = align(shader->ubo_state.size / 16, 4);