summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-11-19 21:17:19 -0800
committerIan Romanick <ian.d.romanick@intel.com>2013-11-23 12:55:04 -0800
commit47ff55fa86f9bf74cf05944f4420bb6f2208790a (patch)
tree4cd46641dc77e6fa843a2f56cabbebe74d86e54a /src/mesa
parent8f4d95d41c0e84766279d7220adec959f86ed081 (diff)
mesa: Implement GL_FRAMEBUFFER_ATTACHMENT_LAYERED query.
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@lists.freedesktop.org> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> v2: Don't include "EXT" in the error message, since this query only makes sensen in context versions that have adopted glGetFramebufferAttachmentParameteriv(). Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit ec79c05cbfb7c68fbef7447e1744423c00f26654)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/fbobject.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index dd131078327..36506272932 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2964,6 +2964,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;
+ } else if (att->Type == GL_TEXTURE) {
+ *params = att->Layered;
+ } else if (att->Type == GL_NONE) {
+ _mesa_error(ctx, err,
+ "glGetFramebufferAttachmentParameteriv(pname)");
+ } else {
+ goto invalid_pname_enum;
+ }
+ return;
default:
goto invalid_pname_enum;
}