diff options
author | Marta Lofstedt <[email protected]> | 2015-08-13 14:38:14 +0200 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2015-08-17 10:29:07 +0300 |
commit | 19a5a91ea49bd411f4d438d416000d49ecc2de7e (patch) | |
tree | 5354fc1c86ae3bc86eaf7ecc9dc400c61182eb35 | |
parent | dd9d2963d66d24394b20823fcffb809cc8d5389d (diff) |
mesa: Raise INVALID_VALUE from glCreateShaderProgramv if count < 0
According to OpenGL version 4.5 and OpenGL ES 3.1 standards, section 7.3:
GL_INVALID_VALUE should be generated, if count is less than 0.
V2: Changed title, eased Open GL ES 3.1 restriction and added comments.
Signed-off-by: Marta Lofstedt <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r-- | src/mesa/main/shaderapi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index f9a7d130f9c..16222747905 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -2003,6 +2003,15 @@ _mesa_create_shader_program(struct gl_context* ctx, GLboolean separate, const GLuint shader = create_shader(ctx, type); GLuint program = 0; + /* + * According to OpenGL 4.5 and OpenGL ES 3.1 standards, section 7.3: + * GL_INVALID_VALUE should be generated if count < 0 + */ + if (count < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glCreateShaderProgram (count < 0)"); + return program; + } + if (shader) { _mesa_ShaderSource(shader, count, strings, NULL); |