Re: [Mesa-dev] [PATCH 2/2] mesa: throw error if bufSize negative in GetSynciv on OpenGL ES
On 10/07/2016 10:48 AM, Kenneth Graunke wrote: On Friday, October 7, 2016 8:52:19 AM PDT Tapani Pälli wrote: Fixes following dEQP tests: dEQP-GLES31.functional.debug.negative_coverage.callbacks.state.get_synciv dEQP-GLES31.functional.debug.negative_coverage.get_error.state.get_synciv dEQP-GLES31.functional.debug.negative_coverage.log.state.get_synciv Signed-off-by: Tapani PälliBugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98133 --- src/mesa/main/syncobj.c | 8 1 file changed, 8 insertions(+) diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index be758dd..3684c37 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -425,6 +425,14 @@ _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, return; } + /* Section 4.1.3 (Sync Object Queries) of the OpenGL ES 3.10 spec says: +* +*"An INVALID_VALUE error is generated if bufSize is negative." +*/ + if (_mesa_is_gles(ctx) && bufSize < 0) { GL 4.3 has the same text. GL 4.2 doesn't seem to, but I think it's reasonable to enforce it all the time. If you drop the _mesa_is_gles(ctx), this would get a: Reviewed-by: Kenneth Graunke OK, I'll drop the check (and rerun CI) + _mesa_error(ctx, GL_INVALID_VALUE, "glGetSynciv(pname=0x%x)\n", pname); + } + if (size > 0 && bufSize > 0) { const GLsizei copy_count = MIN2(size, bufSize); ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 2/2] mesa: throw error if bufSize negative in GetSynciv on OpenGL ES
On Friday, October 7, 2016 8:52:19 AM PDT Tapani Pälli wrote: > Fixes following dEQP tests: > >dEQP-GLES31.functional.debug.negative_coverage.callbacks.state.get_synciv >dEQP-GLES31.functional.debug.negative_coverage.get_error.state.get_synciv >dEQP-GLES31.functional.debug.negative_coverage.log.state.get_synciv > > Signed-off-by: Tapani Pälli> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98133 > --- > src/mesa/main/syncobj.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c > index be758dd..3684c37 100644 > --- a/src/mesa/main/syncobj.c > +++ b/src/mesa/main/syncobj.c > @@ -425,6 +425,14 @@ _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei > bufSize, GLsizei *length, >return; > } > > + /* Section 4.1.3 (Sync Object Queries) of the OpenGL ES 3.10 spec says: > +* > +*"An INVALID_VALUE error is generated if bufSize is negative." > +*/ > + if (_mesa_is_gles(ctx) && bufSize < 0) { GL 4.3 has the same text. GL 4.2 doesn't seem to, but I think it's reasonable to enforce it all the time. If you drop the _mesa_is_gles(ctx), this would get a: Reviewed-by: Kenneth Graunke > + _mesa_error(ctx, GL_INVALID_VALUE, "glGetSynciv(pname=0x%x)\n", pname); > + } > + > if (size > 0 && bufSize > 0) { >const GLsizei copy_count = MIN2(size, bufSize); > > signature.asc Description: This is a digitally signed message part. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/2] mesa: throw error if bufSize negative in GetSynciv on OpenGL ES
Fixes following dEQP tests: dEQP-GLES31.functional.debug.negative_coverage.callbacks.state.get_synciv dEQP-GLES31.functional.debug.negative_coverage.get_error.state.get_synciv dEQP-GLES31.functional.debug.negative_coverage.log.state.get_synciv Signed-off-by: Tapani PälliBugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98133 --- src/mesa/main/syncobj.c | 8 1 file changed, 8 insertions(+) diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index be758dd..3684c37 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -425,6 +425,14 @@ _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, return; } + /* Section 4.1.3 (Sync Object Queries) of the OpenGL ES 3.10 spec says: +* +*"An INVALID_VALUE error is generated if bufSize is negative." +*/ + if (_mesa_is_gles(ctx) && bufSize < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGetSynciv(pname=0x%x)\n", pname); + } + if (size > 0 && bufSize > 0) { const GLsizei copy_count = MIN2(size, bufSize); -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev