vc4: Flip around the depth/stencil fields.

After implementing depth stores, it looks like this is the way things
actually are, according to hiz-depth-read-fbo-d24-s0's probes.
This commit is contained in:
Eric Anholt 2014-09-05 14:23:04 -07:00
parent 2cbecee4b7
commit fd6e4fccad
3 changed files with 9 additions and 5 deletions

View file

@ -224,8 +224,12 @@ vc4_clear(struct pipe_context *pctx, unsigned buffers,
color->f);
}
if (buffers & PIPE_CLEAR_DEPTH)
if (buffers & PIPE_CLEAR_DEPTH) {
/* Though the depth buffer is stored with Z in the high 24,
* for this field we just need to store it in the low 24.
*/
vc4->clear_depth = util_pack_z(PIPE_FORMAT_Z24X8_UNORM, depth);
}
vc4->cleared |= buffers;
vc4->resolve |= buffers;

View file

@ -86,8 +86,8 @@ static const struct vc4_format vc4_format_table[] = {
/* Depth sampling will be handled by doing nearest filtering and not
* unpacking the RGBA value.
*/
FORMAT(Z24_UNORM_S8_UINT, NO, RGBA8888, SWIZ(X, Y, Z, W)),
FORMAT(Z24X8_UNORM, NO, RGBA8888, SWIZ(X, Y, Z, W)),
FORMAT(S8_UINT_Z24_UNORM, NO, RGBA8888, SWIZ(X, Y, Z, W)),
FORMAT(X8Z24_UNORM, NO, RGBA8888, SWIZ(X, Y, Z, W)),
FORMAT(B4G4R4A4_UNORM, NO, RGBA4444, SWIZ(Y, Z, W, X)),
FORMAT(B4G4R4X4_UNORM, NO, RGBA4444, SWIZ(Y, Z, W, 1)),

View file

@ -343,8 +343,8 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen,
}
if ((usage & PIPE_BIND_DEPTH_STENCIL) &&
(format == PIPE_FORMAT_Z24_UNORM_S8_UINT ||
format == PIPE_FORMAT_Z24X8_UNORM)) {
(format == PIPE_FORMAT_S8_UINT_Z24_UNORM ||
format == PIPE_FORMAT_X8Z24_UNORM)) {
retval |= PIPE_BIND_DEPTH_STENCIL;
}