summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2011-02-03 17:10:14 -0800
committerIan Romanick <ian.d.romanick@intel.com>2011-02-04 12:10:04 -0800
commitce9171f9d8e0e2c2422fdddb198f8d548381b7ea (patch)
treecd7f1f65b7b384f6251d07a269eea75b39db97b2 /src
parent425ba198321b06b8c399812210228a42b4dd9fc7 (diff)
linker: Generate link errors when ES shaders are missing stages
ES requires that a vertex shader and a fragment shader be present. Fixes bugzilla #32214.
Diffstat (limited to 'src')
-rw-r--r--src/glsl/linker.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp
index c7fb62437d..46cd1950c8 100644
--- a/src/glsl/linker.cpp
+++ b/src/glsl/linker.cpp
@@ -1682,6 +1682,20 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
demote_shader_inputs_and_outputs(sh, ir_var_in);
}
+ /* OpenGL ES requires that a vertex shader and a fragment shader both be
+ * present in a linked program. By checking for use of shading language
+ * version 1.00, we also catch the GL_ARB_ES2_compatibility case.
+ */
+ if (ctx->API == API_OPENGLES2 || prog->Version == 100) {
+ if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) {
+ linker_error_printf(prog, "program lacks a vertex shader\n");
+ prog->LinkStatus = false;
+ } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) {
+ linker_error_printf(prog, "program lacks a fragment shader\n");
+ prog->LinkStatus = false;
+ }
+ }
+
/* FINISHME: Assign fragment shader output locations. */
done: