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

[dxvk] Support new query implementation

This commit is contained in:
Philip Rebohle 2018-11-17 10:37:41 +01:00
parent a8144370c8
commit e5441e841f
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 48 additions and 0 deletions

View File

@ -98,6 +98,16 @@ namespace dxvk {
m_queries.disableQuery(m_cmd, query);
query.query->endRecording(query.revision);
}
void DxvkContext::beginQuery(const Rc<DxvkGpuQuery>& query) {
m_queryManager.enableQuery(m_cmd, query);
}
void DxvkContext::endQuery(const Rc<DxvkGpuQuery>& 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<DxvkGpuQuery>& 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);

View File

@ -84,6 +84,9 @@ namespace dxvk {
void beginQuery(
const DxvkQueryRevision& query);
void beginQuery(
const Rc<DxvkGpuQuery>& 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<DxvkGpuQuery>& query);
/**
* \brief Sets render targets
*
@ -789,6 +795,9 @@ namespace dxvk {
void writeTimestamp(
const DxvkQueryRevision& query);
void writeTimestamp(
const Rc<DxvkGpuQuery>& query);
private:
const Rc<DxvkDevice> m_device;