summaryrefslogtreecommitdiffstats
path: root/tools/gfx/d3d12/render-d3d12.cpp
diff options
context:
space:
mode:
authorlucy96chen <47800040+lucy96chen@users.noreply.github.com>2022-02-25 02:58:42 -0800
committerGitHub <noreply@github.com>2022-02-25 02:58:42 -0800
commit8990d270e3a0c01b1f7abbf4f79556c5ef82a096 (patch)
tree5056131c8b0f5e838447120ae9b44f602e06e64b /tools/gfx/d3d12/render-d3d12.cpp
parent97ee917b5be4544db0f29eeb095eb55e360619c6 (diff)
Add isOccluded() and setFullScreenMode() to ISwapchain (#2145)
* Added isOccluded() and setFullScreenMode() to ISwapchain and provided implementations for D3D12 (all others currently return false) * Removed isWindowOccluded variable and directly return the result of m_swapchain3->Present * Restart CI
Diffstat (limited to 'tools/gfx/d3d12/render-d3d12.cpp')
-rw-r--r--tools/gfx/d3d12/render-d3d12.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/gfx/d3d12/render-d3d12.cpp b/tools/gfx/d3d12/render-d3d12.cpp
index 826475f43..c45ba2751 100644
--- a/tools/gfx/d3d12/render-d3d12.cpp
+++ b/tools/gfx/d3d12/render-d3d12.cpp
@@ -5436,6 +5436,14 @@ public:
return SLANG_OK;
}
+ virtual SLANG_NO_THROW bool SLANG_MCALL isOccluded() override
+ {
+ return (m_swapChain3->Present(0, DXGI_PRESENT_TEST) == DXGI_STATUS_OCCLUDED);
+ }
+ virtual SLANG_NO_THROW Result SLANG_MCALL setFullScreenMode(bool mode) override
+ {
+ return m_swapChain3->SetFullscreenState(mode, nullptr);
+ }
};
static PROC loadProc(HMODULE module, char const* name);