mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-12 13:08:50 +01:00
[dxvk] Fix xfb counter buffer draw tracking
This commit is contained in:
parent
915244c00c
commit
c2cd129b89
@ -4832,13 +4832,14 @@ namespace dxvk {
|
||||
VkDeviceSize ctrOffsets[MaxNumXfbBuffers];
|
||||
|
||||
for (uint32_t i = 0; i < MaxNumXfbBuffers; i++) {
|
||||
auto physSlice = m_state.xfb.counters[i].getSliceHandle();
|
||||
m_state.xfb.activeCounters[i] = m_state.xfb.counters[i];
|
||||
auto physSlice = m_state.xfb.activeCounters[i].getSliceHandle();
|
||||
|
||||
ctrBuffers[i] = physSlice.handle;
|
||||
ctrOffsets[i] = physSlice.offset;
|
||||
|
||||
if (physSlice.handle != VK_NULL_HANDLE)
|
||||
m_cmd->trackResource<DxvkAccess::Read>(m_state.xfb.counters[i].buffer());
|
||||
m_cmd->trackResource<DxvkAccess::Read>(m_state.xfb.activeCounters[i].buffer());
|
||||
}
|
||||
|
||||
m_cmd->cmdBeginTransformFeedback(
|
||||
@ -4858,13 +4859,15 @@ namespace dxvk {
|
||||
VkDeviceSize ctrOffsets[MaxNumXfbBuffers];
|
||||
|
||||
for (uint32_t i = 0; i < MaxNumXfbBuffers; i++) {
|
||||
auto physSlice = m_state.xfb.counters[i].getSliceHandle();
|
||||
auto physSlice = m_state.xfb.activeCounters[i].getSliceHandle();
|
||||
|
||||
ctrBuffers[i] = physSlice.handle;
|
||||
ctrOffsets[i] = physSlice.offset;
|
||||
|
||||
if (physSlice.handle != VK_NULL_HANDLE)
|
||||
m_cmd->trackResource<DxvkAccess::Write>(m_state.xfb.counters[i].buffer());
|
||||
m_cmd->trackResource<DxvkAccess::Write>(m_state.xfb.activeCounters[i].buffer());
|
||||
|
||||
m_state.xfb.activeCounters[i] = DxvkBufferSlice();
|
||||
}
|
||||
|
||||
m_queryManager.endQueries(m_cmd,
|
||||
@ -6073,7 +6076,7 @@ namespace dxvk {
|
||||
&& m_state.gp.flags.test(DxvkGraphicsPipelineFlag::HasTransformFeedback)) {
|
||||
for (uint32_t i = 0; i < MaxNumXfbBuffers && !requiresBarrier; i++) {
|
||||
const auto& xfbBufferSlice = m_state.xfb.buffers[i];
|
||||
const auto& xfbCounterSlice = m_state.xfb.counters[i];
|
||||
const auto& xfbCounterSlice = m_state.xfb.activeCounters[i];
|
||||
|
||||
if (xfbBufferSlice.length()) {
|
||||
requiresBarrier = this->checkBufferBarrier<DoEmit>(xfbBufferSlice,
|
||||
|
@ -123,6 +123,7 @@ namespace dxvk {
|
||||
struct DxvkXfbState {
|
||||
std::array<DxvkBufferSlice, MaxNumXfbBuffers> buffers;
|
||||
std::array<DxvkBufferSlice, MaxNumXfbBuffers> counters;
|
||||
std::array<DxvkBufferSlice, MaxNumXfbBuffers> activeCounters;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user