aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-02-15 08:16:33 +0100
committermarha <marha@users.sourceforge.net>2013-02-15 08:16:33 +0100
commit6f6a2340d40759b77ef43965efdd24f3e4e623fd (patch)
treeeb25fb9622df69a72ee33e655617a1127780cb90 /mesalib/src/mesa/main/shaderapi.c
parentb41f74438672dd682bc01ae818cb3da654f22c1e (diff)
downloadvcxsrv-6f6a2340d40759b77ef43965efdd24f3e4e623fd.tar.gz
vcxsrv-6f6a2340d40759b77ef43965efdd24f3e4e623fd.tar.bz2
vcxsrv-6f6a2340d40759b77ef43965efdd24f3e4e623fd.zip
libxcb mesa xserver xkeyboard-config git update 15 Feb 2013
xserver commit 90642948cc78834d95f7a3bddaac7ff77b68ed7e libxcb commit 0dd8f8d26a758bc385e79d9239bf6ef2e3d7bf13 xkeyboard-config commit 067b0e4fd8d4fe707d86b24ae83bcacb61624231 mesa commit 6dbe94c12cd1b3b912a7083055178e0dfd7372af
Diffstat (limited to 'mesalib/src/mesa/main/shaderapi.c')
-rw-r--r--mesalib/src/mesa/main/shaderapi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c
index 2590abe7e..be6946798 100644
--- a/mesalib/src/mesa/main/shaderapi.c
+++ b/mesalib/src/mesa/main/shaderapi.c
@@ -207,6 +207,8 @@ attach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
struct gl_shader *sh;
GLuint i, n;
+ const bool same_type_disallowed = _mesa_is_gles(ctx);
+
shProg = _mesa_lookup_shader_program_err(ctx, program, "glAttachShader");
if (!shProg)
return;
@@ -227,6 +229,18 @@ attach_shader(struct gl_context *ctx, GLuint program, GLuint shader)
*/
_mesa_error(ctx, GL_INVALID_OPERATION, "glAttachShader");
return;
+ } else if (same_type_disallowed &&
+ shProg->Shaders[i]->Type == sh->Type) {
+ /* Shader with the same type is already attached to this program,
+ * OpenGL ES 2.0 and 3.0 specs say:
+ *
+ * "Multiple shader objects of the same type may not be attached
+ * to a single program object. [...] The error INVALID_OPERATION
+ * is generated if [...] another shader object of the same type
+ * as shader is already attached to program."
+ */
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glAttachShader");
+ return;
}
}