summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-01-11 04:48:02 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-01-11 04:48:02 +0000
commit3dddd004d3622b7e0d7bad5dea52d622657585e5 (patch)
tree75ec9e818f0012087eb174d8c3a4adae804bf9ff /Graphics/GraphicsEngine
parentappveyor: defining CMAKE_INSTALL_PREFIX in the command line (diff)
downloadDiligentCore-3dddd004d3622b7e0d7bad5dea52d622657585e5.tar.gz
DiligentCore-3dddd004d3622b7e0d7bad5dea52d622657585e5.zip
Fixed few issues with queries
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/Buffer.h1
-rw-r--r--Graphics/GraphicsEngine/interface/DeviceContext.h15
-rw-r--r--Graphics/GraphicsEngine/interface/Query.h6
3 files changed, 19 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngine/interface/Buffer.h b/Graphics/GraphicsEngine/interface/Buffer.h
index 9bd78ed2..92c1da89 100644
--- a/Graphics/GraphicsEngine/interface/Buffer.h
+++ b/Graphics/GraphicsEngine/interface/Buffer.h
@@ -111,7 +111,6 @@ struct BufferDesc : DeviceObjectAttribs
BufferDesc()noexcept{}
- explicit
BufferDesc(Uint32 _uiSizeInBytes,
BIND_FLAGS _BindFlags,
USAGE _Usage = BufferDesc{}.Usage,
diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h
index f08e2128..c3f7e407 100644
--- a/Graphics/GraphicsEngine/interface/DeviceContext.h
+++ b/Graphics/GraphicsEngine/interface/DeviceContext.h
@@ -1012,7 +1012,18 @@ public:
/// \param [in] pQuery - A pointer to a query object.
///
- /// \remarks Only immediate context can begin a query.
+ /// \remarks Only immediate contexts can begin a query.
+ ///
+ /// Vulkan requires that a query must either begin and end inside the same
+ /// subpass of a render pass instance, or must both begin and end outside of
+ /// a render pass instance. This means that an application must either begin
+ /// and end a query while preserving render targets, or begin it when no render
+ /// targets are bound to the context. In the latter case the engine will automaticaly
+ /// end the render pass, if needed, when the query is ended.
+ /// Also note that resource transitions must be performed outside of a render pass,
+ /// and may thus require ending current render pass.
+ /// To explicitly end current render pass, call
+ /// SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_NONE).
///
/// \warning OpenGL and Vulkan do not support nested queries of the same type.
virtual void BeginQuery(IQuery* pQuery) = 0;
@@ -1027,7 +1038,7 @@ public:
/// In Direct3D12 and Vulkan, queries (except for timestamp queries)
/// cannot span command list boundaries, so the engine will never flush
/// the context even if the number of commands exceeds the user-specified limit
- /// if there is an active query.
+ /// when there is an active query.
/// It is an error to explicitly flush the context while a query is active.
///
/// All queries must be ended when IDeviceContext::FinishFrame() is called.
diff --git a/Graphics/GraphicsEngine/interface/Query.h b/Graphics/GraphicsEngine/interface/Query.h
index 38056611..b71e4792 100644
--- a/Graphics/GraphicsEngine/interface/Query.h
+++ b/Graphics/GraphicsEngine/interface/Query.h
@@ -155,6 +155,12 @@ struct QueryDesc : DeviceObjectAttribs
{
/// Query type, see Diligent::QUERY_TYPE.
QUERY_TYPE Type = QUERY_TYPE_UNDEFINED;
+
+ QueryDesc() noexcept {};
+
+ explicit QueryDesc(QUERY_TYPE _Type) noexcept :
+ Type(_Type)
+ {}
};