summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-01-06 04:32:20 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-01-06 04:32:20 +0000
commitcb837597c352273e506c816a340dc54520be45f9 (patch)
tree2928c26a720acab4a481fd642c2c7e59c9fb0ed4 /Graphics/GraphicsEngine
parentVulkan utilities: added query manipulation functions (diff)
downloadDiligentCore-cb837597c352273e506c816a340dc54520be45f9.tar.gz
DiligentCore-cb837597c352273e506c816a340dc54520be45f9.zip
Implemented queries in Vulkan (closed https://github.com/DiligentGraphics/DiligentCore/issues/25)
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/DeviceContextBase.h6
-rw-r--r--Graphics/GraphicsEngine/interface/DeviceContext.h2
-rw-r--r--Graphics/GraphicsEngine/interface/GraphicsTypes.h12
3 files changed, 18 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h
index f7b94118..02e564af 100644
--- a/Graphics/GraphicsEngine/include/DeviceContextBase.h
+++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h
@@ -910,6 +910,12 @@ inline bool DeviceContextBase<BaseInterface, ImplementationTraits>::BeginQuery(I
return false;
}
+ if (pQuery->GetDesc().Type == QUERY_TYPE_TIMESTAMP)
+ {
+ LOG_ERROR_MESSAGE("BeginQuery() is disabled for timestamp queries. Call EndQuery() to set the timestamp.");
+ return false;
+ }
+
if (!ValidatedCast<QueryImplType>(pQuery)->OnBeginQuery(this))
return false;
diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h
index 628f88ea..f08e2128 100644
--- a/Graphics/GraphicsEngine/interface/DeviceContext.h
+++ b/Graphics/GraphicsEngine/interface/DeviceContext.h
@@ -1014,7 +1014,7 @@ public:
///
/// \remarks Only immediate context can begin a query.
///
- /// \warning OpenGL does not support nested queries of the same type.
+ /// \warning OpenGL and Vulkan do not support nested queries of the same type.
virtual void BeginQuery(IQuery* pQuery) = 0;
diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
index b5ce083c..561b8fd8 100644
--- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h
+++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
@@ -1462,7 +1462,7 @@ namespace Diligent
/// global dynamic heap manager to avoid page creation at run time.
Uint32 NumDynamicHeapPagesToReserve = 1;
- /// The size of query pool for each query type.
+ /// Query pool size for each query type.
Uint32 QueryPoolSizes[5] =
{
0, // Ignored
@@ -1594,6 +1594,16 @@ namespace Diligent
/// Size of the memory chunk suballocated by immediate/deferred context from
/// the global dynamic heap to perform lock-free dynamic suballocations
Uint32 DynamicHeapPageSize = 256 << 10;
+
+ /// Query pool size for each query type.
+ Uint32 QueryPoolSizes[5] =
+ {
+ 0, // Ignored
+ 128, // QUERY_TYPE_OCCLUSION
+ 128, // QUERY_TYPE_BINARY_OCCLUSION
+ 512, // QUERY_TYPE_TIMESTAMP
+ 128 // QUERY_TYPE_PIPELINE_STATISTICS
+ };
};