From 0d9bd79e8fd4d57e1a723ca6b6a45efec2b42872 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 10 Jun 2021 00:30:19 -0700 Subject: Support timestamp queries in `gfx`. (#1880) * Support timestamp queries in `gfx`. * Fix tab Co-authored-by: Yong He --- tools/gfx/debug-layer.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tools/gfx/debug-layer.h') diff --git a/tools/gfx/debug-layer.h b/tools/gfx/debug-layer.h index 89ee9d837..0fb8e681b 100644 --- a/tools/gfx/debug-layer.h +++ b/tools/gfx/debug-layer.h @@ -99,6 +99,20 @@ public: size_t size, ISlangBlob** outBlob) override; virtual SLANG_NO_THROW const DeviceInfo& SLANG_MCALL getDeviceInfo() const override; + virtual SLANG_NO_THROW Result SLANG_MCALL createQueryPool( + const IQueryPool::Desc& desc, + IQueryPool** outPool) override; +}; + +class DebugQueryPool : public DebugObject +{ +public: + SLANG_COM_OBJECT_IUNKNOWN_ALL; + + IQueryPool::Desc desc; +public: + IQueryPool* getInterface(const Slang::Guid& guid); + virtual SLANG_NO_THROW Result SLANG_MCALL getResult(SlangInt index, SlangInt count, uint64_t* data) override; }; class DebugBufferResource : public DebugObject @@ -227,6 +241,7 @@ public: virtual SLANG_NO_THROW Result SLANG_MCALL bindPipeline(IPipelineState* state, IShaderObject** outRootShaderObject) override; virtual SLANG_NO_THROW void SLANG_MCALL dispatchCompute(int x, int y, int z) override; + virtual SLANG_NO_THROW void SLANG_MCALL writeTimestamp(IQueryPool* pool, SlangInt index) override; public: DebugCommandBuffer* commandBuffer; @@ -264,6 +279,7 @@ public: virtual SLANG_NO_THROW void SLANG_MCALL drawIndexed(UInt indexCount, UInt startIndex = 0, UInt baseVertex = 0) override; virtual SLANG_NO_THROW void SLANG_MCALL setStencilReference(uint32_t referenceValue) override; + virtual SLANG_NO_THROW void SLANG_MCALL writeTimestamp(IQueryPool* pool, SlangInt index) override; public: DebugCommandBuffer* commandBuffer; @@ -289,6 +305,7 @@ public: size_t size) override; virtual SLANG_NO_THROW void SLANG_MCALL uploadBufferData(IBufferResource* dst, size_t offset, size_t size, void* data) override; + virtual SLANG_NO_THROW void SLANG_MCALL writeTimestamp(IQueryPool* pool, SlangInt index) override; public: DebugCommandBuffer* commandBuffer; -- cgit v1.2.3