diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-11-24 19:15:28 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-11-24 19:15:28 +0000 |
| commit | 82198dc5b8284382d27d5f6776fb2531b805a83e (patch) | |
| tree | 6734be86fdf30c87a7d244e13133bc2bcf7452d2 /unityplugin/GhostCubePlugin/PluginSource | |
| parent | Updated core (fixed state transiton issue in D3D11) (diff) | |
| download | DiligentEngine-82198dc5b8284382d27d5f6776fb2531b805a83e.tar.gz DiligentEngine-82198dc5b8284382d27d5f6776fb2531b805a83e.zip | |
Added explicit control over resource transitions in draw command
Added explicit static resource binding initialization in SRB objects
Diffstat (limited to 'unityplugin/GhostCubePlugin/PluginSource')
| -rw-r--r-- | unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp | 3 | ||||
| -rw-r--r-- | unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp index aee52b2..adef5a3 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp @@ -97,6 +97,7 @@ SamplePlugin::SamplePlugin(Diligent::IRenderDevice *pDevice, bool UseReverseZ, T PSODesc.GraphicsPipeline.InputLayout.LayoutElements = LayoutElems; PSODesc.GraphicsPipeline.InputLayout.NumElements = _countof(LayoutElems); pDevice->CreatePipelineState(PSODesc, &m_PSO); + m_PSO->CreateShaderResourceBinding(&m_SRB, true); } { @@ -163,7 +164,7 @@ void SamplePlugin::Render(Diligent::IDeviceContext *pContext, const float4x4 &Vi pContext->SetIndexBuffer(m_CubeIndexBuffer, 0); pContext->SetPipelineState(m_PSO); - pContext->CommitShaderResources(nullptr, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES); + pContext->CommitShaderResources(m_SRB, COMMIT_SHADER_RESOURCES_FLAG_TRANSITION_RESOURCES); DrawAttribs DrawAttrs; DrawAttrs.IsIndexed = true; diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.h b/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.h index 56b4a33..879db60 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.h +++ b/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.h @@ -17,4 +17,5 @@ private: Diligent::RefCntAutoPtr<Diligent::IBuffer> m_CubeIndexBuffer; Diligent::RefCntAutoPtr<Diligent::IBuffer> m_VSConstants; Diligent::RefCntAutoPtr<Diligent::IPipelineState> m_PSO; + Diligent::RefCntAutoPtr<Diligent::IShaderResourceBinding> m_SRB; }; |
