mesa: Fix the error check for VertexAttrib*.
authorEmma Anholt <emma@anholt.net>
Sun, 10 Jul 2022 15:02:51 +0000 (08:02 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 12 Jul 2022 17:15:43 +0000 (17:15 +0000)
It was checking "mesa's theoretical max attributes" rather than "the
driver's max attributes."

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17449>

src/broadcom/ci/broadcom-rpi3-fails.txt
src/mesa/vbo/vbo_exec_api.c

index 1c8a6cc..44783d7 100644 (file)
@@ -25,11 +25,6 @@ dEQP-GLES2.functional.fbo.render.texsubimage.after_render_tex2d_rgba,Fail
 # A glTexImage, glDraw, glTexSubImage, glDraw sequence into a texture is missing what looks like the first drawing.
 dEQP-GLES2.functional.fbo.render.texsubimage.between_render_tex2d_rgba,Fail
 
-# "GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS."
-# but we didn't generate an error.
-dEQP-GLES2.functional.negative_api.vertex_array.vertex_attrib,Fail
-dEQP-GLES2.functional.negative_api.vertex_array.vertex_attribv,Fail
-
 # Sampling grid slightly off in test 2?
 dEQP-GLES2.functional.texture.filtering.2d.nearest_mipmap_linear_linear_mirror_rgba8888,Fail
 dEQP-GLES2.functional.texture.filtering.2d.nearest_mipmap_linear_linear_repeat_rgba8888,Fail
index 5700811..cff420e 100644 (file)
@@ -1006,7 +1006,7 @@ static void
 VertexAttrib4f_nopos(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 {
    GET_CURRENT_CONTEXT(ctx);
-   if (index < MAX_VERTEX_GENERIC_ATTRIBS)
+   if (index < ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
       ATTRF(VBO_ATTRIB_GENERIC0 + index, 4, x, y, z, w);
    else
       ERROR(GL_INVALID_VALUE);