From 8dfdda7a39191b1ad8c8edd9e3d2d51ae9eab237 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 14 Jul 2019 19:34:56 +0200 Subject: [PATCH] [dxvk] Get rid of validateCompute/GraphicsState After all this time we haven't found a single situation where we need more validation, so scrap it. Checking whether there is an active render pass was redundant anyway. --- src/dxvk/dxvk_context.cpp | 29 +++++++++-------------------- src/dxvk/dxvk_context.h | 3 --- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 311225e7c..df89da5e4 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -1432,7 +1432,7 @@ namespace dxvk { uint32_t z) { this->commitComputeState(); - if (this->validateComputeState()) { + if (m_cpActivePipeline) { this->commitComputeInitBarriers(); m_queryManager.beginQueries(m_cmd, @@ -1460,7 +1460,7 @@ namespace dxvk { if (m_execBarriers.isBufferDirty(bufferSlice, DxvkAccess::Read)) m_execBarriers.recordCommands(m_cmd); - if (this->validateComputeState()) { + if (m_cpActivePipeline) { this->commitComputeInitBarriers(); m_queryManager.beginQueries(m_cmd, @@ -1495,7 +1495,7 @@ namespace dxvk { uint32_t firstInstance) { this->commitGraphicsState(false); - if (this->validateGraphicsState()) { + if (m_gpActivePipeline) { m_cmd->cmdDraw( vertexCount, instanceCount, firstVertex, firstInstance); @@ -1513,7 +1513,7 @@ namespace dxvk { uint32_t stride) { this->commitGraphicsState(false); - if (this->validateGraphicsState()) { + if (m_gpActivePipeline) { auto descriptor = m_state.id.argBuffer.getDescriptor(); m_cmd->cmdDrawIndirect( @@ -1536,7 +1536,7 @@ namespace dxvk { uint32_t stride) { this->commitGraphicsState(false); - if (this->validateGraphicsState()) { + if (m_gpActivePipeline) { auto argDescriptor = m_state.id.argBuffer.getDescriptor(); auto cntDescriptor = m_state.id.cntBuffer.getDescriptor(); @@ -1563,7 +1563,7 @@ namespace dxvk { uint32_t firstInstance) { this->commitGraphicsState(true); - if (this->validateGraphicsState()) { + if (m_gpActivePipeline) { m_cmd->cmdDrawIndexed( indexCount, instanceCount, firstIndex, vertexOffset, @@ -1582,7 +1582,7 @@ namespace dxvk { uint32_t stride) { this->commitGraphicsState(true); - if (this->validateGraphicsState()) { + if (m_gpActivePipeline) { auto descriptor = m_state.id.argBuffer.getDescriptor(); m_cmd->cmdDrawIndexedIndirect( @@ -1605,7 +1605,7 @@ namespace dxvk { uint32_t stride) { this->commitGraphicsState(true); - if (this->validateGraphicsState()) { + if (m_gpActivePipeline) { auto argDescriptor = m_state.id.argBuffer.getDescriptor(); auto cntDescriptor = m_state.id.cntBuffer.getDescriptor(); @@ -1630,7 +1630,7 @@ namespace dxvk { uint32_t counterBias) { this->commitGraphicsState(false); - if (this->validateGraphicsState()) { + if (m_gpActivePipeline) { auto physSlice = counterBuffer.getSliceHandle(); m_cmd->cmdDrawIndirectVertexCount(1, 0, @@ -4017,17 +4017,6 @@ namespace dxvk { } - bool DxvkContext::validateComputeState() { - return m_cpActivePipeline != VK_NULL_HANDLE; - } - - - bool DxvkContext::validateGraphicsState() { - return m_gpActivePipeline != VK_NULL_HANDLE - && m_flags.test(DxvkContextFlag::GpRenderPassBound); - } - - void DxvkContext::commitComputeState() { if (m_flags.test(DxvkContextFlag::GpRenderPassBound)) this->spillRenderPass(); diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index b570026fe..d3d95b092 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -1154,9 +1154,6 @@ namespace dxvk { void updatePushConstants( VkPipelineBindPoint bindPoint); - bool validateComputeState(); - bool validateGraphicsState(); - void commitComputeState(); void commitGraphicsState(bool indexed);