summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-06-27 04:14:20 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-06-27 04:14:20 +0000
commitecd151d725ec446be7718995ed110de1678d7d8f (patch)
tree95955d04de4b7d76488d06ac963833751eea5b81 /Graphics/GraphicsEngineOpenGL
parentImproved SRB data allocation in D3D11 backend; removed AdaptiveFixedBlockAllo... (diff)
downloadDiligentCore-ecd151d725ec446be7718995ed110de1678d7d8f.tar.gz
DiligentCore-ecd151d725ec446be7718995ed110de1678d7d8f.zip
Reworked shader memory alloction for resource layouts in D3D12 pipeline implementation
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp
index 8794e91c..4eeebc88 100644
--- a/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/PipelineStateGLImpl.cpp
@@ -52,7 +52,7 @@ void PipelineStateGLImpl::LinkGLProgram(bool bIsProgramPipelineSupported)
m_ShaderResourceLayoutHash = 0;
for (Uint32 Shader = 0; Shader < m_NumShaders; ++Shader)
{
- auto *pShaderGL = static_cast<ShaderGLImpl*>(m_ppShaders[Shader]);
+ auto *pShaderGL = GetShader<ShaderGLImpl>(Shader);
HashCombine(m_ShaderResourceLayoutHash, pShaderGL->m_GlProgObj.GetAllResources().GetHash());
}
}
@@ -62,7 +62,7 @@ void PipelineStateGLImpl::LinkGLProgram(bool bIsProgramPipelineSupported)
m_GLProgram.Create();
for( Uint32 Shader = 0; Shader < m_NumShaders; ++Shader )
{
- auto *pCurrShader = static_cast<ShaderGLImpl*>(m_ppShaders[Shader]);
+ auto *pCurrShader = GetShader<ShaderGLImpl>(Shader);
glAttachShader( m_GLProgram, pCurrShader->m_GLShaderObj );
CHECK_GL_ERROR( "glAttachShader() failed" );
}
@@ -91,7 +91,7 @@ void PipelineStateGLImpl::LinkGLProgram(bool bIsProgramPipelineSupported)
// Detach shaders from the program object
for( Uint32 Shader = 0; Shader < m_NumShaders; ++Shader )
{
- auto *pCurrShader = static_cast<ShaderGLImpl*>(m_ppShaders[Shader]);
+ auto *pCurrShader = GetShader<ShaderGLImpl>(Shader);
glDetachShader( m_GLProgram, pCurrShader->m_GLShaderObj );
CHECK_GL_ERROR( "glDetachShader() failed" );
}
@@ -101,7 +101,7 @@ void PipelineStateGLImpl::LinkGLProgram(bool bIsProgramPipelineSupported)
SHADER_VARIABLE_TYPE DefaultVarType = SHADER_VARIABLE_TYPE_STATIC;
for( Uint32 Shader = 0; Shader < m_NumShaders; ++Shader )
{
- auto *pCurrShader = static_cast<ShaderGLImpl*>(m_ppShaders[Shader]);
+ auto *pCurrShader = GetShader<ShaderGLImpl>(Shader);
const auto& Desc = pCurrShader->GetDesc();
if (Shader == 0)
{
@@ -190,7 +190,7 @@ GLObjectWrappers::GLPipelineObj &PipelineStateGLImpl::GetGLProgramPipeline(GLCon
GLuint Pipeline = it->second;
for (Uint32 Shader = 0; Shader < m_NumShaders; ++Shader)
{
- auto *pCurrShader = static_cast<ShaderGLImpl*>(m_ppShaders[Shader]);
+ auto *pCurrShader = GetShader<ShaderGLImpl>(Shader);
auto GLShaderBit = ShaderTypeToGLShaderBit(pCurrShader->GetDesc().ShaderType);
// If the program has an active code for each stage mentioned in set flags,
// then that code will be used by the pipeline. If program is 0, then the given