diff options
author | Eric Anholt <[email protected]> | 2020-05-13 10:34:25 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-14 01:30:31 +0000 |
commit | 3111cee2f627d7e681e1695e1e4b1b5b126d5c7d (patch) | |
tree | f7f96c501f3923747813b1fe3f43a24fe5b119ba /src/gallium/drivers/freedreno | |
parent | 7336caa52d90dac3e7cc82259e223e933ca95ce0 (diff) |
freedreno: Fix attempts to push UBO contents past the constlen on pre-a6xx.
The binning variant likely won't have any UBO load code in it, so we were
writing past constlen (and sometimes asserting about it) when loading more
than one ubo block.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5027>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_const.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_const.h b/src/gallium/drivers/freedreno/ir3/ir3_const.h index 157bc273bde..a0076991b86 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_const.h +++ b/src/gallium/drivers/freedreno/ir3/ir3_const.h @@ -106,6 +106,12 @@ ir3_emit_user_consts(struct fd_screen *screen, const struct ir3_shader_variant * uint32_t size = state->range[i].end - state->range[i].start; uint32_t offset = cb->buffer_offset + state->range[i].start; + /* Pre-a6xx, we might have ranges enabled in the shader that aren't + * used in the binning variant. + */ + if (16 * v->constlen <= state->range[i].offset) + continue; + /* and even if the start of the const buffer is before * first_immediate, the end may not be: */ |