diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-03-05 06:57:20 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-03-05 06:57:20 +0000 |
| commit | c1ad6a298a409c008b5b62b0b6f3824606cb3882 (patch) | |
| tree | b7f8e672d0f620b71a85c88f8240b51c46c6dbde /unityplugin/GhostCubePlugin/PluginSource | |
| parent | Fixed Unity plugin to comply with the new API (diff) | |
| download | DiligentEngine-c1ad6a298a409c008b5b62b0b6f3824606cb3882.tar.gz DiligentEngine-c1ad6a298a409c008b5b62b0b6f3824606cb3882.zip | |
Updated projects to conform to the update engine factory API
Diffstat (limited to 'unityplugin/GhostCubePlugin/PluginSource')
3 files changed, 6 insertions, 7 deletions
diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D11.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D11.cpp index c621064..ca83f18 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D11.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D11.cpp @@ -9,7 +9,7 @@ #include "RenderAPI.h" #include "Unity/IUnityGraphicsD3D11.h" -#include "RenderDeviceFactoryD3D11.h" +#include "EngineFactoryD3D11.h" #include "RenderDeviceD3D11.h" using namespace Diligent; @@ -50,7 +50,7 @@ void RenderAPI_D3D11::ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInt CComPtr<ID3D11DeviceContext> d3d11ImmediateContext; m_d3d11Device->GetImmediateContext(&d3d11ImmediateContext); auto *pFactoryD3d11 = GetEngineFactoryD3D11(); - EngineD3D11Attribs Attribs; + EngineD3D11CreateInfo Attribs; pFactoryD3d11->AttachToD3D11Device(m_d3d11Device, d3d11ImmediateContext, Attribs, &m_Device, &m_Context, 0); break; } diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp index 6f667f7..fd21662 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp @@ -14,7 +14,7 @@ #include "RenderAPI.h" #include "Unity/IUnityGraphicsD3D12.h" -#include "RenderDeviceFactoryD3D12.h" +#include "EngineFactoryD3D12.h" #include "RenderDeviceD3D12.h" #include "CommandQueueD3D12.h" #include "TextureD3D12.h" @@ -144,7 +144,7 @@ void RenderAPI_D3D12::ProcessDeviceEvent(UnityGfxDeviceEventType type, IUnityInt auto &DefaultAllocator = DefaultRawMemoryAllocator::GetAllocator(); m_CmdQueue = NEW_RC_OBJ(DefaultAllocator, "UnityCommandQueueImpl instance", UnityCommandQueueImpl)(m_UnityGraphicsD3D12); auto *pFactoryD3D12 = GetEngineFactoryD3D12(); - EngineD3D12Attribs Attribs; + EngineD3D12CreateInfo Attribs; std::array<ICommandQueueD3D12*, 1> CmdQueues = {m_CmdQueue}; pFactoryD3D12->AttachToD3D12Device(d3d12Device, CmdQueues.size(), CmdQueues.data(), Attribs, &m_Device, &m_Context, 0); m_Device->QueryInterface(IID_RenderDeviceD3D12, reinterpret_cast<IObject**>(static_cast<IRenderDeviceD3D12**>(&m_RenderDeviceD3D12))); diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp index d13c5fb..deae192 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp @@ -94,11 +94,10 @@ SamplePlugin::SamplePlugin(Diligent::IRenderDevice *pDevice, bool UseReverseZ, T PSODesc.GraphicsPipeline.pVS = pVS; PSODesc.GraphicsPipeline.pPS = pPS; PSODesc.GraphicsPipeline.InputLayout.LayoutElements = LayoutElems; - PSODesc.GraphicsPipeline.InputLayout.NumElements = _countof(LayoutElems); + PSODesc.GraphicsPipeline.InputLayout.NumElements = _countof(LayoutElems); pDevice->CreatePipelineState(PSODesc, &m_PSO); - m_PSO->CreateShaderResourceBinding(&m_SRB, true); - m_PSO->GetStaticShaderVariable(SHADER_TYPE_VERTEX, "Constants")->Set(m_VSConstants); + m_PSO->CreateShaderResourceBinding(&m_SRB, true); } { |
