summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-10-30 17:46:28 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-10-30 17:46:28 +0000
commit13440e98e8cd926620d9913aa72780ceaca4f668 (patch)
tree1d40d82d0f450a2b2678642d6db9eff055dbee94 /Graphics/GraphicsEngineOpenGL
parentFixed few more gcc/clang compile issue (diff)
downloadDiligentCore-13440e98e8cd926620d9913aa72780ceaca4f668.tar.gz
DiligentCore-13440e98e8cd926620d9913aa72780ceaca4f668.zip
Some code refactoring
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h5
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp11
2 files changed, 8 insertions, 8 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
index 1cf1576b..65835fc4 100644
--- a/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
+++ b/Graphics/GraphicsEngineOpenGL/include/DeviceContextGLImpl.h
@@ -35,11 +35,14 @@
namespace Diligent
{
+class RenderDeviceGLImpl;
+
struct DeviceContextGLImplTraits
{
using BufferType = BufferGLImpl;
using TextureType = TextureBaseGL;
using PipelineStateType = PipelineStateGLImpl;
+ using DeviceType = RenderDeviceGLImpl;
};
/// Implementation of the Diligent::IDeviceContextGL interface
@@ -48,7 +51,7 @@ class DeviceContextGLImpl final : public DeviceContextBase<IDeviceContextGL, Dev
public:
using TDeviceContextBase = DeviceContextBase<IDeviceContextGL, DeviceContextGLImplTraits>;
- DeviceContextGLImpl(IReferenceCounters* pRefCounters, class RenderDeviceGLImpl* pDeviceGL, bool bIsDeferred);
+ DeviceContextGLImpl(IReferenceCounters* pRefCounters, RenderDeviceGLImpl* pDeviceGL, bool bIsDeferred);
/// Queries the specific interface, see IObject::QueryInterface() for details.
virtual void QueryInterface(const INTERFACE_ID& IID, IObject** ppInterface )override final;
diff --git a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
index 2a039c7e..f85bd454 100644
--- a/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp
@@ -333,9 +333,8 @@ namespace Diligent
for (Uint32 rt = 0; rt < NumRenderTargets; ++rt)
pBoundRTVs[rt] = m_pBoundRenderTargets[rt];
- auto* pRenderDeviceGL = m_pDevice.RawPtr<RenderDeviceGLImpl>();
auto CurrentNativeGLContext = m_ContextState.GetCurrentGLContext();
- auto& FBOCache = pRenderDeviceGL->GetFBOCache(CurrentNativeGLContext);
+ auto& FBOCache = m_pDevice->GetFBOCache(CurrentNativeGLContext);
const auto& FBO = FBOCache.GetFBO(NumRenderTargets, pBoundRTVs, m_pBoundDepthStencil, m_ContextState);
// Even though the write mask only applies to writes to a framebuffer, the mask state is NOT
// Framebuffer state. So it is NOT part of a Framebuffer Object or the Default Framebuffer.
@@ -612,12 +611,11 @@ namespace Diligent
m_pPipelineState->CommitProgram(m_ContextState);
- auto* pRenderDeviceGL = m_pDevice.RawPtr<RenderDeviceGLImpl>();
- auto CurrNativeGLContext = pRenderDeviceGL->m_GLContext.GetCurrentNativeGLContext();
+ auto CurrNativeGLContext = m_pDevice->m_GLContext.GetCurrentNativeGLContext();
const auto& PipelineDesc = m_pPipelineState->GetDesc().GraphicsPipeline;
if (!m_ContextState.IsValidVAOBound())
{
- auto& VAOCache = pRenderDeviceGL->GetVAOCache(CurrNativeGLContext);
+ auto& VAOCache = m_pDevice->GetVAOCache(CurrNativeGLContext);
IBuffer* pIndexBuffer = IsIndexed ? m_pIndexBuffer.RawPtr() : nullptr;
if (PipelineDesc.InputLayout.NumElements > 0 || pIndexBuffer != nullptr)
{
@@ -1028,8 +1026,7 @@ namespace Diligent
bool DeviceContextGLImpl::UpdateCurrentGLContext()
{
- auto* pRenderDeviceGL = m_pDevice.RawPtr<RenderDeviceGLImpl>();
- auto NativeGLContext = pRenderDeviceGL->m_GLContext.GetCurrentNativeGLContext();
+ auto NativeGLContext = m_pDevice->m_GLContext.GetCurrentNativeGLContext();
if (NativeGLContext == NULL)
return false;