[Mesa-dev] [PATCH 14/14] mesa: add KHR_no_error support to glVertexAttribDivisor()
Nicolai Hähnle
nhaehnle at gmail.com
Thu Apr 13 09:59:39 UTC 2017
Patches 11, 12, & 14:
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
On 13.04.2017 01:42, Timothy Arceri wrote:
> ---
> src/mesa/main/varray.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
> index 3f61608..89a0984 100644
> --- a/src/mesa/main/varray.c
> +++ b/src/mesa/main/varray.c
> @@ -1782,29 +1782,31 @@ _mesa_PrimitiveRestartIndex(GLuint index)
> * the legacy vertex arrays.
> */
> void GLAPIENTRY
> _mesa_VertexAttribDivisor(GLuint index, GLuint divisor)
> {
> GET_CURRENT_CONTEXT(ctx);
>
> const GLuint genericIndex = VERT_ATTRIB_GENERIC(index);
> struct gl_vertex_array_object * const vao = ctx->Array.VAO;
>
> - if (!ctx->Extensions.ARB_instanced_arrays) {
> - _mesa_error(ctx, GL_INVALID_OPERATION, "glVertexAttribDivisor()");
> - return;
> - }
> + if (!_mesa_is_no_error_enabled(ctx)) {
> + if (!ctx->Extensions.ARB_instanced_arrays) {
> + _mesa_error(ctx, GL_INVALID_OPERATION, "glVertexAttribDivisor()");
> + return;
> + }
>
> - if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
> - _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribDivisor(index = %u)",
> - index);
> - return;
> + if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs) {
> + _mesa_error(ctx, GL_INVALID_VALUE,
> + "glVertexAttribDivisor(index = %u)", index);
> + return;
> + }
> }
>
> assert(genericIndex < ARRAY_SIZE(vao->VertexAttrib));
>
> /* The ARB_vertex_attrib_binding spec says:
> *
> * "The command
> *
> * void VertexAttribDivisor(uint index, uint divisor);
> *
>
--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
More information about the mesa-dev
mailing list