summaryrefslogtreecommitdiffstats
path: root/tools/gfx/debug-layer/debug-swap-chain.h
diff options
context:
space:
mode:
authorlucy96chen <47800040+lucy96chen@users.noreply.github.com>2022-08-04 16:59:28 -0700
committerGitHub <noreply@github.com>2022-08-04 16:59:28 -0700
commit12a846e8facf090aaeb68fcabf55867f5eaed747 (patch)
treecc7c70c447200c1b45f20efc47e43e17828ec84d /tools/gfx/debug-layer/debug-swap-chain.h
parent11b29eff99910d55a54658b8a1d053cc4ec076fc (diff)
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 <yonghe@outlook.com>
Diffstat (limited to 'tools/gfx/debug-layer/debug-swap-chain.h')
-rw-r--r--tools/gfx/debug-layer/debug-swap-chain.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/gfx/debug-layer/debug-swap-chain.h b/tools/gfx/debug-layer/debug-swap-chain.h
new file mode 100644
index 000000000..83a467d65
--- /dev/null
+++ b/tools/gfx/debug-layer/debug-swap-chain.h
@@ -0,0 +1,38 @@
+// debug-swap-chain.h
+#pragma once
+#include "debug-base.h"
+
+namespace gfx
+{
+using namespace Slang;
+
+namespace debug
+{
+
+class DebugSwapchain : public DebugObject<ISwapchain>
+{
+public:
+ SLANG_COM_OBJECT_IUNKNOWN_ALL;
+
+public:
+ ISwapchain* getInterface(const Slang::Guid& guid);
+ virtual SLANG_NO_THROW const Desc& SLANG_MCALL getDesc() override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL
+ getImage(GfxIndex index, ITextureResource** outResource) override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL present() override;
+ virtual SLANG_NO_THROW int SLANG_MCALL acquireNextImage() override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL resize(GfxCount width, GfxCount height) override;
+ virtual SLANG_NO_THROW bool SLANG_MCALL isOccluded() override;
+ virtual SLANG_NO_THROW Result SLANG_MCALL setFullScreenMode(bool mode) override;
+
+public:
+ Slang::RefPtr<DebugCommandQueue> queue;
+ Desc desc;
+
+private:
+ Slang::List<Slang::RefPtr<DebugTextureResource>> m_images;
+ void maybeRebuildImageList();
+};
+
+} // namespace debug
+} // namespace gfx