<div dir="ltr">As a precautionary note, one using auto tools may want to remove auto-generated source files with git clean -dxf when switching to or from an old branch with this change to make sure the auto-generated source files are regenerated. None of the existing make clean targets remove the autogenerated source or related cache files. Otherwise build errors could result.<div>
<br></div><div>Mark</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 19, 2013 at 11:27 AM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 11/09/2013 01:02 AM, Chris Forbes wrote:<br>
> Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series.<br>
><br>
> Signed-off-by: Chris Forbes <<a href="mailto:chrisf@ijw.co.nz">chrisf@ijw.co.nz</a>><br>
<br>
</div>I assume 'make check' actually passes? :)<br>
<br>
With the change below,<br>
<br>
Reviewed-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>>.<br>
<div><div class="h5"><br>
> ---<br>
> src/mapi/glapi/gen/ARB_draw_indirect.xml | 45 ++++++++++++++++++++++++++++++++<br>
> src/mapi/glapi/gen/Makefile.am | 1 +<br>
> src/mapi/glapi/gen/gl_API.xml | 4 ++-<br>
> src/mesa/main/tests/dispatch_sanity.cpp | 8 +++---<br>
> src/mesa/vbo/vbo_exec_array.c | 32 +++++++++++++++++++++++<br>
> 5 files changed, 85 insertions(+), 5 deletions(-)<br>
> create mode 100644 src/mapi/glapi/gen/ARB_draw_indirect.xml<br>
><br>
> diff --git a/src/mapi/glapi/gen/ARB_draw_indirect.xml b/src/mapi/glapi/gen/ARB_draw_indirect.xml<br>
> new file mode 100644<br>
> index 0000000..7de03cd<br>
> --- /dev/null<br>
> +++ b/src/mapi/glapi/gen/ARB_draw_indirect.xml<br>
> @@ -0,0 +1,45 @@<br>
> +<?xml version="1.0"?><br>
> +<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"><br>
> +<br>
> +<OpenGLAPI><br>
> +<br>
> +<category name="GL_ARB_draw_indirect" number="87"><br>
> +<br>
> + <enum name="DRAW_INDIRECT_BUFFER" value="0x8F3F"/><br>
> + <enum name="DRAW_INDIRECT_BUFFER_BINDING" value="0x8F43"/><br>
> +<br>
> + <function name="DrawArraysIndirect" offset="assign" exec="dynamic"><br>
> + <param name="mode" type="GLenum"/><br>
> + <param name="indirect" type="const GLvoid *"/><br>
> + </function><br>
> +<br>
> + <function name="DrawElementsIndirect" offset="assign" exec="dynamic"><br>
> + <param name="mode" type="GLenum"/><br>
> + <param name="type" type="GLenum"/><br>
> + <param name="indirect" type="const GLvoid *"/><br>
> + </function><br>
> +<br>
> +</category><br>
> +<br>
> +<br>
> +<category name="GL_ARB_multi_draw_indirect" number="133"><br>
> +<br>
> + <function name="MultiDrawArraysIndirect" offset="assign" exec="dynamic"><br>
> + <param name="mode" type="GLenum"/><br>
> + <param name="indirect" type="const GLvoid *"/><br>
> + <param name="primcount" type="GLsizei"/><br>
> + <param name="stride" type="GLsizei"/><br>
> + </function><br>
> +<br>
> + <function name="MultiDrawElementsIndirect" offset="assign" exec="dynamic"><br>
> + <param name="mode" type="GLenum"/><br>
> + <param name="type" type="GLenum"/><br>
> + <param name="indirect" type="const GLvoid *"/><br>
> + <param name="primcount" type="GLsizei"/><br>
> + <param name="stride" type="GLsizei"/><br>
> + </function><br>
> +<br>
> +</category><br>
> +<br>
> +<br>
> +</OpenGLAPI><br>
> diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am<br>
> index 476d943..7af769a 100644<br>
> --- a/src/mapi/glapi/gen/Makefile.am<br>
> +++ b/src/mapi/glapi/gen/Makefile.am<br>
> @@ -98,6 +98,7 @@ API_XML = \<br>
> ARB_draw_buffers.xml \<br>
> ARB_draw_buffers_blend.xml \<br>
> ARB_draw_elements_base_vertex.xml \<br>
> + ARB_draw_indirect.xml \<br>
> ARB_draw_instanced.xml \<br>
> ARB_ES2_compatibility.xml \<br>
> ARB_ES3_compatibility.xml \<br>
> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml<br>
> index a2d914a..5c877aa 100644<br>
> --- a/src/mapi/glapi/gen/gl_API.xml<br>
> +++ b/src/mapi/glapi/gen/gl_API.xml<br>
> @@ -8241,6 +8241,8 @@<br>
><br>
> <!-- ARB extensions #86...#93 --><br>
><br>
> +<xi:include href="ARB_draw_indirect.xml" xmlns:xi="<a href="http://www.w3.org/2001/XInclude" target="_blank">http://www.w3.org/2001/XInclude</a>"/><br>
> +<br>
> <category name="GL_ARB_transform_feedback3" number="94"><br>
> <enum name="MAX_TRANSFORM_FEEDBACK_BUFFERS" value="0x8E70"/><br>
> <enum name="MAX_VERTEX_STREAMS" value="0x8E71"/><br>
> @@ -8470,7 +8472,7 @@<br>
><br>
> <xi:include href="ARB_invalidate_subdata.xml" xmlns:xi="<a href="http://www.w3.org/2001/XInclude" target="_blank">http://www.w3.org/2001/XInclude</a>"/><br>
><br>
> -<!-- ARB extensions #133...#138 --><br>
> +<!-- ARB extensions #134...#138 --><br>
><br>
> <xi:include href="ARB_texture_buffer_range.xml" xmlns:xi="<a href="http://www.w3.org/2001/XInclude" target="_blank">http://www.w3.org/2001/XInclude</a>"/><br>
><br>
> diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp<br>
> index 922f0ac..e57fb52 100644<br>
> --- a/src/mesa/main/tests/dispatch_sanity.cpp<br>
> +++ b/src/mesa/main/tests/dispatch_sanity.cpp<br>
> @@ -667,8 +667,8 @@ const struct function gl_core_functions_possible[] = {<br>
> { "glVertexAttribP3uiv", 43, -1 },<br>
> { "glVertexAttribP4ui", 43, -1 },<br>
> { "glVertexAttribP4uiv", 43, -1 },<br>
> -// { "glDrawArraysIndirect", 43, -1 }, // XXX: Add to xml<br>
> -// { "glDrawElementsIndirect", 43, -1 }, // XXX: Add to xml<br>
> + { "glDrawArraysIndirect", 43, -1 },<br>
> + { "glDrawElementsIndirect", 43, -1 },<br>
> // { "glUniform1d", 43, -1 }, // XXX: Add to xml<br>
> // { "glUniform2d", 43, -1 }, // XXX: Add to xml<br>
> // { "glUniform3d", 43, -1 }, // XXX: Add to xml<br>
> @@ -877,8 +877,8 @@ const struct function gl_core_functions_possible[] = {<br>
> { "glInvalidateBufferData", 43, -1 },<br>
> { "glInvalidateFramebuffer", 43, -1 },<br>
> { "glInvalidateSubFramebuffer", 43, -1 },<br>
> -// { "glMultiDrawArraysIndirect", 43, -1 }, // XXX: Add to xml<br>
> -// { "glMultiDrawElementsIndirect", 43, -1 }, // XXX: Add to xml<br>
> + { "glMultiDrawArraysIndirect", 43, -1 },<br>
> + { "glMultiDrawElementsIndirect", 43, -1 },<br>
> // { "glGetProgramInterfaceiv", 43, -1 }, // XXX: Add to xml<br>
> // { "glGetProgramResourceIndex", 43, -1 }, // XXX: Add to xml<br>
> // { "glGetProgramResourceName", 43, -1 }, // XXX: Add to xml<br>
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c<br>
> index a2c0c7d..4ea10ee 100644<br>
> --- a/src/mesa/vbo/vbo_exec_array.c<br>
> +++ b/src/mesa/vbo/vbo_exec_array.c<br>
> @@ -1564,6 +1564,34 @@ vbo_exec_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,<br>
> vbo_draw_transform_feedback(ctx, mode, obj, stream, primcount);<br>
> }<br>
><br>
> +/**<br>
> + * Like [Multi]DrawArrays/Elements, but they take most arguments from<br>
> + * a buffer object.<br>
> + */<br>
> +static void GLAPIENTRY<br>
> +vbo_exec_DrawArraysIndirect(GLenum mode, const GLvoid *indirect)<br>
> +{<br>
> +}<br>
> +<br>
> +static void GLAPIENTRY<br>
> +vbo_exec_DrawElementsIndirect(GLenum mode, GLenum type,<br>
> + const GLvoid *indirect)<br>
> +{<br>
> +}<br>
> +<br>
> +static void GLAPIENTRY<br>
> +vbo_exec_MultiDrawArraysIndirect(GLenum mode,<br>
> + const GLvoid *indirect,<br>
> + GLsizei primcount, GLsizei stride)<br>
> +{<br>
> +}<br>
> +<br>
> +static void GLAPIENTRY<br>
> +vbo_exec_MultiDrawElementsIndirect(GLenum mode, GLenum type,<br>
> + const GLvoid *indirect,<br>
> + GLsizei primcount, GLsizei stride)<br>
> +{<br>
> +}<br>
><br>
> /**<br>
> * Initialize the dispatch table with the VBO functions for drawing.<br>
> @@ -1595,6 +1623,10 @@ vbo_initialize_exec_dispatch(const struct gl_context *ctx,<br>
> SET_DrawElementsInstancedBaseInstance(exec, vbo_exec_DrawElementsInstancedBaseInstance);<br>
> SET_DrawElementsInstancedBaseVertex(exec, vbo_exec_DrawElementsInstancedBaseVertex);<br>
> SET_DrawElementsInstancedBaseVertexBaseInstance(exec, vbo_exec_DrawElementsInstancedBaseVertexBaseInstance);<br>
> + SET_DrawArraysIndirect(exec, vbo_exec_DrawArraysIndirect);<br>
> + SET_DrawElementsIndirect(exec, vbo_exec_DrawElementsIndirect);<br>
> + SET_MultiDrawArraysIndirect(exec, vbo_exec_MultiDrawArraysIndirect);<br>
> + SET_MultiDrawElementsIndirect(exec, vbo_exec_MultiDrawElementsIndirect);<br>
<br>
</div></div>We should only set these dispatch pointers if it's core profile because<br>
the next patch only allows the extensions for core.<br>
<br>
> }<br>
><br>
> if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {<br>
<div class="HOEnZb"><div class="h5">><br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>