summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Ekstrand <laura@jlekstrand.net>2015-01-28 13:19:57 -0800
committerLaura Ekstrand <laura@jlekstrand.net>2015-03-18 14:00:37 -0700
commit8ffff5f178310853f01fa832c10b64deb5e5b6ac (patch)
tree7c4b825087ad4bc5b01d36b5caf344aeb7aab238
parentf5d8c371338ce470ea22af24a8015b5d51119279 (diff)
main: Add entry points for glNamedFramebufferTexture[Layer].
-rw-r--r--src/mapi/glapi/gen/ARB_direct_state_access.xml15
-rw-r--r--src/mesa/main/fbobject.c62
-rw-r--r--src/mesa/main/fbobject.h8
-rw-r--r--src/mesa/main/tests/dispatch_sanity.cpp2
4 files changed, 87 insertions, 0 deletions
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index b954343ea4..19d029da91 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -125,6 +125,21 @@
<param name="renderbuffer" type="GLuint" />
</function>
+ <function name="NamedFramebufferTexture" offset="assign">
+ <param name="framebuffer" type="GLuint" />
+ <param name="attachment" type="GLenum" />
+ <param name="texture" type="GLuint" />
+ <param name="level" type="GLint" />
+ </function>
+
+ <function name="NamedFramebufferTextureLayer" offset="assign">
+ <param name="framebuffer" type="GLuint" />
+ <param name="attachment" type="GLenum" />
+ <param name="texture" type="GLuint" />
+ <param name="level" type="GLint" />
+ <param name="layer" type="GLint" />
+ </function>
+
<!-- Texture object functions -->
<function name="CreateTextures" offset="assign">
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 2ac99039a3..f634aedd3c 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2832,6 +2832,35 @@ _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment,
layer, layered, "glFramebufferTextureLayer");
}
+void GLAPIENTRY
+_mesa_NamedFramebufferTextureLayer(GLuint framebuffer, GLenum attachment,
+ GLuint texture, GLint level, GLint layer)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_framebuffer *fb;
+ struct gl_texture_object *texObj;
+ GLboolean layered = GL_FALSE;
+
+ /* Get the framebuffer object */
+ fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
+ "glNamedFramebufferTextureLayer");
+ if (!fb)
+ return;
+
+ /* Get the texture object */
+ if (!get_texture_for_framebuffer(ctx, texture, 0, level, layer,
+ &layered,
+ "glNamedFramebufferTextureLayer",
+ &texObj)) {
+ /* Error already recorded */
+ return;
+ }
+
+ _mesa_framebuffer_texture(ctx, fb, attachment, texObj, 0, level,
+ layer, layered,
+ "glNamedFramebufferTextureLayer");
+}
+
void GLAPIENTRY
_mesa_FramebufferTexture(GLenum target, GLenum attachment,
@@ -2869,6 +2898,39 @@ _mesa_FramebufferTexture(GLenum target, GLenum attachment,
0, layered, "glFramebufferTexture");
}
+void GLAPIENTRY
+_mesa_NamedFramebufferTexture(GLuint framebuffer, GLenum attachment,
+ GLuint texture, GLint level)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_framebuffer *fb;
+ struct gl_texture_object *texObj;
+ GLboolean layered = GL_TRUE;
+
+ if (!_mesa_has_geometry_shaders(ctx)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "unsupported function (glNamedFramebufferTexture) called");
+ return;
+ }
+
+ /* Get the framebuffer object */
+ fb = _mesa_lookup_framebuffer_err(ctx, framebuffer,
+ "glNamedFramebufferTexture");
+ if (!fb)
+ return;
+
+ /* Get the texture object */
+ if (!get_texture_for_framebuffer(ctx, texture, 0, level, 0,
+ &layered, "glNamedFramebufferTexture",
+ &texObj)) {
+ /* Error already recorded */
+ return;
+ }
+
+ _mesa_framebuffer_texture(ctx, fb, attachment, texObj, 0, level,
+ 0, layered, "glNamedFramebufferTexture");
+}
+
void
_mesa_framebuffer_renderbuffer(struct gl_context *ctx,
diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h
index 43042155ab..7487f02bb3 100644
--- a/src/mesa/main/fbobject.h
+++ b/src/mesa/main/fbobject.h
@@ -197,10 +197,18 @@ _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment,
GLuint texture, GLint level, GLint layer);
extern void GLAPIENTRY
+_mesa_NamedFramebufferTextureLayer(GLuint framebuffer, GLenum attachment,
+ GLuint texture, GLint level, GLint layer);
+
+extern void GLAPIENTRY
_mesa_FramebufferTexture(GLenum target, GLenum attachment,
GLuint texture, GLint level);
extern void GLAPIENTRY
+_mesa_NamedFramebufferTexture(GLuint framebuffer, GLenum attachment,
+ GLuint texture, GLint level);
+
+extern void GLAPIENTRY
_mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment,
GLenum renderbuffertarget,
GLuint renderbuffer);
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp
index 17f635ebf7..807b63423a 100644
--- a/src/mesa/main/tests/dispatch_sanity.cpp
+++ b/src/mesa/main/tests/dispatch_sanity.cpp
@@ -939,6 +939,8 @@ const struct function gl_core_functions_possible[] = {
{ "glGetNamedBufferSubData", 45, -1 },
{ "glCreateFramebuffers", 45, -1 },
{ "glNamedFramebufferRenderbuffer", 45, -1 },
+ { "glNamedFramebufferTexture", 45, -1 },
+ { "glNamedFramebufferTextureLayer", 45, -1 },
{ "glCreateTextures", 45, -1 },
{ "glTextureStorage1D", 45, -1 },
{ "glTextureStorage2D", 45, -1 },