mesa: add EXT_dsa glNamedRenderbufferStorageEXT and glGetNamedRenderbufferParameterivEXT
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 23 May 2019 14:34:16 +0000 (16:34 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 18 Oct 2019 08:26:26 +0000 (10:26 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mapi/glapi/gen/EXT_direct_state_access.xml
src/mapi/glapi/gen/static_data.py
src/mesa/main/fbobject.c
src/mesa/main/fbobject.h
src/mesa/main/tests/dispatch_sanity.cpp

index 32fa40949810f58bafc765daf448530e7e6b13a6..d01521b75d1a3f5f91d8dd26ecfdf74a18b35bd4 100644 (file)
       <param name="index" type="GLuint" />
       <param name="params" type="GLvoid**" />
    </function>
+
+   <function name="NamedRenderbufferStorageEXT">
+      <param name="renderbuffer" type="GLuint" />
+      <param name="internalformat" type="GLenum" />
+      <param name="width" type="GLsizei" />
+      <param name="height" type="GLsizei" />
+   </function>
+
+   <function name="GetNamedRenderbufferParameterivEXT">
+      <param name="renderbuffer" type="GLuint" />
+      <param name="pname" type="GLenum" />
+      <param name="params" type="GLint *" />
+   </function>
 </category>
 </OpenGLAPI>
index 2f3e448750a4dd31c0d8b9ce0f9f316e092b14b8..bd37a34f6f606574d8fdf44240d59b124381cca5 100644 (file)
@@ -1569,6 +1569,8 @@ offsets = {
     "GetMultiTexLevelParameterfvEXT": 1533,
     "FramebufferParameteriMESA": 1534,
     "GetFramebufferParameterivMESA": 1535,
+    "NamedRenderbufferStorageEXT": 1536,
+    "GetNamedRenderbufferParameterivEXT": 1537,
 }
 
 functions = [
index 50ba6dd7fad0fe4e24db214ba523451d5d45bd94..7ae7727c9c2670649606e2b888c9a5d286ffa372 100644 (file)
@@ -2707,6 +2707,22 @@ _mesa_NamedRenderbufferStorage(GLuint renderbuffer, GLenum internalformat,
                               NO_SAMPLES, 0, "glNamedRenderbufferStorage");
 }
 
+void GLAPIENTRY
+_mesa_NamedRenderbufferStorageEXT(GLuint renderbuffer, GLenum internalformat,
+                                  GLsizei width, GLsizei height)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
+   if (!rb || rb == &DummyRenderbuffer) {
+      _mesa_HashLockMutex(ctx->Shared->RenderBuffers);
+      rb = allocate_renderbuffer_locked(ctx, renderbuffer, "glNamedRenderbufferStorageEXT");
+      _mesa_HashUnlockMutex(ctx->Shared->RenderBuffers);
+   }
+   renderbuffer_storage(ctx, rb, internalformat, width, height, NO_SAMPLES,
+                        0, "glNamedRenderbufferStorageEXT");
+}
+
+
 void GLAPIENTRY
 _mesa_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei samples,
                                           GLenum internalformat,
@@ -2817,6 +2833,24 @@ _mesa_GetNamedRenderbufferParameteriv(GLuint renderbuffer, GLenum pname,
 }
 
 
+void GLAPIENTRY
+_mesa_GetNamedRenderbufferParameterivEXT(GLuint renderbuffer, GLenum pname,
+                                         GLint *params)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
+   if (!rb || rb == &DummyRenderbuffer) {
+      _mesa_HashLockMutex(ctx->Shared->RenderBuffers);
+      rb = allocate_renderbuffer_locked(ctx, renderbuffer, "glGetNamedRenderbufferParameterivEXT");
+      _mesa_HashUnlockMutex(ctx->Shared->RenderBuffers);
+   }
+
+   get_render_buffer_parameteriv(ctx, rb, pname, params,
+                                 "glGetNamedRenderbufferParameterivEXT");
+}
+
+
 GLboolean GLAPIENTRY
 _mesa_IsFramebuffer(GLuint framebuffer)
 {
index e44373e7dd351b040ef2d6b52cce724786c11e48..56e53544dd79f4f2537075a0cb1f848acf6b14cc 100644 (file)
@@ -190,6 +190,9 @@ _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
 extern void GLAPIENTRY
 _mesa_NamedRenderbufferStorage(GLuint renderbuffer, GLenum internalformat,
                                GLsizei width, GLsizei height);
+extern void GLAPIENTRY
+_mesa_NamedRenderbufferStorageEXT(GLuint renderbuffer, GLenum internalformat,
+                                  GLsizei width, GLsizei height);
 
 extern void GLAPIENTRY
 _mesa_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei samples,
@@ -360,6 +363,10 @@ extern void GLAPIENTRY
 _mesa_NamedFramebufferParameteri(GLuint framebuffer, GLenum pname,
                                  GLint param);
 
+extern void GLAPIENTRY
+_mesa_GetNamedRenderbufferParameterivEXT(GLuint renderbuffer, GLenum pname,
+                                         GLint *params);
+
 extern void GLAPIENTRY
 _mesa_GetFramebufferParameterivEXT(GLuint framebuffer, GLenum pname,
                                    GLint *param);
index c3ac7beb73e123bbbfd25e8c1833172a85fa98e4..cbd65d7ba637ff4b5eb046216dd408fb58217eba 100644 (file)
@@ -1185,8 +1185,8 @@ const struct function common_desktop_functions_possible[] = {
    /* GL_EXT_direct_state_access - GL 3.0 */
    //{ "glGetFloati_vEXT", 30, -1 },
    //{ "glGetDoublei_vEXT", 30, -1 },
-   //{ "glNamedRenderbufferStorageEXT", 30, -1 },
-   //{ "glGetNamedRenderbufferParameterivEXT", 30, -1 },
+   { "glNamedRenderbufferStorageEXT", 30, -1 },
+   { "glGetNamedRenderbufferParameterivEXT", 30, -1 },
    //{ "glNamedRenderbufferStorageMultisampleEXT", 30, -1 },
    { "glCheckNamedFramebufferStatusEXT", 30, -1 },
    { "glNamedFramebufferTexture1DEXT", 30, -1 },