[Mesa-dev] [PATCH] mesa: add KHR_no_error support to glDrawRangeElements*()
Samuel Pitoiset
samuel.pitoiset at gmail.com
Thu Jun 8 08:17:39 UTC 2017
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
On 06/08/2017 08:15 AM, Timothy Arceri wrote:
> ---
> src/mesa/vbo/vbo_exec_array.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 437d260..4f86d19 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -941,23 +941,30 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
> GLuint max_element = 2 * 1000 * 1000 * 1000; /* just a big number */
>
> GET_CURRENT_CONTEXT(ctx);
>
> if (MESA_VERBOSE & VERBOSE_DRAW)
> _mesa_debug(ctx,
> "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, %d)\n",
> _mesa_enum_to_string(mode), start, end, count,
> _mesa_enum_to_string(type), indices, basevertex);
>
> - if (!_mesa_validate_DrawRangeElements(ctx, mode, start, end, count,
> - type, indices))
> - return;
> + if (_mesa_is_no_error_enabled(ctx)) {
> + FLUSH_CURRENT(ctx, 0);
> +
> + if (ctx->NewState)
> + _mesa_update_state(ctx);
> + } else {
> + if (!_mesa_validate_DrawRangeElements(ctx, mode, start, end, count,
> + type, indices))
> + return;
> + }
>
> if ((int) end + basevertex < 0 || start + basevertex >= max_element) {
> /* The application requested we draw using a range of indices that's
> * outside the bounds of the current VBO. This is invalid and appears
> * to give undefined results. The safest thing to do is to simply
> * ignore the range, in case the application botched their range tracking
> * but did provide valid indices. Also issue a warning indicating that
> * the application is broken.
> */
> if (warnCount++ < 10) {
>
More information about the mesa-dev
mailing list