mesa: Returns a GL_INVALID_VALUE error if num of fbos in glDeleteFramebuffers is negative

Per GLES3 manual for glDeleteFramebuffers
<https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteFramebuffers.xhtml>,
GL_INVALID_VALUE is generated if n is negative.

Fixes 1 dEQP test:
* dEQP-GLES3.functional.negative_api.buffer.delete_framebuffers

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Eduardo Lima Mitev 2014-12-11 23:34:17 +01:00 committed by Iago Toral Quiroga
parent f408c333e2
commit f77a473497
1 changed files with 5 additions and 0 deletions

View File

@ -2203,6 +2203,11 @@ _mesa_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
GLint i;
GET_CURRENT_CONTEXT(ctx);
if (n < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glDeleteFramebuffers(n < 0)");
return;
}
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
for (i = 0; i < n; i++) {