[Mesa-dev] [PATCH 1/5] mesa: Add infrastructure for GL_ARB_clear_buffer_object

Ian Romanick idr at freedesktop.org
Fri Dec 20 11:53:10 PST 2013


I'm pretty sure this patch needs to add stub versions of
_mesa_ClearBufferData and _mesa_ClearBufferSubData.  Otherwise, I
believe the build breaks here.

I also think the change to dd_function_table should be in a different patch.

On 12/10/2013 05:13 AM, Pi Tabred wrote:
>  - add xml file for extension
>  - add reference in gl_API.xml
>  - add pointer to device driver function table
>  - add new functions to list of available functions
> ---
>  src/mapi/glapi/gen/ARB_clear_buffer_object.xml | 50 ++++++++++++++++++++++++++
>  src/mapi/glapi/gen/gl_API.xml                  |  6 +++-
>  src/mesa/main/dd.h                             |  5 +++
>  src/mesa/main/tests/dispatch_sanity.cpp        |  4 +--
>  4 files changed, 62 insertions(+), 3 deletions(-)
>  create mode 100644 src/mapi/glapi/gen/ARB_clear_buffer_object.xml
> 
> diff --git a/src/mapi/glapi/gen/ARB_clear_buffer_object.xml b/src/mapi/glapi/gen/ARB_clear_buffer_object.xml
> new file mode 100644
> index 0000000..e7baf6f
> --- /dev/null
> +++ b/src/mapi/glapi/gen/ARB_clear_buffer_object.xml
> @@ -0,0 +1,50 @@
> +<?xml version="1.0"?>
> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
> +
> +<!-- Note: no GLX protocol info yet. -->
> +
> +
> +<OpenGLAPI>
> +
> +<category name="GL_ARB_clear_buffer_object" number="121">
> +
> +    <function name ="ClearBufferData" offset="assign">
> +        <param name="target" type="GLenum"/>
> +        <param name="internalformat" type="GLenum"/>
> +        <param name="format" type="GLenum"/>
> +        <param name="type" type="GLenum"/>
> +        <param name="data" type="const GLvoid *"/>
> +    </function>
> +
> +    <function name ="ClearBufferSubData" offset="assign">
> +        <param name="target" type="GLenum"/>
> +        <param name="internalformat" type="GLenum"/>
> +        <param name="offset" type="GLintptr"/>
> +        <param name="size" type="GLsizeiptr"/>
> +        <param name="format" type="GLenum"/>
> +        <param name="type" type="GLenum"/>
> +        <param name="data" type="const GLvoid *"/>
> +    </function>
> +
> +<!--    <function name="ClearNamedBufferDataEXT" offset="assign" es2="3.0">
> +        <param name="buffer" type="GLuint"/>
> +        <param name="internalformat" type="GLenum"/>
> +        <param name="format" type="GLenum"/>
> +        <param name="type" type="GLenum"/>
> +        <param name="data" type="const GLvoid*"/>
> +    </function>
> +
> +
> +    <function name="ClearNamedBufferSubDataEXT" offset="assign" es2="3.0">
> +        <param name="buffer" type="GLuint"/>
> +        <param name="internalformat" type="GLenum"/>
> +        <param name="offset" type="GLintptr"/>
> +        <param name="size" type="GLsizeiptr"/>
> +        <param name="format" type="GLenum"/>
> +        <param name="type" type="GLenum"/>
> +        <param name="data" type="const GLvoid*"/>
> +    </function> -->
> +
> +</category>
> +
> +</OpenGLAPI>
> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
> index 5c877aa..af8ab2e 100644
> --- a/src/mapi/glapi/gen/gl_API.xml
> +++ b/src/mapi/glapi/gen/gl_API.xml
> @@ -8460,7 +8460,11 @@
>  
>  </category>
>  
> -<!-- ARB extensions #120...#124 -->
> +<!-- ARB extension #120 -->
> +
> +<xi:include href="ARB_clear_buffer_object.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
> +
> +<!-- ARB extensions #122...#124 -->
>  
>  <xi:include href="ARB_vertex_attrib_binding.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
>  
> diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
> index b5b874f..0e2bda0 100644
> --- a/src/mesa/main/dd.h
> +++ b/src/mesa/main/dd.h
> @@ -569,6 +569,11 @@ struct dd_function_table {
>  			     GLintptrARB offset, GLsizeiptrARB size,
>  			     GLvoid *data, struct gl_buffer_object *obj );
>  
> +   void (*ClearBufferSubData)( struct gl_context *ctx, GLenum internalformat, 
> +                               GLintptr offset, GLsizeiptr size, 
> +                               GLenum format, GLenum type, 
> +                               const GLvoid *data, struct gl_buffer_object *obj );
> +
>     void (*CopyBufferSubData)( struct gl_context *ctx,
>                                struct gl_buffer_object *src,
>                                struct gl_buffer_object *dst,
> diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
> index e57fb52..a2ed04b 100644
> --- a/src/mesa/main/tests/dispatch_sanity.cpp
> +++ b/src/mesa/main/tests/dispatch_sanity.cpp
> @@ -846,8 +846,8 @@ const struct function gl_core_functions_possible[] = {
>  // { "glGetObjectLabel", 43, -1 },                      // XXX: Add to xml
>  // { "glObjectPtrLabel", 43, -1 },                      // XXX: Add to xml
>  // { "glGetObjectPtrLabel", 43, -1 },                   // XXX: Add to xml
> -// { "glClearBufferData", 43, -1 },                     // XXX: Add to xml
> -// { "glClearBufferSubData", 43, -1 },                  // XXX: Add to xml
> +   { "glClearBufferData", 43, -1 },
> +   { "glClearBufferSubData", 43, -1 },
>  // { "glClearNamedBufferDataEXT", 43, -1 },             // XXX: Add to xml
>  // { "glClearNamedBufferSubDataEXT", 43, -1 },          // XXX: Add to xml
>  // { "glDispatchCompute", 43, -1 },                     // XXX: Add to xml
> 



More information about the mesa-dev mailing list