<div dir="ltr"><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Laura Ekstrand</b> <span dir="ltr"><<a href="mailto:laura@jlekstrand.net">laura@jlekstrand.net</a>></span><br>Date: Thu, Feb 26, 2015 at 3:43 PM<br>Subject: Re: [Mesa-dev] [PATCH 12/16] main: Added entry point for glCreateProgramPipelines<br>To: Martin Peres <<a href="mailto:martin.peres@linux.intel.com">martin.peres@linux.intel.com</a>><br><br><br><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Feb 16, 2015 at 6:14 AM, Martin Peres <span dir="ltr"><<a href="mailto:martin.peres@linux.intel.com" target="_blank">martin.peres@linux.intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Martin Peres <<a href="mailto:martin.peres@linux.intel.com" target="_blank">martin.peres@linux.intel.com</a>><br>
---<br>
src/mapi/glapi/gen/ARB_direct_state_access.xml | 7 ++++++<br>
src/mesa/main/pipelineobj.c | 35 +++++++++++++++++++++-----<br>
src/mesa/main/pipelineobj.h | 3 +++<br>
src/mesa/main/tests/dispatch_sanity.cpp | 1 +<br>
4 files changed, 40 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
index 99d2422..2102e82 100644<br>
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
@@ -308,6 +308,13 @@<br>
<param name="params" type="GLint *" /><br>
</function><br>
<br>
+ <!-- Program Pipeline object functions --><br>
+<br>
+ <function name="CreateProgramPipelines" offset="assign"><br>
+ <param name="n" type="GLsizei" /><br>
+ <param name="pipelines" type="GLuint *" /><br>
+ </function><br>
+<br>
<!-- Query object functions --><br>
<br>
<function name="CreateQueries" offset="assign"><br>
diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c<br>
index b713d95..96bf086 100644<br>
--- a/src/mesa/main/pipelineobj.c<br>
+++ b/src/mesa/main/pipelineobj.c<br>
@@ -498,16 +498,18 @@ _mesa_DeleteProgramPipelines(GLsizei n, const GLuint *pipelines)<br>
* \param n Number of IDs to generate.<br>
* \param pipelines pipeline of \c n locations to store the IDs.<br>
*/<br>
-void GLAPIENTRY<br>
-_mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines)<br>
+static void<br>
+create_program_pipelines(struct gl_context *ctx, GLsizei n, GLuint *pipelines,<br>
+ bool dsa)<br>
{<br>
- GET_CURRENT_CONTEXT(ctx);<br>
-<br>
+ const char *func;<br>
GLuint first;<br>
GLint i;<br>
<br>
+ func = dsa ? "glCreateProgramPipelines" : "glGenProgramPipelines";<br>
+<br>
if (n < 0) {<br>
- _mesa_error(ctx, GL_INVALID_VALUE, "glGenProgramPipelines(n<0)");<br>
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s (n<0)", func);<br></blockquote></div></div><div>Minor nit: There's an extra space here --------------------^ <br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
return;<br>
}<br>
<br>
@@ -523,16 +525,37 @@ _mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines)<br>
<br>
obj = _mesa_new_pipeline_object(ctx, name);<br>
if (!obj) {<br>
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenProgramPipelines");<br>
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);<br>
return;<br>
}<br>
<br>
+ if (dsa) {<br>
+ /* make dsa-allocated objects behave like program objects */<br>
+ obj->EverBound = GL_TRUE;<br>
+ }<br>
+<br>
save_pipeline_object(ctx, obj);<br>
pipelines[i] = first + i;<br>
}<br>
<br>
}<br>
<br>
+void GLAPIENTRY<br>
+_mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines)<br>
+{<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+<br>
+ create_program_pipelines(ctx, n, pipelines, false);<br>
+}<br>
+<br>
+void GLAPIENTRY<br>
+_mesa_CreateProgramPipelines(GLsizei n, GLuint *pipelines)<br>
+{<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+<br>
+ create_program_pipelines(ctx, n, pipelines, true);<br>
+}<br>
+<br>
/**<br>
* Determine if ID is the name of an pipeline object.<br>
*<br>
diff --git a/src/mesa/main/pipelineobj.h b/src/mesa/main/pipelineobj.h<br>
index 7285a78..b57bcb9 100644<br>
--- a/src/mesa/main/pipelineobj.h<br>
+++ b/src/mesa/main/pipelineobj.h<br>
@@ -82,6 +82,9 @@ _mesa_DeleteProgramPipelines(GLsizei n, const GLuint *pipelines);<br>
extern void GLAPIENTRY<br>
_mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines);<br>
<br>
+void GLAPIENTRY<br>
+_mesa_CreateProgramPipelines(GLsizei n, GLuint *pipelines);<br>
+<br>
extern GLboolean GLAPIENTRY<br>
_mesa_IsProgramPipeline(GLuint pipeline);<br>
<br>
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp<br>
index b65080e..cc2b267 100644<br>
--- a/src/mesa/main/tests/dispatch_sanity.cpp<br>
+++ b/src/mesa/main/tests/dispatch_sanity.cpp<br>
@@ -993,6 +993,7 @@ const struct function gl_core_functions_possible[] = {<br>
{ "glTextureStorage2DMultisample", 45, -1 },<br>
{ "glTextureStorage3DMultisample", 45, -1 },<br>
{ "glTextureBuffer", 45, -1 },<br>
+ { "glCreateProgramPipelines", 45, -1 },<br>
{ "glCreateQueries", 45, -1 },<br>
{ "glGetQueryBufferObjectiv", 45, -1 },<br>
{ "glGetQueryBufferObjectuiv", 45, -1 },<br>
<span><font color="#888888">--<br>
2.3.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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></font></span></blockquote><div><br></div></div></div><div>With that fixed,<br><br></div><div>Reviewed-by: Laura Ekstrand <<a href="mailto:laura@jlekstrand.net" target="_blank">laura@jlekstrand.net</a>> <br></div></div><br></div></div>
</div><br></div>