diff options
author | Eric Anholt <eric@anholt.net> | 2014-09-05 14:23:04 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-09-09 07:29:16 -0700 |
commit | fd6e4fccade0a5e2a4877d01a57c255a47a06200 (patch) | |
tree | bf90291fe074d1c8bb19a1973e5cc69c58bf5a4f /src/gallium | |
parent | 2cbecee4b772acf425156ab3fb7b7e36ddb42d51 (diff) |
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.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_draw.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_formats.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/vc4/vc4_screen.c | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c index 311be6b7ec..d1035bb30a 100644 --- a/src/gallium/drivers/vc4/vc4_draw.c +++ b/src/gallium/drivers/vc4/vc4_draw.c @@ -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; diff --git a/src/gallium/drivers/vc4/vc4_formats.c b/src/gallium/drivers/vc4/vc4_formats.c index 770f8fb331..004bac70c6 100644 --- a/src/gallium/drivers/vc4/vc4_formats.c +++ b/src/gallium/drivers/vc4/vc4_formats.c @@ -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)), diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c index 49f5228ab3..b2fa623d9c 100644 --- a/src/gallium/drivers/vc4/vc4_screen.c +++ b/src/gallium/drivers/vc4/vc4_screen.c @@ -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; } |