[Mesa-dev] [PATCH] mesa: raise error for glEnable(GL_VERTEX_ARRAY), etc. in core profile

Brian Paul brianp at vmware.com
Mon May 23 21:13:25 UTC 2016


On 05/23/2016 03:03 PM, Ilia Mirkin wrote:
> On Mon, May 23, 2016 at 4:35 PM, Brian Paul <brianp at vmware.com> wrote:
>> Otherwise, if the call executes normally we'll hit an assertion later
>> in the VBO code when we draw something.  Note that these cases were
>> already handled correctly for the glIsEnabled() function (and the API
>> checks were copied from there).
>>
>> Tested with new piglit gl-3.1-enable-vertex-array test.
>>
>> Cc: <mesa-stable at lists.freedesktop.org>
>> ---
>>   src/mesa/main/enable.c | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
>> index d283077..0e10961 100644
>> --- a/src/mesa/main/enable.c
>> +++ b/src/mesa/main/enable.c
>> @@ -741,12 +741,18 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
>>         case GL_VERTEX_ARRAY:
>>         case GL_NORMAL_ARRAY:
>>         case GL_COLOR_ARRAY:
>> -      case GL_INDEX_ARRAY:
>>         case GL_TEXTURE_COORD_ARRAY:
>> +         if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
>> +            goto invalid_enum_error;
>> +         client_state( ctx, cap, state );
>> +         return;
>>         case GL_EDGE_FLAG_ARRAY:
>> +      case GL_INDEX_ARRAY:
>
> in IsEnabled it has:
>
>        case GL_INDEX_ARRAY:
>           if (ctx->API != API_OPENGL_COMPAT)
>              goto invalid_enum_error;
>
>>         case GL_FOG_COORDINATE_ARRAY_EXT:
>>         case GL_SECONDARY_COLOR_ARRAY_EXT:
>>         case GL_POINT_SIZE_ARRAY_OES:
>> +         if (ctx->API != API_OPENGLES)
>
> I think this needs to be != API_OPENGL_COMPAT, and then make a
> separate section for POINT_SIZE_ARRAY_OES which should be != OPENGLES.

Yes, you're right.  I'll fix that.  Thanks!

-Brian

>
>> +            goto invalid_enum_error;
>>            client_state( ctx, cap, state );
>>            return;
>>
>> --
>> 1.9.1
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=CwIBaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=DLPg9ADujmq2Re09CJwKoHrVjEMdx6k17RLdxs--PYU&s=hbzLNZkgrPoDmeu07hQO4O200HTxx6pQd02x3fcsikc&e=



More information about the mesa-dev mailing list