nvc0: fix valid range for shader buffers
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sun, 9 Oct 2016 20:17:51 +0000 (22:17 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 10 Oct 2016 19:32:16 +0000 (21:32 +0200)
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 <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_compute.c
src/gallium/drivers/nouveau/nvc0/nvc0_state_validate.c
src/gallium/drivers/nouveau/nvc0/nve4_compute.c

index dc4d1b338744c53300a4a2c0a92701cece7f64f9..11635c94658b01b08c3621e9a78e9cbe098c5431 100644 (file)
@@ -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);
index e69463e3c79581c245183ea8483deea48d2f3619..1d8ebe642bb07b4ff861985da50e3f3e54a2eb98 100644 (file)
@@ -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);
index e85e9b48b7f8ec1e88488627967374c71d04e6a7..d661c000b32a6734cb25da19072ae209af45fedf 100644 (file)
@@ -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);