freedreno: Clamp UBO uploads to the constlen decided by the shader.
authorRob Clark <robdclark@chromium.org>
Sun, 23 Jun 2019 19:52:05 +0000 (12:52 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 24 Jun 2019 21:23:07 +0000 (14:23 -0700)
commit572c76fd882601a189496a1f8bd3a09db1621337
treee67719c16094784b3080338f6e30f3374effc181
parentc1ca1384751a7ef2770a8e4a5f835ad1ca423328
freedreno: Clamp UBO uploads to the constlen decided by the shader.

If the NIR-level analysis decided to move UBO loads to the constant
file, but the backend decided not to load those constants, we could
upload past the end of constlen.  This is particularly relevant for
pre-a6xx, where we emit a different constlen between bin and render
variants.

(Fix by Rob, commit message by anholt)

Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/drivers/freedreno/ir3/ir3_gallium.c