From eb00614ece27837fcccf48e936a7240f79a345e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 27 Sep 2015 00:49:14 +0200 Subject: [PATCH] Fix compilation of transform feedback test shaders on Mesa. Apparently they need to write something to gl_Position. --- src/Magnum/Test/PrimitiveQueryGLTest.cpp | 3 +++ src/Magnum/Test/TransformFeedbackGLTest.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/Magnum/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/Test/PrimitiveQueryGLTest.cpp index fe8e51272..4cc974246 100644 --- a/src/Magnum/Test/PrimitiveQueryGLTest.cpp +++ b/src/Magnum/Test/PrimitiveQueryGLTest.cpp @@ -163,6 +163,9 @@ void PrimitiveQueryGLTest::transformFeedbackPrimitivesWritten() { "out mediump vec2 outputData;\n" "void main() {\n" " outputData = vec2(1.0, -1.0);\n" + /* Mesa drivers complain that vertex shader doesn't write to + gl_Position otherwise */ + " gl_Position = vec4(1.0);\n" "}\n").compile()); #ifndef MAGNUM_TARGET_GLES attachShader(vert); diff --git a/src/Magnum/Test/TransformFeedbackGLTest.cpp b/src/Magnum/Test/TransformFeedbackGLTest.cpp index 8cdcf7870..b85df2485 100644 --- a/src/Magnum/Test/TransformFeedbackGLTest.cpp +++ b/src/Magnum/Test/TransformFeedbackGLTest.cpp @@ -199,6 +199,9 @@ XfbShader::XfbShader() { "out mediump vec2 outputData;\n" "void main() {\n" " outputData = inputData + vec2(1.0, -1.0);\n" + /* Mesa drivers complain that vertex shader doesn't write to + gl_Position otherwise */ + " gl_Position = vec4(1.0);\n" "}\n").compile()); #ifndef MAGNUM_TARGET_GLES attachShader(vert); @@ -308,6 +311,9 @@ XfbMultiShader::XfbMultiShader() { "void main() {\n" " output1 = inputData + vec2(1.0, -1.0);\n" " output2 = inputData.x - inputData.y;\n" + /* Mesa drivers complain that vertex shader doesn't write to + gl_Position otherwise */ + " gl_Position = vec4(1.0);\n" "}\n").compile()); #ifndef MAGNUM_TARGET_GLES attachShader(vert);