[Mesa-dev] [PATCH 31/38] main: Add stubs for [Get]NamedFramebufferParameteri[v].

Laura Ekstrand laura at jlekstrand.net
Tue Mar 3 17:32:23 PST 2015


The ARB_direct_state_access specification says (as of 2015.02.05):
   "Interactions with OpenGL 4.3 or ARB_framebuffer_no_attachments

       If neither OpenGL 4.3 nor ARB_framebuffer_no_attachments are supported,
       ignore the support for NamedFramebufferParameteri and
       GetNamedFramebufferParameteriv."
This commit adds stubs for these entry points.
---
 src/mapi/glapi/gen/ARB_direct_state_access.xml | 12 +++++++++++
 src/mesa/main/fbobject.c                       | 30 ++++++++++++++++++++++++++
 src/mesa/main/fbobject.h                       |  8 +++++++
 src/mesa/main/tests/dispatch_sanity.cpp        |  2 ++
 4 files changed, 52 insertions(+)

diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 3f8ce50..025a1a8 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -125,6 +125,12 @@
       <param name="renderbuffer" type="GLuint" />
    </function>
 
+   <function name="NamedFramebufferParameteri" offset="assign">
+      <param name="framebuffer" type="GLuint" />
+      <param name="pname" type="GLenum" />
+      <param name="param" type="GLint" />
+   </function>
+
    <function name="NamedFramebufferTexture" offset="assign">
       <param name="framebuffer" type="GLuint" />
       <param name="attachment" type="GLenum" />
@@ -205,6 +211,12 @@
       <param name="target" type="GLenum" />
    </function>
 
+   <function name="GetNamedFramebufferParameteriv" offset="assign">
+      <param name="framebuffer" type="GLuint" />
+      <param name="pname" type="GLenum" />
+      <param name="param" type="GLint *" />
+   </function>
+
    <function name="GetNamedFramebufferAttachmentParameteriv" offset="assign">
       <param name="framebuffer" type="GLuint" />
       <param name="attachment" type="GLenum" />
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 72d87db..fc11017 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -3466,6 +3466,36 @@ _mesa_GetNamedFramebufferAttachmentParameteriv(GLuint framebuffer,
                               "glGetNamedFramebufferAttachmentParameteriv");
 }
 
+void GLAPIENTRY
+_mesa_NamedFramebufferParameteri(GLuint framebuffer, GLenum pname,
+                                 GLint param)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   (void) framebuffer;
+   (void) pname;
+   (void) param;
+
+   _mesa_error(ctx, GL_INVALID_OPERATION,
+               "glNamedFramebufferParameteri not supported "
+               "(ARB_framebuffer_no_attachments not implemented)");
+}
+
+void GLAPIENTRY
+_mesa_GetNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname,
+                                     GLint *param)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   (void) framebuffer;
+   (void) pname;
+   (void) param;
+
+   _mesa_error(ctx, GL_INVALID_OPERATION,
+               "glGetNamedFramebufferParameteriv not supported "
+               "(ARB_framebuffer_no_attachments not implemented)");
+}
+
 
 static void
 invalidate_framebuffer_storage(struct gl_context *ctx,
diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h
index f71e885..fe9e5a8 100644
--- a/src/mesa/main/fbobject.h
+++ b/src/mesa/main/fbobject.h
@@ -240,6 +240,14 @@ _mesa_GetNamedFramebufferAttachmentParameteriv(GLuint framebuffer,
                                                GLenum pname, GLint *params);
 
 extern void GLAPIENTRY
+_mesa_NamedFramebufferParameteri(GLuint framebuffer, GLenum pname,
+                                 GLint param);
+
+extern void GLAPIENTRY
+_mesa_GetNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname,
+                                     GLint *param);
+
+extern void GLAPIENTRY
 _mesa_InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments,
                                const GLenum *attachments, GLint x, GLint y,
                                GLsizei width, GLsizei height);
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 91989ee..01a3d14 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -972,6 +972,7 @@ const struct function gl_core_functions_possible[] = {
    { "glGetNamedBufferSubData", 45, -1 },
    { "glCreateFramebuffers", 45, -1 },
    { "glNamedFramebufferRenderbuffer", 45, -1 },
+   { "glNamedFramebufferParameteri", 45, -1 },
    { "glNamedFramebufferTexture", 45, -1 },
    { "glNamedFramebufferTextureLayer", 45, -1 },
    { "glInvalidateNamedFramebufferSubData", 45, -1 },
@@ -982,6 +983,7 @@ const struct function gl_core_functions_possible[] = {
    { "glClearNamedFramebufferfi", 45, -1 },
    { "glBlitNamedFramebuffer", 45, -1 },
    { "glCheckNamedFramebufferStatus", 45, -1 },
+   { "glGetNamedFramebufferParameteriv", 45, -1 },
    { "glGetNamedFramebufferAttachmentParameteriv", 45, -1 },
    { "glCreateTextures", 45, -1 },
    { "glTextureStorage1D", 45, -1 },
-- 
2.1.0



More information about the mesa-dev mailing list