diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-10-30 17:46:28 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-10-30 17:46:28 +0000 |
| commit | 13440e98e8cd926620d9913aa72780ceaca4f668 (patch) | |
| tree | 1d40d82d0f450a2b2678642d6db9eff055dbee94 /Graphics/GraphicsEngineD3D11 | |
| parent | Fixed few more gcc/clang compile issue (diff) | |
| download | DiligentCore-13440e98e8cd926620d9913aa72780ceaca4f668.tar.gz DiligentCore-13440e98e8cd926620d9913aa72780ceaca4f668.zip | |
Some code refactoring
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
| -rwxr-xr-x | Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h | 5 | ||||
| -rwxr-xr-x | Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h index 9da2c23e..8dbd53ff 100755 --- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h @@ -40,11 +40,14 @@ namespace Diligent
{
+class RenderDeviceD3D11Impl;
+
struct DeviceContextD3D11ImplTraits
{
using BufferType = BufferD3D11Impl;
using TextureType = TextureBaseD3D11;
using PipelineStateType = PipelineStateD3D11Impl;
+ using DeviceType = RenderDeviceD3D11Impl;
};
/// Implementation of the Diligent::IDeviceContextD3D11 interface
@@ -55,7 +58,7 @@ public: DeviceContextD3D11Impl(IReferenceCounters* pRefCounters,
IMemoryAllocator& Allocator,
- IRenderDevice* pDevice,
+ RenderDeviceD3D11Impl* pDevice,
ID3D11DeviceContext* pd3d11DeviceContext,
const struct EngineD3D11CreateInfo& EngineAttribs,
bool bIsDeferred);
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index 9bcf8152..587aaee5 100755 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -43,7 +43,7 @@ namespace Diligent {
DeviceContextD3D11Impl::DeviceContextD3D11Impl( IReferenceCounters* pRefCounters,
IMemoryAllocator& Allocator,
- IRenderDevice* pDevice,
+ RenderDeviceD3D11Impl* pDevice,
ID3D11DeviceContext* pd3d11DeviceContext,
const struct EngineD3D11CreateInfo& EngineAttribs,
bool bIsDeferred ) :
@@ -1729,8 +1729,7 @@ namespace Diligent // ID3D11DeviceContext::ClearState() was called.
&pd3d11CmdList);
- auto* pDeviceD3D11Impl = m_pDevice.RawPtr<RenderDeviceD3D11Impl>();
- CommandListD3D11Impl* pCmdListD3D11( NEW_RC_OBJ(m_CmdListAllocator, "CommandListD3D11Impl instance", CommandListD3D11Impl)(pDeviceD3D11Impl, pd3d11CmdList) );
+ CommandListD3D11Impl* pCmdListD3D11( NEW_RC_OBJ(m_CmdListAllocator, "CommandListD3D11Impl instance", CommandListD3D11Impl)(m_pDevice, pd3d11CmdList) );
pCmdListD3D11->QueryInterface( IID_CommandList, reinterpret_cast<IObject**>(ppCommandList) );
// Device context is now in default state
@@ -1808,7 +1807,7 @@ namespace Diligent void DeviceContextD3D11Impl::SignalFence(IFence* pFence, Uint64 Value)
{
VERIFY(!m_bIsDeferred, "Fence can only be signaled from immediate context");
- auto* pd3d11Device = m_pDevice.RawPtr<RenderDeviceD3D11Impl>()->GetD3D11Device();
+ auto* pd3d11Device = m_pDevice->GetD3D11Device();
CComPtr<ID3D11Query> pd3d11Query = CreateD3D11QueryEvent(pd3d11Device);
m_pd3d11DeviceContext->End(pd3d11Query);
auto* pFenceD3D11Impl = ValidatedCast<FenceD3D11Impl>(pFence);
@@ -1828,7 +1827,7 @@ namespace Diligent {
VERIFY(!m_bIsDeferred, "Only immediate contexts can be idled");
Flush();
- auto* pd3d11Device = m_pDevice.RawPtr<RenderDeviceD3D11Impl>()->GetD3D11Device();
+ auto* pd3d11Device = m_pDevice->GetD3D11Device();
CComPtr<ID3D11Query> pd3d11Query = CreateD3D11QueryEvent(pd3d11Device);
m_pd3d11DeviceContext->End(pd3d11Query);
BOOL Data;
|
