st/mesa: added st_is_depth_stencil_combined() function

This code is part of a patch by Marek Olšák.
This commit is contained in:
Brian Paul
2010-08-22 19:34:53 -06:00
parent 428a3cd2d5
commit 24bd9780bc
2 changed files with 29 additions and 0 deletions

View File

@@ -447,6 +447,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.

View File

@@ -88,4 +88,9 @@ st_get_renderbuffer_sampler_view(struct st_renderbuffer *rb,
struct pipe_context *pipe);
extern GLboolean
st_is_depth_stencil_combined(const struct gl_renderbuffer_attachment *depth,
const struct gl_renderbuffer_attachment *stencil);
#endif /* ST_CB_FBO_H */