diff options
author | Nick Bowler <[email protected]> | 2010-08-26 07:26:21 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-08-26 08:42:24 -0600 |
commit | e71a9042cb5e046072d2ea8fbd22a01de625bf8a (patch) | |
tree | 1720fb74c8d66035439b77fcd335bd9698a63ceb /src/mesa/main/formats.c | |
parent | bda941e1b895547d680b68eaf28ae2db11e6149f (diff) |
mesa: Identify packed depth/stencil buffers using the Format field.
Intel sometimes uses packed depth/stencil buffers even when only a depth
buffer or only a stencil buffer was requested. Common code currently
uses the _BaseFormat field to determine whether a depth/stencil wrapper
is necessary. But unless the user explicitly requested a packed
depth/stencil buffer, the _BaseFormat field does not encode this
information, and the required wrappers are not created.
The problem was introduced by commit 45e76d2665b38b ("mesa: remove a
bunch of gl_renderbuffer fields"), which killed off the _ActualFormat
field upon which the decision to create a wrapper used to be made. This
patch changes the logic to use the Format field instead, which is more
like the old code.
Fixes fdo bug 27590.
Signed-off-by: Nick Bowler <[email protected]>
Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r-- | src/mesa/main/formats.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 90449cc04f0..c5f3e0b21d1 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -940,6 +940,22 @@ _mesa_is_format_compressed(gl_format format) /** + * Determine if the given format represents a packed depth/stencil buffer. + */ +GLboolean +_mesa_is_format_packed_depth_stencil(gl_format format) +{ + if (format == MESA_FORMAT_Z24_S8 + || format == MESA_FORMAT_Z24_X8 + || format == MESA_FORMAT_S8_Z24 + || format == MESA_FORMAT_X8_Z24) + return GL_TRUE; + + return GL_FALSE; +} + + +/** * Return color encoding for given format. * \return GL_LINEAR or GL_SRGB */ |