summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-12-03 04:08:06 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-12-03 04:08:06 +0000
commit57d21b1b34187df0ff1a3d31b85285fa2e21c9e5 (patch)
treee48bb2aa8af6f9c01044f7d4a5cf6b479cb067cb /Graphics/GraphicsEngine
parentFew minor updates to VariableSizeAllocationsManager (diff)
downloadDiligentCore-57d21b1b34187df0ff1a3d31b85285fa2e21c9e5.tar.gz
DiligentCore-57d21b1b34187df0ff1a3d31b85285fa2e21c9e5.zip
Added IDeviceContext::GetFrameNumber() method (API )
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/DeviceContextBase.hpp12
-rw-r--r--Graphics/GraphicsEngine/interface/APIInfo.h2
-rw-r--r--Graphics/GraphicsEngine/interface/DeviceContext.h7
3 files changed, 20 insertions, 1 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.hpp b/Graphics/GraphicsEngine/include/DeviceContextBase.hpp
index ac56eac9..dcc186b5 100644
--- a/Graphics/GraphicsEngine/include/DeviceContextBase.hpp
+++ b/Graphics/GraphicsEngine/include/DeviceContextBase.hpp
@@ -185,6 +185,11 @@ public:
ITexture* pDstTexture,
const ResolveTextureSubresourceAttribs& ResolveAttribs) override = 0;
+ virtual Uint64 DILIGENT_CALL_TYPE GetFrameNumber() const override final
+ {
+ return m_FrameNumber;
+ }
+
/// Returns currently bound pipeline state and blend factors
inline void GetPipelineState(IPipelineState** ppPSO, float* BlendFactors, Uint32& StencilRef);
@@ -239,6 +244,11 @@ protected:
bool EndQuery(IQuery* pQuery, int);
+ void EndFrame()
+ {
+ ++m_FrameNumber;
+ }
+
#ifdef DILIGENT_DEVELOPMENT
// clang-format off
bool DvpVerifyDrawArguments (const DrawAttribs& Attribs)const;
@@ -343,6 +353,8 @@ protected:
const bool m_bIsDeferred = false;
+ Uint64 m_FrameNumber = 0;
+
#ifdef DILIGENT_DEBUG
// std::unordered_map is unbelievably slow. Keeping track of mapped buffers
// in release builds is not feasible
diff --git a/Graphics/GraphicsEngine/interface/APIInfo.h b/Graphics/GraphicsEngine/interface/APIInfo.h
index 0ecbd92b..608c6fe3 100644
--- a/Graphics/GraphicsEngine/interface/APIInfo.h
+++ b/Graphics/GraphicsEngine/interface/APIInfo.h
@@ -30,7 +30,7 @@
/// \file
/// Diligent API information
-#define DILIGENT_API_VERSION 240078
+#define DILIGENT_API_VERSION 240079
#include "../../../Primitives/interface/BasicTypes.h"
diff --git a/Graphics/GraphicsEngine/interface/DeviceContext.h b/Graphics/GraphicsEngine/interface/DeviceContext.h
index 6320f947..122661f0 100644
--- a/Graphics/GraphicsEngine/interface/DeviceContext.h
+++ b/Graphics/GraphicsEngine/interface/DeviceContext.h
@@ -1448,6 +1448,12 @@ DILIGENT_BEGIN_INTERFACE(IDeviceContext, IObject)
VIRTUAL void METHOD(FinishFrame)(THIS) PURE;
+ /// Returns the current frame number.
+
+ /// \note The frame number is incremented every time FinishFrame() is called.
+ VIRTUAL Uint64 METHOD(GetFrameNumber)(THIS) CONST PURE;
+
+
/// Transitions resource states.
/// \param [in] BarrierCount - Number of barriers in pResourceBarriers array
@@ -1537,6 +1543,7 @@ DILIGENT_END_INTERFACE
# define IDeviceContext_UnmapTextureSubresource(This, ...) CALL_IFACE_METHOD(DeviceContext, UnmapTextureSubresource, This, __VA_ARGS__)
# define IDeviceContext_GenerateMips(This, ...) CALL_IFACE_METHOD(DeviceContext, GenerateMips, This, __VA_ARGS__)
# define IDeviceContext_FinishFrame(This) CALL_IFACE_METHOD(DeviceContext, FinishFrame, This)
+# define IDeviceContext_GetFrameNumber(This) CALL_IFACE_METHOD(DeviceContext, GetFrameNumber, This)
# define IDeviceContext_TransitionResourceStates(This, ...) CALL_IFACE_METHOD(DeviceContext, TransitionResourceStates, This, __VA_ARGS__)
# define IDeviceContext_ResolveTextureSubresource(This, ...) CALL_IFACE_METHOD(DeviceContext, ResolveTextureSubresource, This, __VA_ARGS__)