Mesa (master): freedreno/ir3: add missing track_ubo_use()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 29 20:36:21 UTC 2020


Module: Mesa
Branch: master
Commit: ba9d502d246ec408761f6d44c6a3fde227ef87a6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba9d502d246ec408761f6d44c6a3fde227ef87a6

Author: Rob Clark <robdclark at chromium.org>
Date:   Wed Jul 29 08:37:29 2020 -0700

freedreno/ir3: add missing track_ubo_use()

We could lower *some* accesses to a UBO but not others.  In this case,
we would have a valid range, but would have skipped tracking that the
UBO is accessed as a UBO rather than push constants.

Fixes one issue with asphalt9, that was a result of having `ldc` without
having emit UBO state.

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3067
Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6117>

---

 src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
index 5e631e31d59..900768edb03 100644
--- a/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
+++ b/src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c
@@ -249,8 +249,10 @@ lower_ubo_load_to_uniform(nir_intrinsic_instr *instr, nir_builder *b,
 	/* We don't have a good way of determining the range of the dynamic
 	 * access in general, so for now just fall back to pulling.
 	 */
-	if (!nir_src_is_const(instr->src[1]) && !ubo_is_gl_uniforms(&range->ubo))
+	if (!nir_src_is_const(instr->src[1]) && !ubo_is_gl_uniforms(&range->ubo)) {
+		track_ubo_use(instr, b, num_ubos);
 		return false;
+	}
 
 	/* After gathering the UBO access ranges, we limit the total
 	 * upload. Don't lower if this load is outside the range.



More information about the mesa-commit mailing list