[Mesa-dev] [PATCH 2/2] mesa: Implement GL_FRAMEBUFFER_ATTACHMENT_LAYERED query.
Ian Romanick
idr at freedesktop.org
Wed Nov 20 11:18:25 PST 2013
On 11/19/2013 11:02 PM, Paul Berry wrote:
> From section 6.1.18 (Renderbuffer Object Queries) of the GL 3.2 spec,
> under the heading "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
> is TEXTURE, then":
>
> If pname is FRAMEBUFFER_ATTACHMENT_LAYERED, then params will
> contain TRUE if an entire level of a three-dimesional texture,
> cube map texture, or one-or two-dimensional array texture is
> attached. Otherwise, params will contain FALSE.
>
> Fixes piglit tests:
> - spec/!OpenGL 3.2/layered-rendering/framebuffer-layered-attachments
> - spec/!OpenGL 3.2/layered-rendering/framebuffertexture-defaults
>
> Cc: "10.0" <mesa-stable at lists.freedesktop.org>
There's a trivial nit below that you can take or leave. Either way,
this patch is
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
> src/mesa/main/fbobject.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index 2feb4c3..facd019 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -2950,6 +2950,18 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
> " invalid FBO attachment structure");
> }
> return;
> + case GL_FRAMEBUFFER_ATTACHMENT_LAYERED:
> + if (!_mesa_has_geometry_shaders(ctx)) {
> + goto invalid_pname_enum;
It's really weak that GL_AMD_vertex_shader_layer doesn't also add this.
> + } else if (att->Type == GL_TEXTURE) {
> + *params = att->Layered;
> + } else if (att->Type == GL_NONE) {
> + _mesa_error(ctx, err,
> + "glGetFramebufferAttachmentParameterivEXT(pname)");
Since we should only see this in a context where
glGetFramebufferAttachmentParameteriv is part of the GL core, I'd drop
the EXT.
> + } else {
> + goto invalid_pname_enum;
> + }
> + return;
> default:
> goto invalid_pname_enum;
> }
>
More information about the mesa-dev
mailing list