diff options
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; }; |
