From c6bfb3bdcb4215eba7061090c25fa7604a1a0d44 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 31 May 2018 08:35:34 -0700 Subject: Updated back buffer format to match the one from the swap chain in the tests --- Tests/TestApp/src/TestComputeShaders.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Tests/TestApp/src/TestComputeShaders.cpp') diff --git a/Tests/TestApp/src/TestComputeShaders.cpp b/Tests/TestApp/src/TestComputeShaders.cpp index 9b3f392..9724b04 100644 --- a/Tests/TestApp/src/TestComputeShaders.cpp +++ b/Tests/TestApp/src/TestComputeShaders.cpp @@ -36,7 +36,7 @@ TestComputeShaders::TestComputeShaders() : { } -void TestComputeShaders::Init( IRenderDevice *pDevice, IDeviceContext *pContext ) +void TestComputeShaders::Init( IRenderDevice *pDevice, IDeviceContext *pContext, ISwapChain *pSwapChain ) { if(!pDevice->GetDeviceCaps().bComputeShadersSupported) { @@ -46,8 +46,10 @@ void TestComputeShaders::Init( IRenderDevice *pDevice, IDeviceContext *pContext m_pRenderDevice = pDevice; m_pDeviceContext = pContext; - m_pRenderScript = CreateRenderScriptFromFile( "TestComputeShaders.lua", pDevice, pContext, []( ScriptParser *pScriptParser ) + const auto* BackBufferFmt = pDevice->GetTextureFormatInfo(pSwapChain->GetDesc().ColorBufferFormat).Name; + m_pRenderScript = CreateRenderScriptFromFile( "TestComputeShaders.lua", pDevice, pContext, [BackBufferFmt]( ScriptParser *pScriptParser ) { + pScriptParser->SetGlobalVariable( "extBackBufferFormat", BackBufferFmt ); } ); } -- cgit v1.2.3