summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_fbo.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-08-22 19:34:53 -0600
committerBrian Paul <brianp@vmware.com>2010-08-22 19:40:26 -0600
commit24bd9780bcf400a00f6fc5a89b1648c7e3b7df07 (patch)
treeb35f7e6667d3c4667e9dbc016158af3c33dc3b51 /src/mesa/state_tracker/st_cb_fbo.c
parent428a3cd2d537a42c8a01765a5a53dca139e07443 (diff)
st/mesa: added st_is_depth_stencil_combined() function
This code is part of a patch by Marek Olšák.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_fbo.c')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 48d83ded55..71bd4729e0 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -448,6 +448,30 @@ st_validate_attachment(struct pipe_screen *screen,
/**
+ * Check if two renderbuffer attachments name a combined depth/stencil
+ * renderbuffer.
+ */
+GLboolean
+st_is_depth_stencil_combined(const struct gl_renderbuffer_attachment *depth,
+ const struct gl_renderbuffer_attachment *stencil)
+{
+ assert(depth && stencil);
+
+ if (depth->Type == stencil->Type) {
+ if (depth->Type == GL_RENDERBUFFER_EXT &&
+ depth->Renderbuffer == stencil->Renderbuffer)
+ return GL_TRUE;
+
+ if (depth->Type == GL_TEXTURE &&
+ depth->Texture == stencil->Texture)
+ return GL_TRUE;
+ }
+
+ return GL_FALSE;
+}
+
+
+/**
* Check that the framebuffer configuration is valid in terms of what
* the driver can support.
*