diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-05-31 15:35:34 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-05-31 15:35:34 +0000 |
| commit | c6bfb3bdcb4215eba7061090c25fa7604a1a0d44 (patch) | |
| tree | 9b980c7331aecc3cbd110b51b2cd46f59ed6c8cf /Tests/TestApp | |
| parent | Moved Stride to vertex layout desc; updated tests (diff) | |
| download | DiligentEngine-c6bfb3bdcb4215eba7061090c25fa7604a1a0d44.tar.gz DiligentEngine-c6bfb3bdcb4215eba7061090c25fa7604a1a0d44.zip | |
Updated back buffer format to match the one from the swap chain in the tests
Diffstat (limited to 'Tests/TestApp')
| -rw-r--r-- | Tests/TestApp/assets/TestComputeShaders.lua | 2 | ||||
| -rw-r--r-- | Tests/TestApp/assets/TestRenderScripts.lua | 6 | ||||
| -rw-r--r-- | Tests/TestApp/include/TestBufferAccess.h | 2 | ||||
| -rw-r--r-- | Tests/TestApp/include/TestComputeShaders.h | 2 | ||||
| -rw-r--r-- | Tests/TestApp/include/TestDrawCommands.h | 2 | ||||
| -rw-r--r-- | Tests/TestApp/include/TestGeometryShader.h | 2 | ||||
| -rw-r--r-- | Tests/TestApp/include/TestTessellation.h | 2 | ||||
| -rw-r--r-- | Tests/TestApp/include/TestTexturing.h | 2 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestBufferAccess.cpp | 4 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestComputeShaders.cpp | 6 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestDrawCommands.cpp | 4 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestGeometryShader.cpp | 4 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestTessellation.cpp | 4 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestTexturing.cpp | 4 |
14 files changed, 24 insertions, 22 deletions
diff --git a/Tests/TestApp/assets/TestComputeShaders.lua b/Tests/TestApp/assets/TestComputeShaders.lua index 85cc46b..ba9fb38 100644 --- a/Tests/TestApp/assets/TestComputeShaders.lua +++ b/Tests/TestApp/assets/TestComputeShaders.lua @@ -238,7 +238,7 @@ RenderPSO = PipelineState.Create { InputIndex = 0, BufferSlot = 0, NumComponents = 3, ValueType = "VT_FLOAT32", IsNormalized = false, Stride = 4*4}, { InputIndex = 1, BufferSlot = 1, NumComponents = 2, ValueType = "VT_FLOAT32", IsNormalized = false, Stride = 4*4} }, - RTVFormats = {"TEX_FORMAT_RGBA8_UNORM_SRGB"}, + RTVFormats = {extBackBufferFormat}, PrimitiveTopology = "PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP" } } diff --git a/Tests/TestApp/assets/TestRenderScripts.lua b/Tests/TestApp/assets/TestRenderScripts.lua index 090c374..6aa43fa 100644 --- a/Tests/TestApp/assets/TestRenderScripts.lua +++ b/Tests/TestApp/assets/TestRenderScripts.lua @@ -84,8 +84,8 @@ PSO = PipelineState.Create PrimitiveTopology = "PRIMITIVE_TOPOLOGY_TRIANGLE_LIST", pVS = MinimalVS, pPS = UniformBufferPS, - RTVFormats = "TEX_FORMAT_RGBA8_UNORM_SRGB", - DSVFormat = "TEX_FORMAT_D32_FLOAT", + RTVFormats = extBackBufferFormat, + DSVFormat = "TEX_FORMAT_UNKNOWN", }, SRBAllocationGranularity = 16 } @@ -122,7 +122,7 @@ PSOInst = PipelineState.Create PrimitiveTopology = "PRIMITIVE_TOPOLOGY_TRIANGLE_LIST", pVS = MinimalInstVS, pPS = UniformBufferPS, - RTVFormats = "TEX_FORMAT_RGBA8_UNORM_SRGB", + RTVFormats = extBackBufferFormat, DSVFormat = "TEX_FORMAT_D32_FLOAT", } } diff --git a/Tests/TestApp/include/TestBufferAccess.h b/Tests/TestApp/include/TestBufferAccess.h index 76d18f7..8f3458b 100644 --- a/Tests/TestApp/include/TestBufferAccess.h +++ b/Tests/TestApp/include/TestBufferAccess.h @@ -31,7 +31,7 @@ public: static const int TriGridSize = 16; TestBufferAccess(); - void Init( Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent ); + void Init( Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext, Diligent::ISwapChain *pSwapChain, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent ); void Draw(float fTime); private: diff --git a/Tests/TestApp/include/TestComputeShaders.h b/Tests/TestApp/include/TestComputeShaders.h index 38bf64e..bf10202 100644 --- a/Tests/TestApp/include/TestComputeShaders.h +++ b/Tests/TestApp/include/TestComputeShaders.h @@ -31,7 +31,7 @@ class TestComputeShaders : public UnitTestBase public: TestComputeShaders(); - void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext); + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pContext, Diligent::ISwapChain *pSwapChain); void Draw(); private: diff --git a/Tests/TestApp/include/TestDrawCommands.h b/Tests/TestApp/include/TestDrawCommands.h index 2600c39..d8a1d88 100644 --- a/Tests/TestApp/include/TestDrawCommands.h +++ b/Tests/TestApp/include/TestDrawCommands.h @@ -32,7 +32,7 @@ public: static const int TriGridSize = 16; - void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent); + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext, Diligent::ISwapChain *pSwapChain, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent); void Draw(); private: diff --git a/Tests/TestApp/include/TestGeometryShader.h b/Tests/TestApp/include/TestGeometryShader.h index 965c2db..3862561 100644 --- a/Tests/TestApp/include/TestGeometryShader.h +++ b/Tests/TestApp/include/TestGeometryShader.h @@ -30,7 +30,7 @@ class TestGeometryShader : public UnitTestBase public: TestGeometryShader() : UnitTestBase("Test Geometry Shaders"){} - void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext); + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext, Diligent::ISwapChain *pSwapChain); void Draw(); private: diff --git a/Tests/TestApp/include/TestTessellation.h b/Tests/TestApp/include/TestTessellation.h index c3257ac..2e808e8 100644 --- a/Tests/TestApp/include/TestTessellation.h +++ b/Tests/TestApp/include/TestTessellation.h @@ -29,7 +29,7 @@ class TestTessellation : public UnitTestBase { public: TestTessellation() : UnitTestBase("Tessellation test") {} - void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext); + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext, Diligent::ISwapChain *pSwapChain); void Draw(); private: diff --git a/Tests/TestApp/include/TestTexturing.h b/Tests/TestApp/include/TestTexturing.h index 27d934f..7f71868 100644 --- a/Tests/TestApp/include/TestTexturing.h +++ b/Tests/TestApp/include/TestTexturing.h @@ -30,7 +30,7 @@ class TestTexturing : public UnitTestBase public: TestTexturing(); - void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext, Diligent::TEXTURE_FORMAT TexFormat, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent); + void Init(Diligent::IRenderDevice *pDevice, Diligent::IDeviceContext *pDeviceContext, Diligent::ISwapChain *pSwapChain, Diligent::TEXTURE_FORMAT TexFormat, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent); void Draw(); static void GenerateTextureData(Diligent::IRenderDevice *pRenderDevice, std::vector<Diligent::Uint8> &Data, std::vector<Diligent::TextureSubResData> &SubResouces, const Diligent::TextureDesc &TexDesc, const float *ColorOffset = nullptr); diff --git a/Tests/TestApp/src/TestBufferAccess.cpp b/Tests/TestApp/src/TestBufferAccess.cpp index 299960f..ed0177d 100644 --- a/Tests/TestApp/src/TestBufferAccess.cpp +++ b/Tests/TestApp/src/TestBufferAccess.cpp @@ -38,7 +38,7 @@ TestBufferAccess::TestBufferAccess() : m_fYExtent(0) {} -void TestBufferAccess::Init( IRenderDevice *pDevice, IDeviceContext *pContext, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent ) +void TestBufferAccess::Init( IRenderDevice *pDevice, IDeviceContext *pContext, ISwapChain *pSwapChain, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent ) { m_pRenderDevice = pDevice; m_pDeviceContext = pContext; @@ -137,7 +137,7 @@ void TestBufferAccess::Init( IRenderDevice *pDevice, IDeviceContext *pContext, f PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE; PSODesc.GraphicsPipeline.BlendDesc.IndependentBlendEnable = False; PSODesc.GraphicsPipeline.BlendDesc.RenderTargets[0].BlendEnable = False; - PSODesc.GraphicsPipeline.RTVFormats[0] = TEX_FORMAT_RGBA8_UNORM_SRGB; + PSODesc.GraphicsPipeline.RTVFormats[0] = pSwapChain->GetDesc().ColorBufferFormat; PSODesc.GraphicsPipeline.NumRenderTargets = 1; PSODesc.GraphicsPipeline.pVS = pVSInst; PSODesc.GraphicsPipeline.pPS = pPS; 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 ); } ); } diff --git a/Tests/TestApp/src/TestDrawCommands.cpp b/Tests/TestApp/src/TestDrawCommands.cpp index 7e4c9f3..d1205b7 100644 --- a/Tests/TestApp/src/TestDrawCommands.cpp +++ b/Tests/TestApp/src/TestDrawCommands.cpp @@ -31,7 +31,7 @@ using namespace Diligent; -void TestDrawCommands::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent ) +void TestDrawCommands::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext, ISwapChain *pSwapChain, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent ) { m_pRenderDevice = pDevice; m_pDeviceContext = pDeviceContext; @@ -181,7 +181,7 @@ void TestDrawCommands::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceCont PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE; PSODesc.GraphicsPipeline.BlendDesc.IndependentBlendEnable = False; PSODesc.GraphicsPipeline.BlendDesc.RenderTargets[0].BlendEnable = False; - PSODesc.GraphicsPipeline.RTVFormats[0] = TEX_FORMAT_RGBA8_UNORM_SRGB; + PSODesc.GraphicsPipeline.RTVFormats[0] = pSwapChain->GetDesc().ColorBufferFormat; PSODesc.GraphicsPipeline.NumRenderTargets = 1; PSODesc.GraphicsPipeline.pPS = pPS; diff --git a/Tests/TestApp/src/TestGeometryShader.cpp b/Tests/TestApp/src/TestGeometryShader.cpp index 81dc309..aba2fed 100644 --- a/Tests/TestApp/src/TestGeometryShader.cpp +++ b/Tests/TestApp/src/TestGeometryShader.cpp @@ -31,7 +31,7 @@ using namespace Diligent; -void TestGeometryShader::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext) +void TestGeometryShader::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext, ISwapChain *pSwapChain) { if(!pDevice->GetDeviceCaps().bGeometryShadersSupported) { @@ -70,7 +70,7 @@ void TestGeometryShader::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceCo PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE; PSODesc.GraphicsPipeline.BlendDesc.IndependentBlendEnable = False; PSODesc.GraphicsPipeline.BlendDesc.RenderTargets[0].BlendEnable = False; - PSODesc.GraphicsPipeline.RTVFormats[0] = TEX_FORMAT_RGBA8_UNORM_SRGB; + PSODesc.GraphicsPipeline.RTVFormats[0] = pSwapChain->GetDesc().ColorBufferFormat; PSODesc.GraphicsPipeline.NumRenderTargets = 1; PSODesc.GraphicsPipeline.pPS = pPS; PSODesc.GraphicsPipeline.pVS = pVS; diff --git a/Tests/TestApp/src/TestTessellation.cpp b/Tests/TestApp/src/TestTessellation.cpp index 0975b34..7150f05 100644 --- a/Tests/TestApp/src/TestTessellation.cpp +++ b/Tests/TestApp/src/TestTessellation.cpp @@ -31,7 +31,7 @@ using namespace Diligent; -void TestTessellation::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext) +void TestTessellation::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext, ISwapChain *pSwapChain) { if(!pDevice->GetDeviceCaps().bTessellationSupported) { @@ -81,7 +81,7 @@ void TestTessellation::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceCont PSODesc.GraphicsPipeline.RasterizerDesc.FillMode = FILL_MODE_WIREFRAME; PSODesc.GraphicsPipeline.BlendDesc.IndependentBlendEnable = False; PSODesc.GraphicsPipeline.BlendDesc.RenderTargets[0].BlendEnable = False; - PSODesc.GraphicsPipeline.RTVFormats[0] = TEX_FORMAT_RGBA8_UNORM_SRGB; + PSODesc.GraphicsPipeline.RTVFormats[0] = pSwapChain->GetDesc().ColorBufferFormat; PSODesc.GraphicsPipeline.NumRenderTargets = 1; PSODesc.GraphicsPipeline.pPS = pPS; PSODesc.GraphicsPipeline.pVS = pVS; diff --git a/Tests/TestApp/src/TestTexturing.cpp b/Tests/TestApp/src/TestTexturing.cpp index 29e96d9..bcf1b85 100644 --- a/Tests/TestApp/src/TestTexturing.cpp +++ b/Tests/TestApp/src/TestTexturing.cpp @@ -132,7 +132,7 @@ void TestTexturing::GenerateTextureData(IRenderDevice *pRenderDevice, std::vecto } -void TestTexturing::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext, TEXTURE_FORMAT TexFormat, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent ) +void TestTexturing::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext, ISwapChain *pSwapChain, TEXTURE_FORMAT TexFormat, float fMinXCoord, float fMinYCoord, float fXExtent, float fYExtent ) { m_pRenderDevice = pDevice; m_TextureFormat = TexFormat; @@ -252,7 +252,7 @@ void TestTexturing::Init( IRenderDevice *pDevice, IDeviceContext *pDeviceContext PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE; PSODesc.GraphicsPipeline.BlendDesc.IndependentBlendEnable = False; PSODesc.GraphicsPipeline.BlendDesc.RenderTargets[0].BlendEnable = False; - PSODesc.GraphicsPipeline.RTVFormats[0] = TEX_FORMAT_RGBA8_UNORM_SRGB; + PSODesc.GraphicsPipeline.RTVFormats[0] = pSwapChain->GetDesc().ColorBufferFormat; PSODesc.GraphicsPipeline.NumRenderTargets = 1; PSODesc.GraphicsPipeline.pVS = pVS; PSODesc.GraphicsPipeline.pPS = pPS; |
