aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-09-21 18:11:28 +0200
committermarha <marha@users.sourceforge.net>2014-09-21 18:11:28 +0200
commit438af0c7d4bf60b408b259c88205ff2193195466 (patch)
tree46fd6465cb7431f64a3cb475a40587a261983af4 /mesalib/src/mesa/main/api_validate.c
parentd0f70707dde032e662dbd5bc70df6ac915403abe (diff)
downloadvcxsrv-438af0c7d4bf60b408b259c88205ff2193195466.tar.gz
vcxsrv-438af0c7d4bf60b408b259c88205ff2193195466.tar.bz2
vcxsrv-438af0c7d4bf60b408b259c88205ff2193195466.zip
libxtrans xkeyboard-config xserver mesa plink glproto git update 21 Sep 2014
plink revision 10233 xserver commit 28337cb14e4347e1dd7936c5393a22e042866687 xkeyboard-config commit 48e1c0b351b6711edc0f167cbb81e4424b75291a glproto commit bd3d751e1eb17efb39f65093271bb4ac071aa9e0 libxtrans commit fb7f198c88e97d22c8c89e76e9cd06b2b2720a96 mesa commit 4eb2bbefd2bf0359aff7ebbb8e931a1c7833606f
Diffstat (limited to 'mesalib/src/mesa/main/api_validate.c')
-rw-r--r--mesalib/src/mesa/main/api_validate.c66
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;
}