[Mesa-dev] [PATCH 44/57] mesa: Add ARB_direct_state_access checks in XFB functions

Ian Romanick idr at freedesktop.org
Fri May 15 11:29:10 PDT 2015


On 05/14/2015 12:51 PM, Ilia Mirkin wrote:
> Don't you have to add the checks either way? And should these have just been
> 
> if (ctx->API != CORE && (ctx->API != COMPAT || ctx->Version < 20)) {
>   ...
> }
> 
> And removing compat will just reduce these checks to
> 
> if (ctx->API != CORE)
> 
> ?

No.  If you decorate the functions properly in the XML, the would never
even get put in the dispatch table for a non-core context.  That's the
whole point.

> Cheers,
> 
>   -ilia
> 
> On Thu, May 14, 2015 at 2:55 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> I am not a fan of adding a million extra extension checks.  I understand
>> that we can't enable the extension universally due to the OpenGL 2.0
>> requirement.  Add this to the list of arguments for making this
>> extension exclusive to core profile... which I have been saying since
>> before a single line of DSA code was written. :(
>>
>> If that means I have to go and re-write all the piglit tests, fine.
>>
>> On 05/11/2015 10:27 AM, Fredrik Höglund wrote:
>>> Signed-off-by: Fredrik Höglund <fredrik at kde.org>
>>> ---
>>>  src/mesa/main/transformfeedback.c | 42 +++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 42 insertions(+)
>>>
>>> diff --git a/src/mesa/main/transformfeedback.c b/src/mesa/main/transformfeedback.c
>>> index 103011c..642fa96 100644
>>> --- a/src/mesa/main/transformfeedback.c
>>> +++ b/src/mesa/main/transformfeedback.c
>>> @@ -706,6 +706,13 @@ _mesa_TransformFeedbackBufferBase(GLuint xfb, GLuint index, GLuint buffer)
>>>     struct gl_transform_feedback_object *obj;
>>>     struct gl_buffer_object *bufObj;
>>>
>>> +   if (!ctx->Extensions.ARB_direct_state_access) {
>>> +      _mesa_error(ctx, GL_INVALID_OPERATION,
>>> +                  "glTransformFeedbackBufferBase(GL_ARB_direct_state_access "
>>> +                  "is not supported)");
>>> +      return;
>>> +   }
>>> +
>>>     obj = lookup_transform_feedback_object_err(ctx, xfb,
>>>                                                "glTransformFeedbackBufferBase");
>>>     if(!obj) {
>>> @@ -729,6 +736,13 @@ _mesa_TransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer,
>>>     struct gl_transform_feedback_object *obj;
>>>     struct gl_buffer_object *bufObj;
>>>
>>> +   if (!ctx->Extensions.ARB_direct_state_access) {
>>> +      _mesa_error(ctx, GL_INVALID_OPERATION,
>>> +                  "glTransformFeedbackBufferRange(GL_ARB_direct_state_access "
>>> +                  "is not supported)");
>>> +      return;
>>> +   }
>>> +
>>>     obj = lookup_transform_feedback_object_err(ctx, xfb,
>>>                                                "glTransformFeedbackBufferRange");
>>>     if(!obj) {
>>> @@ -1045,6 +1059,13 @@ _mesa_CreateTransformFeedbacks(GLsizei n, GLuint *names)
>>>  {
>>>     GET_CURRENT_CONTEXT(ctx);
>>>
>>> +   if (!ctx->Extensions.ARB_direct_state_access) {
>>> +      _mesa_error(ctx, GL_INVALID_OPERATION,
>>> +                  "glCreateTransformFeedbacks(GL_ARB_direct_state_access "
>>> +                  "is not supported)");
>>> +      return;
>>> +   }
>>> +
>>>     create_transform_feedbacks(ctx, n, names, true);
>>>  }
>>>
>>> @@ -1215,6 +1236,13 @@ _mesa_GetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint *param)
>>>      struct gl_transform_feedback_object *obj;
>>>      GET_CURRENT_CONTEXT(ctx);
>>>
>>> +    if (!ctx->Extensions.ARB_direct_state_access) {
>>> +       _mesa_error(ctx, GL_INVALID_OPERATION,
>>> +                   "glGetTransformFeedbackiv(GL_ARB_direct_state_access "
>>> +                   "is not supported)");
>>> +       return;
>>> +    }
>>> +
>>>      obj = lookup_transform_feedback_object_err(ctx, xfb,
>>>                                                 "glGetTransformFeedbackiv");
>>>      if(!obj) {
>>> @@ -1241,6 +1269,13 @@ _mesa_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index,
>>>     struct gl_transform_feedback_object *obj;
>>>     GET_CURRENT_CONTEXT(ctx);
>>>
>>> +   if (!ctx->Extensions.ARB_direct_state_access) {
>>> +      _mesa_error(ctx, GL_INVALID_OPERATION,
>>> +                  "glGetTransformFeedbacki_v(GL_ARB_direct_state_access "
>>> +                  "is not supported)");
>>> +      return;
>>> +   }
>>> +
>>>     obj = lookup_transform_feedback_object_err(ctx, xfb,
>>>                                                "glGetTransformFeedbacki_v");
>>>     if(!obj) {
>>> @@ -1270,6 +1305,13 @@ _mesa_GetTransformFeedbacki64_v(GLuint xfb, GLenum pname, GLuint index,
>>>     struct gl_transform_feedback_object *obj;
>>>     GET_CURRENT_CONTEXT(ctx);
>>>
>>> +   if (!ctx->Extensions.ARB_direct_state_access) {
>>> +      _mesa_error(ctx, GL_INVALID_OPERATION,
>>> +                  "glGetTransformFeedbacki64_v(GL_ARB_direct_state_access "
>>> +                  "is not supported)");
>>> +      return;
>>> +   }
>>> +
>>>     obj = lookup_transform_feedback_object_err(ctx, xfb,
>>>                                                "glGetTransformFeedbacki64_v");
>>>     if(!obj) {
>>>
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 



More information about the mesa-dev mailing list