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@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
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);
}