mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-12 07:34:50 +00:00
Do not call UBO functions when no extension available
This commit is contained in:
parent
138c6ea25e
commit
1deb9742de
1 changed files with 6 additions and 3 deletions
|
@ -294,8 +294,11 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
|
|||
modelmatrix_index = glGetUniformLocation(hShader, "ModelMatrix");
|
||||
texturematrix_index = glGetUniformLocation(hShader, "TextureMatrix");
|
||||
|
||||
int tempindex = glGetUniformBlockIndex(hShader, "LightBufferUBO");
|
||||
if (tempindex != -1) glUniformBlockBinding(hShader, tempindex, LIGHTBUF_BINDINGPOINT);
|
||||
if (LM_SOFTWARE != gl.lightmethod)
|
||||
{
|
||||
int tempindex = glGetUniformBlockIndex(hShader, "LightBufferUBO");
|
||||
if (tempindex != -1) glUniformBlockBinding(hShader, tempindex, LIGHTBUF_BINDINGPOINT);
|
||||
}
|
||||
|
||||
glUseProgram(hShader);
|
||||
|
||||
|
@ -304,7 +307,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
|
|||
{
|
||||
char stringbuf[20];
|
||||
mysnprintf(stringbuf, 20, "texture%d", i);
|
||||
tempindex = glGetUniformLocation(hShader, stringbuf);
|
||||
int tempindex = glGetUniformLocation(hShader, stringbuf);
|
||||
if (tempindex > 0) glUniform1i(tempindex, i - 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue