[Mesa-dev] [PATCH 01/11] glapi: add entry points for GL_ARB_compute_variable_group_size

Samuel Pitoiset samuel.pitoiset at gmail.com
Sat Sep 10 13:23:28 UTC 2016



On 09/09/2016 08:22 PM, Ian Romanick wrote:
> On 09/09/2016 08:46 AM, Samuel Pitoiset wrote:
>>
>>
>> On 09/08/2016 10:58 PM, Ian Romanick wrote:
>>> On 09/08/2016 01:31 PM, Samuel Pitoiset wrote:
>>>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>>>> ---
>>>>  .../glapi/gen/ARB_compute_variable_group_size.xml  | 25
>>>> ++++++++++++++++++++++
>>>>  src/mapi/glapi/gen/Makefile.am                     |  1 +
>>>>  src/mapi/glapi/gen/gl_API.xml                      |  2 ++
>>>>  src/mesa/main/compute.c                            |  8 +++++++
>>>>  src/mesa/main/compute.h                            |  5 +++++
>>>>  src/mesa/main/tests/dispatch_sanity.cpp            |  3 +++
>>>>  6 files changed, 44 insertions(+)
>>>>  create mode 100644
>>>> src/mapi/glapi/gen/ARB_compute_variable_group_size.xml
>>>>
>>>> diff --git a/src/mapi/glapi/gen/ARB_compute_variable_group_size.xml
>>>> b/src/mapi/glapi/gen/ARB_compute_variable_group_size.xml
>>>> new file mode 100644
>>>> index 0000000..b21c52f
>>>> --- /dev/null
>>>> +++ b/src/mapi/glapi/gen/ARB_compute_variable_group_size.xml
>>>> @@ -0,0 +1,25 @@
>>>> +<?xml version="1.0"?>
>>>> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
>>>> +
>>>> +<!-- Note: no GLX protocol info yet. -->
>>>> +
>>>> +
>>>> +<OpenGLAPI>
>>>> +
>>>> +<category name="GL_ARB_compute_variable_group_size" number="153">
>>>> +  <enum name="MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB"
>>>> value="0x9344"/>
>>>> +  <enum name="MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB"
>>>> value="0x90EB"/>
>>>> +  <enum name="MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB"
>>>> value="0x9345"/>
>>>> +  <enum name="MAX_COMPUTE_FIXED_GROUP_SIZE_ARB"
>>>> value="0x91BF"/>
>>>> +
>>>> +  <function name="DispatchComputeGroupSizeARB">
>>>> +    <param name="num_groups_x" type="GLuint"/>
>>>> +    <param name="num_groups_y" type="GLuint"/>
>>>> +    <param name="num_groups_z" type="GLuint"/>
>>>> +    <param name="group_size_x" type="GLuint"/>
>>>> +    <param name="group_size_y" type="GLuint"/>
>>>> +    <param name="group_size_z" type="GLuint"/>
>>>> +  </function>
>>>> +</category>
>>>> +
>>>> +</OpenGLAPI>
>>>> diff --git a/src/mapi/glapi/gen/Makefile.am
>>>> b/src/mapi/glapi/gen/Makefile.am
>>>> index 0d7c338..49fdfe3 100644
>>>> --- a/src/mapi/glapi/gen/Makefile.am
>>>> +++ b/src/mapi/glapi/gen/Makefile.am
>>>> @@ -117,6 +117,7 @@ API_XML = \
>>>>      ARB_color_buffer_float.xml \
>>>>      ARB_compressed_texture_pixel_storage.xml \
>>>>      ARB_compute_shader.xml \
>>>> +    ARB_compute_variable_group_size.xml \
>>>>      ARB_copy_buffer.xml \
>>>>      ARB_copy_image.xml \
>>>>      ARB_debug_output.xml \
>>>> diff --git a/src/mapi/glapi/gen/gl_API.xml
>>>> b/src/mapi/glapi/gen/gl_API.xml
>>>> index c39aa22..9ad3b60 100644
>>>> --- a/src/mapi/glapi/gen/gl_API.xml
>>>> +++ b/src/mapi/glapi/gen/gl_API.xml
>>>> @@ -8258,6 +8258,8 @@
>>>>
>>>>  <xi:include href="ARB_indirect_parameters.xml"
>>>> xmlns:xi="http://www.w3.org/2001/XInclude"/>
>>>>
>>>> +<xi:include href="ARB_compute_variable_group_size.xml"
>>>> xmlns:xi="http://www.w3.org/2001/XInclude"/>
>>>> +
>>>
>>> This (extension #153) should go before ARB_indirect_parameters
>>> (extension #154), and the "ARB extensions 149 - 153" should be changed
>>> to "ARB extensions 149 - 152".
>>
>> Presumably, you meant "ARB extensions 149 - 154"? Because the next
>> section is "ARB extension 155 - 159".
>
> I meant what I said.  The 'ARB extensions ...' comments are placeholders
> for extensions that are not there.  Previously only 154 was there, hence
> the 149-153 and 155-159.  You're adding 153, so those become 149-152 and
> 155-159.
>
> Looking at this more closely... there are some other errors here
> unrelated to your change.  I know we support
> GL_ARB_texture_mirror_clamp_to_edge (extension #149),
> GL_ARB_texture_stencil8 (extension #150), and
> GL_ARB_vertex_type_10f_11f_11f_rev (extension #151).  I think these are
> all extensions that just enable pre-existing enums in new places, so
> they don't add anything new for this file.  A reasonable follow-up patch
> would be to add blocks for these extensions like the existing
> GL_ARB_texture_non_power_of_two block:
>
> <category name="GL_ARB_texture_mirror_clamp_to_edge" number="149">
>     <!-- No new functions, types, enums. -->
> </category>
>
> It may not be worth the effort.

Indeed. I might come up with a series the next week.

>
>>> With that fixed, this patch is
>>>
>>> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
>>>
>>>>  <!-- ARB extensions 155 - 159 -->
>>>>
>>>>  <xi:include href="ARB_clip_control.xml"
>>>> xmlns:xi="http://www.w3.org/2001/XInclude"/>
>>>> diff --git a/src/mesa/main/compute.c b/src/mesa/main/compute.c
>>>> index b71430f..b052bae 100644
>>>> --- a/src/mesa/main/compute.c
>>>> +++ b/src/mesa/main/compute.c
>>>> @@ -60,3 +60,11 @@ _mesa_DispatchComputeIndirect(GLintptr indirect)
>>>>
>>>>     ctx->Driver.DispatchComputeIndirect(ctx, indirect);
>>>>  }
>>>> +
>>>> +void GLAPIENTRY
>>>> +_mesa_DispatchComputeGroupSizeARB(GLuint num_groups_x, GLuint
>>>> num_groups_y,
>>>> +                                  GLuint num_groups_z, GLuint
>>>> group_size_x,
>>>> +                                  GLuint group_size_y, GLuint
>>>> group_size_z)
>>>> +{
>>>> +
>>>> +}
>>>> diff --git a/src/mesa/main/compute.h b/src/mesa/main/compute.h
>>>> index 0cc034f..8018bbb 100644
>>>> --- a/src/mesa/main/compute.h
>>>> +++ b/src/mesa/main/compute.h
>>>> @@ -35,4 +35,9 @@ _mesa_DispatchCompute(GLuint num_groups_x,
>>>>  extern void GLAPIENTRY
>>>>  _mesa_DispatchComputeIndirect(GLintptr indirect);
>>>>
>>>> +extern void GLAPIENTRY
>>>> +_mesa_DispatchComputeGroupSizeARB(GLuint num_groups_x, GLuint
>>>> num_groups_y,
>>>> +                                  GLuint num_groups_z, GLuint
>>>> group_size_x,
>>>> +                                  GLuint group_size_y, GLuint
>>>> group_size_z);
>>>> +
>>>>  #endif
>>>> diff --git a/src/mesa/main/tests/dispatch_sanity.cpp
>>>> b/src/mesa/main/tests/dispatch_sanity.cpp
>>>> index 42fe61a..7faeabe 100644
>>>> --- a/src/mesa/main/tests/dispatch_sanity.cpp
>>>> +++ b/src/mesa/main/tests/dispatch_sanity.cpp
>>>> @@ -942,6 +942,9 @@ const struct function
>>>> common_desktop_functions_possible[] = {
>>>>     { "glDispatchCompute", 43, -1 },
>>>>     { "glDispatchComputeIndirect", 43, -1 },
>>>>
>>>> +   /* GL_ARB_compute_variable_group_size */
>>>> +   { "glDispatchComputeGroupSizeARB", 43, -1 },
>>>> +
>>>>     /* GL_EXT_polygon_offset_clamp */
>>>>     { "glPolygonOffsetClampEXT", 11, -1 },
>>>>
>>>>
>


More information about the mesa-dev mailing list