summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2013-12-19 14:17:19 -0800
committerCarl Worth <[email protected]>2014-03-04 13:22:43 -0800
commitc074e347453e8452d17e23295f031fff9dab1065 (patch)
tree5081ba23f1ae5195a3b47feb80b78c794d8ba75e /src
parent00d1daf2a85d84a208e438c26bec33fbac2d6089 (diff)
glsl: Fix condition to generate shader link error
GL_ARB_ES2_compatibility doesn't say anything about shader linking when one of the shaders (vertex or fragment shader) is absent. So, the extension shouldn't change the behavior specified in GLSL specification. Tested the behavior on proprietary linux drivers of NVIDIA and AMD. Both of them allow linking a version 100 shader program in OpenGL context, when one of the shaders is absent. Makes following Khronos CTS tests to pass: successfulcompilevert_linkprogram.test successfulcompilefrag_linkprogram.test Cc: [email protected] Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]> (cherry picked from commit 03597cf802a7a89c4853794e6206ab8ab003898d)
Diffstat (limited to 'src')
-rw-r--r--src/glsl/linker.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index fac186a6379..d7e2f855ab9 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -2373,11 +2373,12 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
goto done;
/* OpenGL ES requires that a vertex shader and a fragment shader both be
- * present in a linked program. By checking prog->IsES, we also
- * catch the GL_ARB_ES2_compatibility case.
+ * present in a linked program. GL_ARB_ES2_compatibility doesn't say
+ * anything about shader linking when one of the shaders (vertex or
+ * fragment shader) is absent. So, the extension shouldn't change the
+ * behavior specified in GLSL specification.
*/
- if (!prog->InternalSeparateShader &&
- (ctx->API == API_OPENGLES2 || prog->IsES)) {
+ if (!prog->InternalSeparateShader && ctx->API == API_OPENGLES2) {
if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
linker_error(prog, "program lacks a vertex shader\n");
} else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) {