r600: fix constant buffer bounds.
authorDave Airlie <airlied@redhat.com>
Wed, 9 May 2018 22:17:09 +0000 (23:17 +0100)
committerDave Airlie <airlied@redhat.com>
Thu, 10 May 2018 01:14:32 +0000 (02:14 +0100)
commitce027ac5c798b39582288e5d7d9973b3cdda591e
tree078e91643e63e8735a002e2ad4441c4e26b91f99
parenta8a740f272a808a2694524b43fc33d2f0c0e3709
r600: fix constant buffer bounds.

If you have an indirect access to a constant buffer on r600/eg
use a vertex fetch in the shader. However apps have expected
behaviour on those out of bounds accessess (even if illegal).

If the constants were being uploaded as part of a larger
upload buffer, we'd set the range of allowed access to a lot
larger than required so apps would get values back from
other parts of the upload buffer instead of the expected out
of bounds access.

This fixes rendering bugs in Trine and Witcher 1, thanks
to iive for nagging me effectively until I figured it out :-)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91808
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_state.c