diff --git a/engine/include/XCEngine/RHI/D3D12/D3D12Device.h b/engine/include/XCEngine/RHI/D3D12/D3D12Device.h index 36bb381e..3b89f4c4 100644 --- a/engine/include/XCEngine/RHI/D3D12/D3D12Device.h +++ b/engine/include/XCEngine/RHI/D3D12/D3D12Device.h @@ -65,7 +65,7 @@ public: RHIBuffer* CreateBuffer(const BufferDesc& desc) override; RHITexture* CreateTexture(const TextureDesc& desc) override; - RHISwapChain* CreateSwapChain(const SwapChainDesc& desc) override; + RHISwapChain* CreateSwapChain(const SwapChainDesc& desc, RHICommandQueue* presentQueue) override; RHICommandList* CreateCommandList(const CommandListDesc& desc) override; RHICommandQueue* CreateCommandQueue(const CommandQueueDesc& desc) override; RHIShader* CreateShader(const ShaderCompileDesc& desc) override; @@ -114,8 +114,6 @@ private: ComPtr m_device; ComPtr m_factory; ComPtr m_adapter; - ComPtr m_commandQueue; - AdapterInfo m_adapterInfo; RHICapabilities m_capabilities; RHIDeviceInfo m_deviceInfo; diff --git a/engine/include/XCEngine/RHI/OpenGL/OpenGLDevice.h b/engine/include/XCEngine/RHI/OpenGL/OpenGLDevice.h index 1d0ba5e5..06d17742 100644 --- a/engine/include/XCEngine/RHI/OpenGL/OpenGLDevice.h +++ b/engine/include/XCEngine/RHI/OpenGL/OpenGLDevice.h @@ -36,7 +36,7 @@ public: RHIBuffer* CreateBuffer(const BufferDesc& desc) override; RHITexture* CreateTexture(const TextureDesc& desc) override; - RHISwapChain* CreateSwapChain(const SwapChainDesc& desc) override; + RHISwapChain* CreateSwapChain(const SwapChainDesc& desc, RHICommandQueue* presentQueue) override; RHICommandList* CreateCommandList(const CommandListDesc& desc) override; RHICommandQueue* CreateCommandQueue(const CommandQueueDesc& desc) override; RHIShader* CreateShader(const ShaderCompileDesc& desc) override; @@ -90,4 +90,4 @@ private: }; } // namespace RHI -} // namespace XCEngine \ No newline at end of file +} // namespace XCEngine diff --git a/engine/include/XCEngine/RHI/RHIDevice.h b/engine/include/XCEngine/RHI/RHIDevice.h index 7970e79d..65fa8503 100644 --- a/engine/include/XCEngine/RHI/RHIDevice.h +++ b/engine/include/XCEngine/RHI/RHIDevice.h @@ -34,7 +34,7 @@ public: virtual RHIBuffer* CreateBuffer(const BufferDesc& desc) = 0; virtual RHITexture* CreateTexture(const TextureDesc& desc) = 0; - virtual RHISwapChain* CreateSwapChain(const SwapChainDesc& desc) = 0; + virtual RHISwapChain* CreateSwapChain(const SwapChainDesc& desc, RHICommandQueue* presentQueue) = 0; virtual RHICommandList* CreateCommandList(const CommandListDesc& desc) = 0; virtual RHICommandQueue* CreateCommandQueue(const CommandQueueDesc& desc) = 0; virtual RHIShader* CreateShader(const ShaderCompileDesc& desc) = 0; @@ -69,4 +69,4 @@ public: }; } // namespace RHI -} // namespace XCEngine \ No newline at end of file +} // namespace XCEngine diff --git a/engine/src/RHI/D3D12/D3D12Device.cpp b/engine/src/RHI/D3D12/D3D12Device.cpp index 52c5045f..2b099044 100644 --- a/engine/src/RHI/D3D12/D3D12Device.cpp +++ b/engine/src/RHI/D3D12/D3D12Device.cpp @@ -78,24 +78,12 @@ bool D3D12Device::Initialize(const RHIDeviceDesc& desc) { return false; } - D3D12_COMMAND_QUEUE_DESC queueDesc = {}; - queueDesc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT; - queueDesc.Priority = 0; - queueDesc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE; - queueDesc.NodeMask = 0; - if (FAILED(m_device->CreateCommandQueue(&queueDesc, IID_PPV_ARGS(&m_commandQueue)))) { - return false; - } - QueryAdapterInfo(); m_initialized = true; return true; } void D3D12Device::Shutdown() { - if (m_commandQueue) { - m_commandQueue.Reset(); - } if (m_device) { m_device.Reset(); } @@ -398,10 +386,19 @@ RHIFence* D3D12Device::CreateFence(const FenceDesc& desc) { return nullptr; } -RHISwapChain* D3D12Device::CreateSwapChain(const SwapChainDesc& desc) { +RHISwapChain* D3D12Device::CreateSwapChain(const SwapChainDesc& desc, RHICommandQueue* presentQueue) { + if (presentQueue == nullptr) { + return nullptr; + } + + auto* nativeQueue = static_cast(presentQueue->GetNativeHandle()); + if (nativeQueue == nullptr) { + return nullptr; + } + auto* swapChain = new D3D12SwapChain(); HWND hwnd = static_cast(desc.windowHandle); - if (swapChain->Initialize(m_factory.Get(), m_commandQueue.Get(), hwnd, + if (swapChain->Initialize(m_factory.Get(), nativeQueue, hwnd, desc.width, desc.height, desc.bufferCount)) { return swapChain; } diff --git a/engine/src/RHI/OpenGL/OpenGLDevice.cpp b/engine/src/RHI/OpenGL/OpenGLDevice.cpp index 561310f9..b20a3585 100644 --- a/engine/src/RHI/OpenGL/OpenGLDevice.cpp +++ b/engine/src/RHI/OpenGL/OpenGLDevice.cpp @@ -334,13 +334,19 @@ RHITexture* OpenGLDevice::CreateTexture(const TextureDesc& desc) { return texture; } -RHISwapChain* OpenGLDevice::CreateSwapChain(const SwapChainDesc& desc) { +RHISwapChain* OpenGLDevice::CreateSwapChain(const SwapChainDesc& desc, RHICommandQueue* presentQueue) { + if (presentQueue == nullptr) { + return nullptr; + } + auto* swapChain = new OpenGLSwapChain(); HWND hwnd = static_cast(desc.windowHandle); - if (hwnd) { - swapChain->Initialize(this, hwnd, desc.width, desc.height); + if (hwnd && swapChain->Initialize(this, hwnd, desc.width, desc.height)) { + return swapChain; } - return swapChain; + + delete swapChain; + return nullptr; } RHICommandList* OpenGLDevice::CreateCommandList(const CommandListDesc& desc) { @@ -579,4 +585,4 @@ void* OpenGLDevice::GetNativeHandle() const { } } // namespace RHI -} // namespace XCEngine \ No newline at end of file +} // namespace XCEngine diff --git a/tests/RHI/integration/fixtures/RHIIntegrationFixture.cpp b/tests/RHI/integration/fixtures/RHIIntegrationFixture.cpp index 4385581d..e2a8fd3a 100644 --- a/tests/RHI/integration/fixtures/RHIIntegrationFixture.cpp +++ b/tests/RHI/integration/fixtures/RHIIntegrationFixture.cpp @@ -21,6 +21,29 @@ namespace XCEngine { namespace RHI { namespace Integration { +namespace { + +std::filesystem::path GetExecutableDirectory() { + char exePath[MAX_PATH] = {}; + DWORD length = GetModuleFileNameA(nullptr, exePath, MAX_PATH); + if (length == 0 || length >= MAX_PATH) { + return std::filesystem::current_path(); + } + + return std::filesystem::path(exePath).parent_path(); +} + +std::filesystem::path ResolveRuntimePath(const char* path) { + std::filesystem::path resolved(path); + if (resolved.is_absolute()) { + return resolved; + } + + return GetExecutableDirectory() / resolved; +} + +} // namespace + void Log(const char* format, ...) { char buffer[1024]; va_list args; @@ -71,19 +94,19 @@ void RHIIntegrationFixture::SetUp() { } ASSERT_TRUE(initResult); + CommandQueueDesc queueDesc = {}; + queueDesc.queueType = static_cast(CommandQueueType::Direct); + mCommandQueue = mDevice->CreateCommandQueue(queueDesc); + ASSERT_NE(mCommandQueue, nullptr); + SwapChainDesc swapDesc = {}; swapDesc.windowHandle = mWindow; swapDesc.width = width; swapDesc.height = height; swapDesc.bufferCount = 2; - mSwapChain = mDevice->CreateSwapChain(swapDesc); + mSwapChain = mDevice->CreateSwapChain(swapDesc, mCommandQueue); ASSERT_NE(mSwapChain, nullptr); - CommandQueueDesc queueDesc = {}; - queueDesc.queueType = static_cast(CommandQueueType::Direct); - mCommandQueue = mDevice->CreateCommandQueue(queueDesc); - ASSERT_NE(mCommandQueue, nullptr); - CommandListDesc cmdDesc = {}; cmdDesc.commandListType = static_cast(CommandQueueType::Direct); mCommandList = mDevice->CreateCommandList(cmdDesc); @@ -112,11 +135,12 @@ void RHIIntegrationFixture::SetUp() { mRTVs.push_back(rtv); } - D3D12Texture depthStencil; - depthStencil.InitializeDepthStencil(device, width, height); + mDepthStencilTexture = new D3D12Texture(); + ASSERT_NE(mDepthStencilTexture, nullptr); + ASSERT_TRUE(mDepthStencilTexture->InitializeDepthStencil(device, width, height)); D3D12_DEPTH_STENCIL_VIEW_DESC dsvDesc = D3D12ResourceView::CreateDepthStencilDesc(Format::D24_UNorm_S8_UInt, D3D12_DSV_DIMENSION_TEXTURE2D); auto* d3d12DSV = new D3D12ResourceView(); - d3d12DSV->InitializeAsDepthStencil(device, depthStencil.GetResource(), &dsvDesc, mDSVHeap, 0); + d3d12DSV->InitializeAsDepthStencil(device, mDepthStencilTexture->GetResource(), &dsvDesc, mDSVHeap, 0); mDSV = d3d12DSV; } @@ -178,6 +202,12 @@ void RHIIntegrationFixture::TearDown() { mDSV = nullptr; } + if (mDepthStencilTexture) { + mDepthStencilTexture->Shutdown(); + delete mDepthStencilTexture; + mDepthStencilTexture = nullptr; + } + if (mRTVHeap) { mRTVHeap->Shutdown(); delete mRTVHeap; @@ -255,8 +285,11 @@ bool RHIIntegrationFixture::TakeScreenshot(const char* filename) { (void*)mScreenshot, (void*)mDevice, (void*)mSwapChain); return false; } - Log("[TEST] TakeScreenshot: capturing to %s", filename); - bool result = mScreenshot->Capture(mDevice, mSwapChain, filename); + + const std::filesystem::path outputPath = ResolveRuntimePath(filename); + const std::string outputPathString = outputPath.string(); + Log("[TEST] TakeScreenshot: capturing to %s", outputPathString.c_str()); + bool result = mScreenshot->Capture(mDevice, mSwapChain, outputPathString.c_str()); Log("[TEST] TakeScreenshot: result=%d", result); return result; } @@ -264,9 +297,10 @@ bool RHIIntegrationFixture::TakeScreenshot(const char* filename) { bool RHIIntegrationFixture::CompareWithGoldenTemplate(const char* outputPpm, const char* gtPpm, float threshold) { namespace fs = std::filesystem; - fs::path exeDir = fs::current_path(); - fs::path outputPath = exeDir / outputPpm; - fs::path gtPath = exeDir / gtPpm; + fs::path exeDir = GetExecutableDirectory(); + fs::path outputPath = ResolveRuntimePath(outputPpm); + fs::path gtPath = ResolveRuntimePath(gtPpm); + fs::path compareScriptPath = exeDir / "compare_ppm.py"; if (!fs::exists(outputPath)) { std::cerr << "Output file not found: " << outputPath << std::endl; @@ -278,7 +312,12 @@ bool RHIIntegrationFixture::CompareWithGoldenTemplate(const char* outputPpm, con return false; } - std::string cmd = "python compare_ppm.py \"" + outputPath.string() + "\" \"" + gtPath.string() + "\" " + std::to_string(static_cast(threshold)); + if (!fs::exists(compareScriptPath)) { + std::cerr << "Compare script not found: " << compareScriptPath << std::endl; + return false; + } + + std::string cmd = "python \"" + compareScriptPath.string() + "\" \"" + outputPath.string() + "\" \"" + gtPath.string() + "\" " + std::to_string(static_cast(threshold)); int result = system(cmd.c_str()); return result == 0; } diff --git a/tests/RHI/integration/fixtures/RHIIntegrationFixture.h b/tests/RHI/integration/fixtures/RHIIntegrationFixture.h index 5e5a4e83..5ee8a9fc 100644 --- a/tests/RHI/integration/fixtures/RHIIntegrationFixture.h +++ b/tests/RHI/integration/fixtures/RHIIntegrationFixture.h @@ -66,6 +66,7 @@ private: #if defined(XCENGINE_SUPPORT_D3D12) D3D12DescriptorHeap* mRTVHeap = nullptr; D3D12DescriptorHeap* mDSVHeap = nullptr; + D3D12Texture* mDepthStencilTexture = nullptr; std::vector mRTVs; RHIResourceView* mDSV = nullptr; #endif @@ -73,4 +74,4 @@ private: } // namespace Integration } // namespace RHI -} // namespace XCEngine \ No newline at end of file +} // namespace XCEngine diff --git a/tests/RHI/integration/minimal/CMakeLists.txt b/tests/RHI/integration/minimal/CMakeLists.txt index 962e97d1..d3a1f563 100644 --- a/tests/RHI/integration/minimal/CMakeLists.txt +++ b/tests/RHI/integration/minimal/CMakeLists.txt @@ -46,14 +46,11 @@ add_custom_command(TARGET rhi_integration_minimal POST_BUILD $/ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/tests/RHI/D3D12/integration/minimal/GT.ppm - $/GT_D3D12.ppm - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_SOURCE_DIR}/tests/RHI/OpenGL/integration/minimal/GT.ppm - $/GT_OpenGL.ppm + $/GT.ppm COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ENGINE_ROOT_DIR}/third_party/renderdoc/renderdoc.dll $/ ) include(GoogleTest) -gtest_discover_tests(rhi_integration_minimal) \ No newline at end of file +gtest_discover_tests(rhi_integration_minimal) diff --git a/tests/RHI/integration/minimal/main.cpp b/tests/RHI/integration/minimal/main.cpp index f9ac3c62..3f8b17c3 100644 --- a/tests/RHI/integration/minimal/main.cpp +++ b/tests/RHI/integration/minimal/main.cpp @@ -19,6 +19,14 @@ protected: void RenderFrame() override; }; +const char* GetScreenshotFilename(RHIType type) { + return type == RHIType::D3D12 ? "minimal_d3d12.ppm" : "minimal_opengl.ppm"; +} + +int GetComparisonThreshold(RHIType type) { + return type == RHIType::OpenGL ? 5 : 0; +} + void MinimalTest::RenderFrame() { RHICommandList* cmdList = GetCommandList(); RHICommandQueue* cmdQueue = GetCommandQueue(); @@ -55,6 +63,8 @@ TEST_P(MinimalTest, RenderClear) { RHICommandQueue* cmdQueue = GetCommandQueue(); RHISwapChain* swapChain = GetSwapChain(); const int targetFrameCount = 30; + const char* screenshotFilename = GetScreenshotFilename(GetBackendType()); + const int comparisonThreshold = GetComparisonThreshold(GetBackendType()); for (int frameCount = 0; frameCount <= targetFrameCount; ++frameCount) { if (frameCount > 0) { @@ -67,8 +77,10 @@ TEST_P(MinimalTest, RenderClear) { if (frameCount >= targetFrameCount) { cmdQueue->WaitForIdle(); - Log("[TEST] MainLoop: frame %d reached, test complete", frameCount); - // Screenshot temporarily disabled due to device state issue + Log("[TEST] MainLoop: frame %d reached, capturing %s", frameCount, screenshotFilename); + ASSERT_TRUE(TakeScreenshot(screenshotFilename)); + ASSERT_TRUE(CompareWithGoldenTemplate(screenshotFilename, "GT.ppm", static_cast(comparisonThreshold))); + Log("[TEST] MainLoop: frame %d compare passed", frameCount); break; } diff --git a/tests/RHI/unit/fixtures/RHITestFixture.cpp b/tests/RHI/unit/fixtures/RHITestFixture.cpp index dfd40053..582974c0 100644 --- a/tests/RHI/unit/fixtures/RHITestFixture.cpp +++ b/tests/RHI/unit/fixtures/RHITestFixture.cpp @@ -41,25 +41,27 @@ void RHITestFixture::SetUp() { desc.enableDebugLayer = false; initResult = mDevice->Initialize(desc); ASSERT_TRUE(initResult); + } else if (GetParam() == RHIType::OpenGL) { + auto* oglDevice = static_cast(mDevice); + initResult = oglDevice->InitializeWithExistingWindow(mWindow); + ASSERT_TRUE(initResult); + } - CommandQueueDesc queueDesc = {}; - queueDesc.queueType = static_cast(CommandQueueType::Direct); - queueDesc.priority = 0; - queueDesc.nodeMask = 0; - queueDesc.flags = 0; - mCommandQueue = mDevice->CreateCommandQueue(queueDesc); - ASSERT_NE(mCommandQueue, nullptr); + CommandQueueDesc queueDesc = {}; + queueDesc.queueType = static_cast(CommandQueueType::Direct); + queueDesc.priority = 0; + queueDesc.nodeMask = 0; + queueDesc.flags = 0; + mCommandQueue = mDevice->CreateCommandQueue(queueDesc); + ASSERT_NE(mCommandQueue, nullptr); + if (GetParam() == RHIType::D3D12) { FenceDesc fenceDesc = {}; fenceDesc.initialValue = 0; fenceDesc.flags = 0; mFence = mDevice->CreateFence(fenceDesc); ASSERT_NE(mFence, nullptr); mFenceValue = 0; - } else if (GetParam() == RHIType::OpenGL) { - auto* oglDevice = static_cast(mDevice); - initResult = oglDevice->InitializeWithExistingWindow(mWindow); - ASSERT_TRUE(initResult); } } diff --git a/tests/RHI/unit/fixtures/RHITestFixture.h b/tests/RHI/unit/fixtures/RHITestFixture.h index 5dfe1360..ab02eccf 100644 --- a/tests/RHI/unit/fixtures/RHITestFixture.h +++ b/tests/RHI/unit/fixtures/RHITestFixture.h @@ -31,6 +31,7 @@ protected: void WaitForGPU(); RHIDevice* GetDevice() { return mDevice; } + RHICommandQueue* GetCommandQueue() { return mCommandQueue; } RHIType GetBackendType() const { return GetParam(); } HWND GetWindowHandle() const { return mWindow; } diff --git a/tests/RHI/unit/test_screenshot.cpp b/tests/RHI/unit/test_screenshot.cpp index 6bc94a27..949944db 100644 --- a/tests/RHI/unit/test_screenshot.cpp +++ b/tests/RHI/unit/test_screenshot.cpp @@ -20,7 +20,7 @@ TEST_P(RHITestFixture, Screenshot_Capture_Basic) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); if (swapChain == nullptr) { return; } @@ -44,7 +44,7 @@ TEST_P(RHITestFixture, Screenshot_Capture_WithPresent) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); if (swapChain == nullptr) { return; } @@ -60,4 +60,4 @@ TEST_P(RHITestFixture, Screenshot_Capture_WithPresent) { swapChain->Shutdown(); delete swapChain; -} \ No newline at end of file +} diff --git a/tests/RHI/unit/test_swap_chain.cpp b/tests/RHI/unit/test_swap_chain.cpp index d493647d..6127763f 100644 --- a/tests/RHI/unit/test_swap_chain.cpp +++ b/tests/RHI/unit/test_swap_chain.cpp @@ -11,7 +11,7 @@ TEST_P(RHITestFixture, SwapChain_Create) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); swapChain->Shutdown(); @@ -26,7 +26,7 @@ TEST_P(RHITestFixture, SwapChain_GetCurrentBackBufferIndex) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); uint32_t index = swapChain->GetCurrentBackBufferIndex(); @@ -44,7 +44,7 @@ TEST_P(RHITestFixture, SwapChain_GetCurrentBackBuffer) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); RHITexture* backBuffer = swapChain->GetCurrentBackBuffer(); @@ -62,7 +62,7 @@ TEST_P(RHITestFixture, SwapChain_Resize) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); swapChain->Resize(1024, 768); @@ -79,7 +79,7 @@ TEST_P(RHITestFixture, SwapChain_Present_Basic) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); swapChain->Present(0, 0); @@ -96,7 +96,7 @@ TEST_P(RHITestFixture, SwapChain_Present_WithSyncInterval) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); swapChain->Present(1, 0); @@ -114,7 +114,7 @@ TEST_P(RHITestFixture, SwapChain_Present_Multiple) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); for (int i = 0; i < 10; ++i) { @@ -133,7 +133,7 @@ TEST_P(RHITestFixture, SwapChain_GetNativeHandle) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); void* handle = swapChain->GetNativeHandle(); @@ -151,7 +151,7 @@ TEST_P(RHITestFixture, SwapChain_Resize_WithPresent) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); swapChain->Present(0, 0); @@ -170,7 +170,7 @@ TEST_P(RHITestFixture, SwapChain_TripleBuffering) { desc.bufferCount = 3; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); uint32_t index0 = swapChain->GetCurrentBackBufferIndex(); @@ -193,7 +193,7 @@ TEST_P(RHITestFixture, SwapChain_DoubleShutdown) { desc.bufferCount = 2; desc.format = Format::R8G8B8A8_UNorm; - RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc); + RHISwapChain* swapChain = GetDevice()->CreateSwapChain(desc, GetCommandQueue()); ASSERT_NE(swapChain, nullptr); swapChain->Shutdown();