diff options
author | marha <marha@users.sourceforge.net> | 2014-10-01 20:12:35 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-10-01 20:12:35 +0200 |
commit | 19b4b68b35a047a83bd291ee8debac1adb0e946c (patch) | |
tree | d4d4520622ecf73fa0d076dc0bf517a1189b7d9f /mesalib/src/mesa/main/api_validate.c | |
parent | 4e080e0165d18887e2a0fccd7f30cf20fd04b178 (diff) | |
parent | 438af0c7d4bf60b408b259c88205ff2193195466 (diff) | |
download | vcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.tar.gz vcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.tar.bz2 vcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mesa/main/macros.h
xorg-server/dix/registry.c
xorg-server/hw/kdrive/ephyr/ephyrinit.c
xorg-server/hw/xwin/Makefile.am
xorg-server/hw/xwin/glx/.gitignore
xorg-server/hw/xwin/glx/gen_gl_wrappers.py
xorg-server/hw/xwin/glx/indirect.c
xorg-server/hw/xwin/glx/winpriv.c
xorg-server/hw/xwin/winclipboardthread.c
xorg-server/hw/xwin/windisplay.c
xorg-server/hw/xwin/winmultiwindowwm.c
xorg-server/hw/xwin/winprefs.c
Diffstat (limited to 'mesalib/src/mesa/main/api_validate.c')
-rw-r--r-- | mesalib/src/mesa/main/api_validate.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c index 8f0b1998d..51a3d1f01 100644 --- a/mesalib/src/mesa/main/api_validate.c +++ b/mesalib/src/mesa/main/api_validate.c @@ -160,47 +160,6 @@ check_valid_to_render(struct gl_context *ctx, const char *function) /** - * Do bounds checking on array element indexes. Check that the vertices - * pointed to by the indices don't lie outside buffer object bounds. - * \return GL_TRUE if OK, GL_FALSE if any indexed vertex goes is out of bounds - */ -static GLboolean -check_index_bounds(struct gl_context *ctx, GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex) -{ - struct _mesa_prim prim; - struct _mesa_index_buffer ib; - GLuint min, max; - - /* Only the X Server needs to do this -- otherwise, accessing outside - * array/BO bounds allows application termination. - */ - if (!ctx->Const.CheckArrayBounds) - return GL_TRUE; - - memset(&prim, 0, sizeof(prim)); - prim.count = count; - - memset(&ib, 0, sizeof(ib)); - ib.type = type; - ib.ptr = indices; - ib.obj = ctx->Array.VAO->IndexBufferObj; - - vbo_get_minmax_indices(ctx, &prim, &ib, &min, &max, 1); - - if ((int)(min + basevertex) < 0 || - max + basevertex >= ctx->Array.VAO->_MaxElement) { - /* the max element is out of bounds of one or more enabled arrays */ - _mesa_warning(ctx, "glDrawElements() index=%u is out of bounds (max=%u)", - max, ctx->Array.VAO->_MaxElement); - return GL_FALSE; - } - - return GL_TRUE; -} - - -/** * Is 'mode' a valid value for glBegin(), glDrawArrays(), glDrawElements(), * etc? The set of legal values depends on whether geometry shaders/programs * are supported. @@ -453,9 +412,6 @@ _mesa_validate_DrawElements(struct gl_context *ctx, return GL_FALSE; } - if (!check_index_bounds(ctx, count, type, indices, basevertex)) - return GL_FALSE; - if (count == 0) return GL_FALSE; @@ -517,12 +473,6 @@ _mesa_validate_MultiDrawElements(struct gl_context *ctx, } } - for (i = 0; i < primcount; i++) { - if (!check_index_bounds(ctx, count[i], type, indices[i], - basevertex ? basevertex[i] : 0)) - return GL_FALSE; - } - return GL_TRUE; } @@ -588,9 +538,6 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode, return GL_FALSE; } - if (!check_index_bounds(ctx, count, type, indices, basevertex)) - return GL_FALSE; - if (count == 0) return GL_FALSE; @@ -623,11 +570,6 @@ _mesa_validate_DrawArrays(struct gl_context *ctx, if (!check_valid_to_render(ctx, "glDrawArrays")) return GL_FALSE; - if (ctx->Const.CheckArrayBounds) { - if (start + count > (GLint) ctx->Array.VAO->_MaxElement) - return GL_FALSE; - } - /* From the GLES3 specification, section 2.14.2 (Transform Feedback * Primitive Capture): * @@ -692,11 +634,6 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi if (!check_valid_to_render(ctx, "glDrawArraysInstanced(invalid to render)")) return GL_FALSE; - if (ctx->Const.CheckArrayBounds) { - if (first + count > (GLint) ctx->Array.VAO->_MaxElement) - return GL_FALSE; - } - /* From the GLES3 specification, section 2.14.2 (Transform Feedback * Primitive Capture): * @@ -791,9 +728,6 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx, if (count == 0) return GL_FALSE; - if (!check_index_bounds(ctx, count, type, indices, basevertex)) - return GL_FALSE; - return GL_TRUE; } |