- Check if glCreateProgram or glCreateShader fails, because apparently AMD found a way to make exactly that happen

This commit is contained in:
Magnus Norddahl 2017-04-07 15:27:04 +02:00
parent b1e1f25218
commit 35c35fc26f

View file

@ -360,8 +360,11 @@ bool OpenGLSWFrameBuffer::CreatePixelShader(FString vertexsrc, FString fragments
auto shader = std::make_unique<HWPixelShader>();
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);