summaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-12-09 11:55:21 -0800
committerEric Anholt <[email protected]>2019-12-09 14:13:50 -0800
commit0470a03769715a3258c04e6b18848cef321bd213 (patch)
tree3ea1ea958e76193e9efaebcf75a2b8469fef4137 /src/freedreno
parent10da0a9d18a15044ca92553ed17adb7c445394c8 (diff)
freedreno: Track the set of UBOs to be uploaded in UBO analysis.
We were iterating over the entire 32-entry array each time, when we can just use a bitset to know that we're only uploading from the first entry normally. Knocks ir3_emit_user_consts down from ~.5% of CPU to .1% on WebGL fishtank. Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c3
-rw-r--r--src/freedreno/ir3/ir3_shader.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
index 720fd06a1d7..136ec9a65e4 100644
--- a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
+++ b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
@@ -246,6 +246,9 @@ ir3_nir_analyze_ubo_ranges(nir_shader *nir, struct ir3_shader *shader)
state->range[i].end = state->range[i].start + range_size;
}
offset += range_size;
+
+ if (state->range[i].start < state->range[i].end)
+ state->enabled |= 1 << i;
}
state->size = offset;
diff --git a/src/freedreno/ir3/ir3_shader.h b/src/freedreno/ir3/ir3_shader.h
index c829422ca4d..3a0447a1334 100644
--- a/src/freedreno/ir3/ir3_shader.h
+++ b/src/freedreno/ir3/ir3_shader.h
@@ -615,6 +615,7 @@ struct ir3_ubo_range {
struct ir3_ubo_analysis_state {
struct ir3_ubo_range range[IR3_MAX_CONSTANT_BUFFERS];
+ uint32_t enabled;
uint32_t size;
uint32_t lower_count;
uint32_t cmdstream_size; /* for per-gen backend to stash required cmdstream size */