<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Reviewed-by: Tim Rowley <<a href="mailto:timothy.o.rowley@intel.com" class="">timothy.o.rowley@intel.com</a>>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Nov 29, 2016, at 8:23 PM, Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">The buffer_size does not take the offset into account. Just add the<br class="">
offset into the pointer which lines up the structures much better.<br class="">
<br class="">
Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu" class="">imirkin@alum.mit.edu</a>><br class="">
---<br class="">
<br class="">
This doesn't really fix anything right now, but logically the streamOffset<br class="">
is incremented on each draw, and is optionally written back out as a watermark<br class="">
indicator (for pausing/resuming streams). So it should be relative to the<br class="">
logical start of the buffer.<br class="">
<br class="">
src/gallium/drivers/swr/swr_state.cpp | 5 +++--<br class="">
1 file changed, 3 insertions(+), 2 deletions(-)<br class="">
<br class="">
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp<br class="">
index fc835dc..4475252 100644<br class="">
--- a/src/gallium/drivers/swr/swr_state.cpp<br class="">
+++ b/src/gallium/drivers/swr/swr_state.cpp<br class="">
@@ -1488,10 +1488,11 @@ swr_update_derived(struct pipe_context *pipe,<br class="">
            continue;<br class="">
         buffer.enable = true;<br class="">
         buffer.pBuffer =<br class="">
-            (uint32_t *)swr_resource_data(ctx->so_targets[i]->buffer);<br class="">
+            (uint32_t *)(swr_resource_data(ctx->so_targets[i]->buffer) +<br class="">
+                         ctx->so_targets[i]->buffer_offset);<br class="">
         buffer.bufferSize = ctx->so_targets[i]->buffer_size >> 2;<br class="">
         buffer.pitch = stream_output->stride[i];<br class="">
-         buffer.streamOffset = ctx->so_targets[i]->buffer_offset >> 2;<br class="">
+         buffer.streamOffset = 0;<br class="">
<br class="">
         SwrSetSoBuffers(ctx->swrContext, &buffer, i);<br class="">
      }<br class="">
-- <br class="">
2.7.3<br class="">
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>