diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 6a647075..729201bb 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -98,6 +98,16 @@ namespace dxvk { m_queries.disableQuery(m_cmd, query); query.query->endRecording(query.revision); } + + + void DxvkContext::beginQuery(const Rc& query) { + m_queryManager.enableQuery(m_cmd, query); + } + + + void DxvkContext::endQuery(const Rc& query) { + m_queryManager.disableQuery(m_cmd, query); + } void DxvkContext::bindRenderTargets( @@ -1116,11 +1126,17 @@ namespace dxvk { m_queries.beginQueries(m_cmd, VK_QUERY_TYPE_PIPELINE_STATISTICS); + m_queryManager.beginQueries(m_cmd, + VK_QUERY_TYPE_PIPELINE_STATISTICS); + m_cmd->cmdDispatch(x, y, z); m_queries.endQueries(m_cmd, VK_QUERY_TYPE_PIPELINE_STATISTICS); + m_queryManager.endQueries(m_cmd, + VK_QUERY_TYPE_PIPELINE_STATISTICS); + this->commitComputePostBarriers(); } @@ -1144,6 +1160,9 @@ namespace dxvk { m_queries.beginQueries(m_cmd, VK_QUERY_TYPE_PIPELINE_STATISTICS); + m_queryManager.beginQueries(m_cmd, + VK_QUERY_TYPE_PIPELINE_STATISTICS); + m_cmd->cmdDispatchIndirect( bufferSlice.handle, bufferSlice.offset); @@ -1151,6 +1170,9 @@ namespace dxvk { m_queries.endQueries(m_cmd, VK_QUERY_TYPE_PIPELINE_STATISTICS); + m_queryManager.endQueries(m_cmd, + VK_QUERY_TYPE_PIPELINE_STATISTICS); + this->commitComputePostBarriers(); m_barriers.accessBuffer(bufferSlice, @@ -1790,6 +1812,11 @@ namespace dxvk { query.query->endRecording(query.revision); } + + + void DxvkContext::writeTimestamp(const Rc& query) { + m_queryManager.writeTimestamp(m_cmd, query); + } void DxvkContext::clearImageViewFb( @@ -2439,6 +2466,9 @@ namespace dxvk { // Begin occlusion queries m_queries.beginQueries(m_cmd, VK_QUERY_TYPE_OCCLUSION); m_queries.beginQueries(m_cmd, VK_QUERY_TYPE_PIPELINE_STATISTICS); + + m_queryManager.beginQueries(m_cmd, VK_QUERY_TYPE_OCCLUSION); + m_queryManager.beginQueries(m_cmd, VK_QUERY_TYPE_PIPELINE_STATISTICS); } } @@ -2455,6 +2485,9 @@ namespace dxvk { m_queries.endQueries(m_cmd, VK_QUERY_TYPE_OCCLUSION); m_queries.endQueries(m_cmd, VK_QUERY_TYPE_PIPELINE_STATISTICS); + m_queryManager.endQueries(m_cmd, VK_QUERY_TYPE_OCCLUSION); + m_queryManager.endQueries(m_cmd, VK_QUERY_TYPE_PIPELINE_STATISTICS); + this->renderPassUnbindFramebuffer(); this->unbindGraphicsPipeline(); @@ -2644,6 +2677,9 @@ namespace dxvk { m_queries.beginQueries(m_cmd, VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT); + + m_queryManager.beginQueries(m_cmd, + VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT); } } @@ -2668,6 +2704,9 @@ namespace dxvk { m_queries.endQueries(m_cmd, VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT); + m_queryManager.endQueries(m_cmd, + VK_QUERY_TYPE_TRANSFORM_FEEDBACK_STREAM_EXT); + m_cmd->cmdEndTransformFeedback( 0, MaxNumXfbBuffers, ctrBuffers, ctrOffsets); diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index f6b4d1f1..f86b48b2 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -84,6 +84,9 @@ namespace dxvk { void beginQuery( const DxvkQueryRevision& query); + void beginQuery( + const Rc& query); + /** * \brief Ends generating query data * \param [in] query The query to end @@ -91,6 +94,9 @@ namespace dxvk { void endQuery( const DxvkQueryRevision& query); + void endQuery( + const Rc& query); + /** * \brief Sets render targets * @@ -789,6 +795,9 @@ namespace dxvk { void writeTimestamp( const DxvkQueryRevision& query); + void writeTimestamp( + const Rc& query); + private: const Rc m_device;