From d43151318aad1c8dc4a44dcb35d3c984ef922960 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Sun, 9 Oct 2016 22:17:51 +0200 Subject: nvc0: fix valid range for shader buffers When offset != 0, the valid range was wrong because the second argument of util_range_add() is end, not size. Signed-off-by: Samuel Pitoiset Reviewed-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nvc0/nvc0_compute.c | 1 + src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c | 1 + src/gallium/drivers/nouveau/nvc0/nve4_compute.c | 1 + 3 files changed, 3 insertions(+) diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c index dc4d1b33874..11635c94658 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_compute.c @@ -288,6 +288,7 @@ nvc0_compute_validate_buffers(struct nvc0_context *nvc0) BCTX_REFN(nvc0->bufctx_cp, CP_BUF, res, RDWR); util_range_add(&res->valid_buffer_range, nvc0->buffers[s][i].buffer_offset, + nvc0->buffers[s][i].buffer_offset + nvc0->buffers[s][i].buffer_size); } else { PUSH_DATA (push, 0); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c index e69463e3c79..1d8ebe642bb 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c @@ -561,6 +561,7 @@ nvc0_validate_buffers(struct nvc0_context *nvc0) BCTX_REFN(nvc0->bufctx_3d, 3D_BUF, res, RDWR); util_range_add(&res->valid_buffer_range, nvc0->buffers[s][i].buffer_offset, + nvc0->buffers[s][i].buffer_offset + nvc0->buffers[s][i].buffer_size); } else { PUSH_DATA (push, 0); diff --git a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c index e85e9b48b7f..d661c000b32 100644 --- a/src/gallium/drivers/nouveau/nvc0/nve4_compute.c +++ b/src/gallium/drivers/nouveau/nvc0/nve4_compute.c @@ -444,6 +444,7 @@ nve4_compute_validate_buffers(struct nvc0_context *nvc0) BCTX_REFN(nvc0->bufctx_cp, CP_BUF, res, RDWR); util_range_add(&res->valid_buffer_range, nvc0->buffers[s][i].buffer_offset, + nvc0->buffers[s][i].buffer_offset + nvc0->buffers[s][i].buffer_size); } else { PUSH_DATA (push, 0); -- cgit v1.2.3