- change ShaderUniforms so that it just contains the uniform block and not the binding point

This commit is contained in:
Magnus Norddahl 2018-06-11 22:33:55 +02:00
commit 9155b773cc
13 changed files with 59 additions and 41 deletions

View file

@ -159,6 +159,19 @@ void FShaderProgram::SetAttribLocation(int index, const char *name)
glBindAttribLocation(mProgram, index, name);
}
//==========================================================================
//
// Set uniform buffer location
//
//==========================================================================
void FShaderProgram::SetUniformBufferLocation(int index, const char *name)
{
GLuint uniformBlockIndex = glGetUniformBlockIndex(mProgram, name);
if (uniformBlockIndex != GL_INVALID_INDEX)
glUniformBlockBinding(mProgram, uniformBlockIndex, index);
}
//==========================================================================
//
// Makes the shader the active program