mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-14 08:30:49 +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");
|
modelmatrix_index = glGetUniformLocation(hShader, "ModelMatrix");
|
||||||
texturematrix_index = glGetUniformLocation(hShader, "TextureMatrix");
|
texturematrix_index = glGetUniformLocation(hShader, "TextureMatrix");
|
||||||
|
|
||||||
|
if (LM_SOFTWARE != gl.lightmethod)
|
||||||
|
{
|
||||||
int tempindex = glGetUniformBlockIndex(hShader, "LightBufferUBO");
|
int tempindex = glGetUniformBlockIndex(hShader, "LightBufferUBO");
|
||||||
if (tempindex != -1) glUniformBlockBinding(hShader, tempindex, LIGHTBUF_BINDINGPOINT);
|
if (tempindex != -1) glUniformBlockBinding(hShader, tempindex, LIGHTBUF_BINDINGPOINT);
|
||||||
|
}
|
||||||
|
|
||||||
glUseProgram(hShader);
|
glUseProgram(hShader);
|
||||||
|
|
||||||
|
@ -304,7 +307,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
|
||||||
{
|
{
|
||||||
char stringbuf[20];
|
char stringbuf[20];
|
||||||
mysnprintf(stringbuf, 20, "texture%d", i);
|
mysnprintf(stringbuf, 20, "texture%d", i);
|
||||||
tempindex = glGetUniformLocation(hShader, stringbuf);
|
int tempindex = glGetUniformLocation(hShader, stringbuf);
|
||||||
if (tempindex > 0) glUniform1i(tempindex, i - 1);
|
if (tempindex > 0) glUniform1i(tempindex, i - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue