diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-12-04 05:34:48 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-12-04 05:34:48 +0000 |
| commit | b251377cae1247bd6b752fb513a0330f3787835f (patch) | |
| tree | 8972e0c7814ee53d2b3fd3f32b7cd2136de5a4ce /Tests/TestApp/src | |
| parent | Updated the API (SetVertexBuffers, SetIndexBuffers, DRAW_FLAGS and other) (diff) | |
| download | DiligentEngine-b251377cae1247bd6b752fb513a0330f3787835f.tar.gz DiligentEngine-b251377cae1247bd6b752fb513a0330f3787835f.zip | |
Updated SetRenderTargets() and ClearDepthStencil() methods to take StateTransitionMode parameter
Diffstat (limited to 'Tests/TestApp/src')
| -rw-r--r-- | Tests/TestApp/src/TestApp.cpp | 12 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestSeparateTextureSampler.cpp | 4 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestShaderResourceLayout.cpp | 2 | ||||
| -rw-r--r-- | Tests/TestApp/src/TestShaderVarAccess.cpp | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/Tests/TestApp/src/TestApp.cpp b/Tests/TestApp/src/TestApp.cpp index b1b0cce..9fc9802 100644 --- a/Tests/TestApp/src/TestApp.cpp +++ b/Tests/TestApp/src/TestApp.cpp @@ -522,7 +522,7 @@ void TestApp::InitializeRenderers() UniformData[3] = 0; } - m_pImmediateContext->SetRenderTargets(0, nullptr, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL); + m_pImmediateContext->SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); float ClearColor[] = {0.1f, 0.2f, 0.4f, 1.0f}; m_pImmediateContext->ClearRenderTarget(nullptr, ClearColor, RESOURCE_STATE_TRANSITION_MODE_VERIFY); DrawAttribs DrawAttrs; @@ -531,12 +531,12 @@ void TestApp::InitializeRenderers() m_pRenderScript->Run(m_pImmediateContext, "DrawTris", DrawAttrs); // This adds transition barrier for pTex1 - m_pImmediateContext->SetRenderTargets(1, pRTVs, pDSV, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL); + m_pImmediateContext->SetRenderTargets(1, pRTVs, pDSV, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); m_pImmediateContext->ClearRenderTarget(pRTVs[0], ClearColor, RESOURCE_STATE_TRANSITION_MODE_VERIFY); - m_pImmediateContext->ClearDepthStencil(pDSV, CLEAR_DEPTH_FLAG | CLEAR_DEPTH_STENCIL_VERIFY_STATE_FLAG); + m_pImmediateContext->ClearDepthStencil(pDSV, CLEAR_DEPTH_FLAG, 1, 0, RESOURCE_STATE_TRANSITION_MODE_VERIFY); // Generate draw command to the bound render target m_pImmediateContext->Draw(DrawAttrs); - m_pImmediateContext->SetRenderTargets(0, nullptr, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL); + m_pImmediateContext->SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); // This will destroy texture and put D3D12 resource into release queue pTex.Release(); @@ -630,10 +630,10 @@ void TestApp::Update(double CurrTime, double ElapsedTime) void TestApp::Render() { - m_pImmediateContext->SetRenderTargets(0, nullptr, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL); + m_pImmediateContext->SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); float ClearColor[] = {0.1f, 0.2f, 0.4f, 1.0f}; m_pImmediateContext->ClearRenderTarget(nullptr, ClearColor, RESOURCE_STATE_TRANSITION_MODE_VERIFY); - m_pImmediateContext->ClearDepthStencil(nullptr, CLEAR_DEPTH_FLAG| CLEAR_DEPTH_STENCIL_VERIFY_STATE_FLAG, 1.f); + m_pImmediateContext->ClearDepthStencil(nullptr, CLEAR_DEPTH_FLAG, 1.f, 0, RESOURCE_STATE_TRANSITION_MODE_VERIFY); double dCurrTime = m_CurrTime; diff --git a/Tests/TestApp/src/TestSeparateTextureSampler.cpp b/Tests/TestApp/src/TestSeparateTextureSampler.cpp index 1bf1306..5fa41a5 100644 --- a/Tests/TestApp/src/TestSeparateTextureSampler.cpp +++ b/Tests/TestApp/src/TestSeparateTextureSampler.cpp @@ -151,7 +151,7 @@ TestSeparateTextureSampler::TestSeparateTextureSampler(IRenderDevice *pDevice, I pDevice->CreateTexture(RenderTargetDesc, TextureData{}, &pRenderTarget); ITextureView* pRTV[] = {pRenderTarget->GetDefaultView(TEXTURE_VIEW_RENDER_TARGET)}; - pContext->SetRenderTargets(1, pRTV, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL); + pContext->SetRenderTargets(1, pRTV, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); float Zero[4] = {}; pContext->ClearRenderTarget(pRTV[0], Zero, RESOURCE_STATE_TRANSITION_MODE_VERIFY); pContext->SetPipelineState(pPSO); @@ -161,7 +161,7 @@ TestSeparateTextureSampler::TestSeparateTextureSampler(IRenderDevice *pDevice, I DrawAttrs.NumVertices = 3; pContext->Draw(DrawAttrs); - pContext->SetRenderTargets(0, nullptr, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL); + pContext->SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); SetStatus(TestResult::Succeeded); } diff --git a/Tests/TestApp/src/TestShaderResourceLayout.cpp b/Tests/TestApp/src/TestShaderResourceLayout.cpp index e5b74d4..966dc75 100644 --- a/Tests/TestApp/src/TestShaderResourceLayout.cpp +++ b/Tests/TestApp/src/TestShaderResourceLayout.cpp @@ -85,7 +85,7 @@ TestShaderResourceLayout::TestShaderResourceLayout( IRenderDevice *pDevice, IDev RefCntAutoPtr<ITexture> pRenderTarget; pDevice->CreateTexture(TexDesc, TextureData{}, &pRenderTarget); auto *pRTV = pRenderTarget->GetDefaultView(TEXTURE_VIEW_RENDER_TARGET); - m_pDeviceContext->SetRenderTargets(1, &pRTV, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL); + m_pDeviceContext->SetRenderTargets(1, &pRTV, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); float Zero[4] = {}; m_pDeviceContext->ClearRenderTarget(pRTV, Zero, RESOURCE_STATE_TRANSITION_MODE_VERIFY); diff --git a/Tests/TestApp/src/TestShaderVarAccess.cpp b/Tests/TestApp/src/TestShaderVarAccess.cpp index 495529e..7e3af52 100644 --- a/Tests/TestApp/src/TestShaderVarAccess.cpp +++ b/Tests/TestApp/src/TestShaderVarAccess.cpp @@ -552,15 +552,15 @@ TestShaderVarAccess::TestShaderVarAccess( IRenderDevice *pDevice, IDeviceContext VERIFY_EXPR(pNonExistingVar == nullptr); VERIFY_EXPR(pSRB->GetVariableCount(SHADER_TYPE_GEOMETRY) == 0); - m_pDeviceContext->SetRenderTargets(1, &pRTV, pDSV, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL); + m_pDeviceContext->SetRenderTargets(1, &pRTV, pDSV, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); float Zero[4] = {}; m_pDeviceContext->ClearRenderTarget(pRTV, Zero, RESOURCE_STATE_TRANSITION_MODE_VERIFY); - m_pDeviceContext->ClearDepthStencil(pDSV, CLEAR_DEPTH_FLAG | CLEAR_DEPTH_STENCIL_VERIFY_STATE_FLAG); + m_pDeviceContext->ClearDepthStencil(pDSV, CLEAR_DEPTH_FLAG, 1, 0, RESOURCE_STATE_TRANSITION_MODE_VERIFY); pContext->CommitShaderResources(pSRB, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); pContext->Draw(DrawAttrs); - m_pDeviceContext->SetRenderTargets(0, nullptr, nullptr, SET_RENDER_TARGETS_FLAG_TRANSITION_ALL); + m_pDeviceContext->SetRenderTargets(0, nullptr, nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION); SetStatus(TestResult::Succeeded); } |
