From 35c35fc26faab72eba551671903003fe833ad2d6 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Fri, 7 Apr 2017 15:27:04 +0200 Subject: [PATCH] - Check if glCreateProgram or glCreateShader fails, because apparently AMD found a way to make exactly that happen --- src/gl/system/gl_swframebuffer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gl/system/gl_swframebuffer.cpp b/src/gl/system/gl_swframebuffer.cpp index b3de63eee..c391c4930 100644 --- a/src/gl/system/gl_swframebuffer.cpp +++ b/src/gl/system/gl_swframebuffer.cpp @@ -360,8 +360,11 @@ bool OpenGLSWFrameBuffer::CreatePixelShader(FString vertexsrc, FString fragments auto shader = std::make_unique(); shader->Program = glCreateProgram(); + if (shader->Program == 0) { Printf("glCreateProgram failed. Disabling OpenGL hardware acceleration.\n"); return false; } 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); + if (shader->FragmentShader == 0) { Printf("glCreateShader(GL_FRAGMENT_SHADER) failed. Disabling OpenGL hardware acceleration.\n"); return false; } int maxGlslVersion = 330; int shaderVersion = MIN((int)round(gl.glslversion * 10) * 10, maxGlslVersion);