diff options
author | Laura Ekstrand <[email protected]> | 2015-01-28 13:19:57 -0800 |
---|---|---|
committer | Fredrik Höglund <[email protected]> | 2015-05-14 15:48:13 +0200 |
commit | d78c831a147e8af6f6fc1a610f4c2e490e75fad1 (patch) | |
tree | f5ab0d5e5c021bdf8be5623c7f1cea116b23f33b /src/mesa/main/fbobject.c | |
parent | a602b21f94ded038f9781cc02ab46cdaab868f14 (diff) |
main: Add entry points for glNamedFramebufferTexture[Layer].
Reviewed-by: Fredrik Höglund <[email protected]>
Signed-off-by: Fredrik Höglund <[email protected]>
Diffstat (limited to 'src/mesa/main/fbobject.c')
-rw-r--r-- | src/mesa/main/fbobject.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index dc730c8695c..8f759fba809 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -2996,6 +2996,36 @@ _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment, 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, GLuint texture, GLint level) { @@ -3032,6 +3062,40 @@ _mesa_FramebufferTexture(GLenum target, GLenum attachment, } +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, struct gl_framebuffer *fb, |