<div dir="ltr">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/fbobject.c | 37 +++++++++++++++++++++-----<br>
src/mesa/main/fbobject.h | 3 +++<br>
src/mesa/main/tests/dispatch_sanity.cpp | 1 +<br>
4 files changed, 41 insertions(+), 7 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 db85ea3..8c9ddbb 100644<br>
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml<br>
@@ -48,6 +48,13 @@<br>
<param name="param" type="GLint64 *" /><br>
</function><br>
<br>
+ <!-- Renderbuffer object functions --><br>
+<br>
+ <function name="CreateRenderbuffers" offset="assign"><br>
+ <param name="n" type="GLsizei" /><br>
+ <param name="renderbuffers" type="GLuint *" /><br>
+ </function><br>
+<br>
<!-- Texture object functions --><br>
<br>
<function name="CreateTextures" offset="assign"><br>
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c<br>
index 09c931d..c93e188 100644<br>
--- a/src/mesa/main/fbobject.c<br>
+++ b/src/mesa/main/fbobject.c<br>
@@ -1383,16 +1383,17 @@ _mesa_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)<br>
}<br>
}<br>
<br>
-<br>
-void GLAPIENTRY<br>
-_mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers)<br>
+static void<br>
+create_render_buffers(struct gl_context *ctx, GLsizei n, GLuint *renderbuffers,<br>
+ bool dsa)<br>
{<br>
- GET_CURRENT_CONTEXT(ctx);<br>
+ struct gl_renderbuffer *obj;<br>
GLuint first;<br>
GLint i;<br>
<br>
if (n < 0) {<br>
- _mesa_error(ctx, GL_INVALID_VALUE, "glGenRenderbuffersEXT(n)");<br>
+ _mesa_error(ctx, GL_INVALID_VALUE, "%s(n<0)",<br>
+ dsa ? "glCreateRenderbuffers" : "glGenRenderbuffers");<br>
return;<br>
}<br>
<br>
@@ -1404,14 +1405,36 @@ _mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers)<br>
for (i = 0; i < n; i++) {<br>
GLuint name = first + i;<br>
renderbuffers[i] = name;<br>
- /* insert dummy placeholder into hash table */<br>
+<br>
+ if (dsa) {<br>
+ obj = _mesa_new_renderbuffer(ctx, name);<br>
+ } else {<br>
+ obj = &DummyRenderbuffer;<br>
+ }<br>
+ /* insert the object into the hash table */<br>
mtx_lock(&ctx->Shared->Mutex);<br>
- _mesa_HashInsert(ctx->Shared->RenderBuffers, name, &DummyRenderbuffer);<br>
+ _mesa_HashInsert(ctx->Shared->RenderBuffers, name, obj);<br>
mtx_unlock(&ctx->Shared->Mutex);<br>
}<br>
}<br>
<br>
<br>
+void GLAPIENTRY<br>
+_mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers)<br>
+{<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+ create_render_buffers(ctx, n, renderbuffers, false);<br>
+}<br>
+<br>
+<br>
+void GLAPIENTRY<br>
+_mesa_CreateRenderbuffers(GLsizei n, GLuint *renderbuffers)<br>
+{<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+ create_render_buffers(ctx, n, renderbuffers, true);<br>
+}<br>
+<br>
+<br>
/**<br>
* Given an internal format token for a render buffer, return the<br>
* corresponding base format (one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX,<br>
diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h<br>
index 77fdef4..9ab6b0b 100644<br>
--- a/src/mesa/main/fbobject.h<br>
+++ b/src/mesa/main/fbobject.h<br>
@@ -115,6 +115,9 @@ extern void GLAPIENTRY<br>
_mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers);<br>
<br>
extern void GLAPIENTRY<br>
+_mesa_CreateRenderbuffers(GLsizei n, GLuint *renderbuffers);<br>
+<br>
+extern void GLAPIENTRY<br>
_mesa_RenderbufferStorage(GLenum target, GLenum internalformat,<br>
GLsizei width, GLsizei height);<br>
<br>
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp<br>
index cfbd1a2..34e52d2 100644<br>
--- a/src/mesa/main/tests/dispatch_sanity.cpp<br>
+++ b/src/mesa/main/tests/dispatch_sanity.cpp<br>
@@ -961,6 +961,7 @@ const struct function gl_core_functions_possible[] = {<br>
{ "glGetTransformFeedbackiv", 45, -1 },<br>
{ "glGetTransformFeedbacki_v", 45, -1 },<br>
{ "glGetTransformFeedbacki64_v", 45, -1 },<br>
+ { "glCreateRenderbuffers", 45, -1 },<br>
{ "glCreateTextures", 45, -1 },<br>
{ "glTextureStorage1D", 45, -1 },<br>
{ "glTextureStorage2D", 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>