Mesa (master): swr: add streamout buffer offset into pBuffer pointer

Ilia Mirkin imirkin at kemper.freedesktop.org
Thu Dec 1 01:39:53 UTC 2016


Module: Mesa
Branch: master
Commit: ef59cb0820c5542af9d62721a51c7f7256155069
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ef59cb0820c5542af9d62721a51c7f7256155069

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sun Nov 27 01:15:03 2016 -0500

swr: add streamout buffer offset into pBuffer pointer

The buffer_size does not take the offset into account. Just add the
offset into the pointer which lines up the structures much better.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley at intel.com>

---

 src/gallium/drivers/swr/swr_state.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
index fc835dc..4475252 100644
--- a/src/gallium/drivers/swr/swr_state.cpp
+++ b/src/gallium/drivers/swr/swr_state.cpp
@@ -1488,10 +1488,11 @@ swr_update_derived(struct pipe_context *pipe,
             continue;
          buffer.enable = true;
          buffer.pBuffer =
-            (uint32_t *)swr_resource_data(ctx->so_targets[i]->buffer);
+            (uint32_t *)(swr_resource_data(ctx->so_targets[i]->buffer) +
+                         ctx->so_targets[i]->buffer_offset);
          buffer.bufferSize = ctx->so_targets[i]->buffer_size >> 2;
          buffer.pitch = stream_output->stride[i];
-         buffer.streamOffset = ctx->so_targets[i]->buffer_offset >> 2;
+         buffer.streamOffset = 0;
 
          SwrSetSoBuffers(ctx->swrContext, &buffer, i);
       }




More information about the mesa-commit mailing list