mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 08:30:50 +00:00
- Check if glCreateProgram or glCreateShader fails, because apparently AMD found a way to make exactly that happen
This commit is contained in:
parent
b1e1f25218
commit
35c35fc26f
1 changed files with 3 additions and 0 deletions
|
@ -360,8 +360,11 @@ bool OpenGLSWFrameBuffer::CreatePixelShader(FString vertexsrc, FString fragments
|
||||||
auto shader = std::make_unique<HWPixelShader>();
|
auto shader = std::make_unique<HWPixelShader>();
|
||||||
|
|
||||||
shader->Program = glCreateProgram();
|
shader->Program = glCreateProgram();
|
||||||
|
if (shader->Program == 0) { Printf("glCreateProgram failed. Disabling OpenGL hardware acceleration.\n"); return false; }
|
||||||
shader->VertexShader = glCreateShader(GL_VERTEX_SHADER);
|
shader->VertexShader = glCreateShader(GL_VERTEX_SHADER);
|
||||||
|
if (shader->VertexShader == 0) { Printf("glCreateShader(GL_VERTEX_SHADER) failed. Disabling OpenGL hardware acceleration.\n"); return false; }
|
||||||
shader->FragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
|
shader->FragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
|
||||||
|
if (shader->FragmentShader == 0) { Printf("glCreateShader(GL_FRAGMENT_SHADER) failed. Disabling OpenGL hardware acceleration.\n"); return false; }
|
||||||
|
|
||||||
int maxGlslVersion = 330;
|
int maxGlslVersion = 330;
|
||||||
int shaderVersion = MIN((int)round(gl.glslversion * 10) * 10, maxGlslVersion);
|
int shaderVersion = MIN((int)round(gl.glslversion * 10) * 10, maxGlslVersion);
|
||||||
|
|
Loading…
Reference in a new issue