summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-11-27 01:15:03 -0500
committerIlia Mirkin <[email protected]>2016-11-30 20:36:03 -0500
commitef59cb0820c5542af9d62721a51c7f7256155069 (patch)
tree63a65c5d5afaca5bf19a8d125bf2857ffc4c62f4 /src/gallium/drivers
parent3d837a8871e83e86da7e76ef855e8a877e8c971c (diff)
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 <[email protected]> Reviewed-by: Tim Rowley <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/swr/swr_state.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
index fc835dc1867..4475252e50e 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);
}