From 12a846e8facf090aaeb68fcabf55867f5eaed747 Mon Sep 17 00:00:00 2001 From: lucy96chen <47800040+lucy96chen@users.noreply.github.com> Date: Thu, 4 Aug 2022 16:59:28 -0700 Subject: Split debug-layer into smaller files (#2344) * checkpoint commit * debug-layer split, does not compile * Almost compiles, rebasing before making any further changes * everything compiles and passes tests locally * Added tools/gfx/debug-layer to premake and ran premake Co-authored-by: Yong He --- tools/gfx/debug-layer/debug-command-buffer.h | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tools/gfx/debug-layer/debug-command-buffer.h (limited to 'tools/gfx/debug-layer/debug-command-buffer.h') diff --git a/tools/gfx/debug-layer/debug-command-buffer.h b/tools/gfx/debug-layer/debug-command-buffer.h new file mode 100644 index 000000000..d7633960b --- /dev/null +++ b/tools/gfx/debug-layer/debug-command-buffer.h @@ -0,0 +1,54 @@ +// debug-command-buffer.h +#pragma once +#include "debug-base.h" + +#include "debug-command-encoder.h" +#include "debug-shader-object.h" + +namespace gfx +{ +using namespace Slang; + +namespace debug +{ + +class DebugCommandBuffer : public DebugObject +{ +public: + SLANG_COM_OBJECT_IUNKNOWN_ALL; + +public: + DebugTransientResourceHeap* m_transientHeap; + +private: + DebugRenderCommandEncoder m_renderCommandEncoder; + DebugComputeCommandEncoder m_computeCommandEncoder; + DebugResourceCommandEncoder m_resourceCommandEncoder; + DebugRayTracingCommandEncoder m_rayTracingCommandEncoder; + +public: + DebugCommandBuffer(); + ICommandBuffer* getInterface(const Slang::Guid& guid); + virtual SLANG_NO_THROW void SLANG_MCALL encodeRenderCommands( + IRenderPassLayout* renderPass, + IFramebuffer* framebuffer, + IRenderCommandEncoder** outEncoder) override; + virtual SLANG_NO_THROW void SLANG_MCALL + encodeComputeCommands(IComputeCommandEncoder** outEncoder) override; + virtual SLANG_NO_THROW void SLANG_MCALL + encodeResourceCommands(IResourceCommandEncoder** outEncoder) override; + virtual SLANG_NO_THROW void SLANG_MCALL + encodeRayTracingCommands(IRayTracingCommandEncoder** outEncoder) override; + virtual SLANG_NO_THROW void SLANG_MCALL close() override; + virtual SLANG_NO_THROW Result SLANG_MCALL getNativeHandle(InteropHandle* outHandle) override; + +private: + void checkEncodersClosedBeforeNewEncoder(); + void checkCommandBufferOpenWhenCreatingEncoder(); +public: + DebugRootShaderObject rootObject; + bool isOpen = true; +}; + +} // namespace debug +} // namespace gfx -- cgit v1.2.3