1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[dxvk] Use DxvkBufferSliceHandle for transform feedback

This commit is contained in:
Philip Rebohle 2019-01-09 15:13:04 +01:00
parent 17398e47bd
commit 004db3677b
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -1212,12 +1212,13 @@ namespace dxvk {
this->commitGraphicsState(); this->commitGraphicsState();
if (this->validateGraphicsState()) { if (this->validateGraphicsState()) {
auto physicalSlice = counterBuffer.physicalSlice(); auto physSlice = counterBuffer.getSliceHandle();
m_cmd->cmdDrawIndirectVertexCount(1, 0, m_cmd->cmdDrawIndirectVertexCount(1, 0,
physicalSlice.handle(), physSlice.handle,
physicalSlice.offset(), physSlice.offset,
counterBias, counterDivisor); counterBias,
counterDivisor);
this->commitGraphicsPostBarriers(); this->commitGraphicsPostBarriers();
} }
@ -2457,13 +2458,13 @@ namespace dxvk {
VkDeviceSize ctrOffsets[MaxNumXfbBuffers]; VkDeviceSize ctrOffsets[MaxNumXfbBuffers];
for (uint32_t i = 0; i < MaxNumXfbBuffers; i++) { for (uint32_t i = 0; i < MaxNumXfbBuffers; i++) {
auto physSlice = m_state.xfb.counters[i].physicalSlice(); auto physSlice = m_state.xfb.counters[i].getSliceHandle();
ctrBuffers[i] = physSlice.handle(); ctrBuffers[i] = physSlice.handle;
ctrOffsets[i] = physSlice.offset(); ctrOffsets[i] = physSlice.offset;
if (physSlice.handle() != VK_NULL_HANDLE) if (physSlice.handle != VK_NULL_HANDLE)
m_cmd->trackResource(physSlice.resource()); m_cmd->trackResource(m_state.xfb.counters[i].resource());
} }
m_cmd->cmdBeginTransformFeedback( m_cmd->cmdBeginTransformFeedback(
@ -2483,13 +2484,13 @@ namespace dxvk {
VkDeviceSize ctrOffsets[MaxNumXfbBuffers]; VkDeviceSize ctrOffsets[MaxNumXfbBuffers];
for (uint32_t i = 0; i < MaxNumXfbBuffers; i++) { for (uint32_t i = 0; i < MaxNumXfbBuffers; i++) {
auto physSlice = m_state.xfb.counters[i].physicalSlice(); auto physSlice = m_state.xfb.counters[i].getSliceHandle();
ctrBuffers[i] = physSlice.handle(); ctrBuffers[i] = physSlice.handle;
ctrOffsets[i] = physSlice.offset(); ctrOffsets[i] = physSlice.offset;
if (physSlice.handle() != VK_NULL_HANDLE) if (physSlice.handle != VK_NULL_HANDLE)
m_cmd->trackResource(physSlice.resource()); m_cmd->trackResource(m_state.xfb.counters[i].resource());
} }
m_queries.endQueries(m_cmd, m_queries.endQueries(m_cmd,
@ -2961,20 +2962,20 @@ namespace dxvk {
VkDeviceSize xfbLengths[MaxNumXfbBuffers]; VkDeviceSize xfbLengths[MaxNumXfbBuffers];
for (size_t i = 0; i < MaxNumXfbBuffers; i++) { for (size_t i = 0; i < MaxNumXfbBuffers; i++) {
auto physSlice = m_state.xfb.buffers[i].physicalSlice(); auto physSlice = m_state.xfb.buffers[i].getSliceHandle();
xfbBuffers[i] = physSlice.handle(); xfbBuffers[i] = physSlice.handle;
xfbOffsets[i] = physSlice.offset(); xfbOffsets[i] = physSlice.offset;
xfbLengths[i] = physSlice.length(); xfbLengths[i] = physSlice.length;
if (physSlice.handle() == VK_NULL_HANDLE) if (physSlice.handle == VK_NULL_HANDLE)
xfbBuffers[i] = m_device->dummyBufferHandle(); xfbBuffers[i] = m_device->dummyBufferHandle();
if (physSlice.handle() != VK_NULL_HANDLE) { if (physSlice.handle != VK_NULL_HANDLE) {
auto buffer = m_state.xfb.buffers[i].buffer(); auto buffer = m_state.xfb.buffers[i].buffer();
buffer->setXfbVertexStride(gsOptions.xfbStrides[i]); buffer->setXfbVertexStride(gsOptions.xfbStrides[i]);
m_cmd->trackResource(physSlice.resource()); m_cmd->trackResource(buffer->resource());
} }
} }