<div dir="ltr"><div>LGTM.<br><br></div>Reviewed-by: Laura Ekstrand <<a href="mailto:laura@jlekstrand.net">laura@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">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">martin.peres@linux.intel.com</a>><br>
---<br>
src/mapi/glapi/gen/ARB_direct_state_access.xml | 7 +++++++<br>
src/mesa/main/samplerobj.c | 26 ++++++++++++++++++++------<br>
src/mesa/main/samplerobj.h | 2 ++<br>
src/mesa/main/tests/dispatch_sanity.cpp | 1 +<br>
4 files changed, 30 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 2102e82..db85ea3 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>
+ <!-- Sampler object functions --><br>
+<br>
+ <function name="CreateSamplers" offset="assign"><br>
+ <param name="n" type="GLsizei" /><br>
+ <param name="samplers" type="GLuint *" /><br>
+ </function><br>
+<br>
<!-- Program Pipeline object functions --><br>
<br>
<function name="CreateProgramPipelines" offset="assign"><br>
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c<br>
index cadc9cc..5e44ece 100644<br>
--- a/src/mesa/main/samplerobj.c<br>
+++ b/src/mesa/main/samplerobj.c<br>
@@ -181,19 +181,19 @@ _mesa_delete_sampler_object(struct gl_context *ctx,<br>
free(sampObj);<br>
}<br>
<br>
-<br>
-void GLAPIENTRY<br>
-_mesa_GenSamplers(GLsizei count, GLuint *samplers)<br>
+static void<br>
+create_samplers(struct gl_context *ctx, GLsizei count, GLuint *samplers,<br>
+ bool dsa)<br>
{<br>
- GET_CURRENT_CONTEXT(ctx);<br>
+ const char *func = dsa ? "glCreateSamplers" : "glGenSamplers";<br>
GLuint first;<br>
GLint i;<br>
<br>
if (MESA_VERBOSE & VERBOSE_API)<br>
- _mesa_debug(ctx, "glGenSamplers(%d)\n", count);<br>
+ _mesa_debug(ctx, "%s(%d)\n", func, count);<br>
<br>
if (count < 0) {<br>
- _mesa_error(ctx, GL_INVALID_VALUE, "glGenSamplers");<br>
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(n<0)", func);<br>
return;<br>
}<br>
<br>
@@ -211,6 +211,20 @@ _mesa_GenSamplers(GLsizei count, GLuint *samplers)<br>
}<br>
}<br>
<br>
+void GLAPIENTRY<br>
+_mesa_GenSamplers(GLsizei count, GLuint *samplers)<br>
+{<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+ create_samplers(ctx, count, samplers, false);<br>
+}<br>
+<br>
+void GLAPIENTRY<br>
+_mesa_CreateSamplers(GLsizei count, GLuint *samplers)<br>
+{<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+ create_samplers(ctx, count, samplers, true);<br>
+}<br>
+<br>
<br>
void GLAPIENTRY<br>
_mesa_DeleteSamplers(GLsizei count, const GLuint *samplers)<br>
diff --git a/src/mesa/main/samplerobj.h b/src/mesa/main/samplerobj.h<br>
index 1bb3193..988b874 100644<br>
--- a/src/mesa/main/samplerobj.h<br>
+++ b/src/mesa/main/samplerobj.h<br>
@@ -80,6 +80,8 @@ _mesa_init_sampler_object_functions(struct dd_function_table *driver);<br>
void GLAPIENTRY<br>
_mesa_GenSamplers(GLsizei count, GLuint *samplers);<br>
void GLAPIENTRY<br>
+_mesa_CreateSamplers(GLsizei count, GLuint *samplers);<br>
+void GLAPIENTRY<br>
_mesa_DeleteSamplers(GLsizei count, const GLuint *samplers);<br>
GLboolean GLAPIENTRY<br>
_mesa_IsSampler(GLuint sampler);<br>
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp<br>
index cc2b267..cfbd1a2 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>
+ { "glCreateSamplers", 45, -1 },<br>
{ "glCreateProgramPipelines", 45, -1 },<br>
{ "glCreateQueries", 45, -1 },<br>
{ "glGetQueryBufferObjectiv", 45, -1 },<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.3.0<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>
</font></span></blockquote></div><br></div>