mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 14:08:05 +02:00
main: Add entry points for glNamedFramebufferTexture[Layer].
Reviewed-by: Fredrik Höglund <fredrik@kde.org> Signed-off-by: Fredrik Höglund <fredrik@kde.org>
This commit is contained in:
parent
a602b21f94
commit
d78c831a14
4 changed files with 89 additions and 0 deletions
|
|
@ -166,6 +166,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>
|
||||
|
||||
<!-- Renderbuffer object functions -->
|
||||
|
||||
<function name="CreateRenderbuffers" offset="assign">
|
||||
|
|
|
|||
|
|
@ -2995,6 +2995,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,
|
||||
|
|
|
|||
|
|
@ -212,10 +212,18 @@ extern void GLAPIENTRY
|
|||
_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,
|
||||
|
|
|
|||
|
|
@ -982,6 +982,8 @@ const struct function gl_core_functions_possible[] = {
|
|||
{ "glGetNamedBufferSubData", 45, -1 },
|
||||
{ "glCreateFramebuffers", 45, -1 },
|
||||
{ "glNamedFramebufferRenderbuffer", 45, -1 },
|
||||
{ "glNamedFramebufferTexture", 45, -1 },
|
||||
{ "glNamedFramebufferTextureLayer", 45, -1 },
|
||||
{ "glCreateRenderbuffers", 45, -1 },
|
||||
{ "glNamedRenderbufferStorage", 45, -1 },
|
||||
{ "glNamedRenderbufferStorageMultisample", 45, -1 },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue