diff options
author | Richard Sandiford <[email protected]> | 2014-07-21 16:53:36 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2014-09-16 14:02:55 +1000 |
commit | 9cd4dced06aaa73d6f7b92fed5b4433569f22aca (patch) | |
tree | bf9672082a35b4f5e39018e38140d2dec160dfd7 | |
parent | 1a65629ccc590fe04a97b6df63d73e349b793619 (diff) |
llvmpipe: Fix PIPE_FORMAT_Z32_FLOAT_S8X24_UINT handling for big-endian.
llvmpipe treats PIPE_FORMAT_Z32_FLOAT_S8X24_UINT as a bit of a special case,
handling it as two 32-bit pieces rather than a single 64-bit block:
/* 64bit d/s format is special already extracted 32 bits */
total_bits = format_desc->block.bits > 32 ? 32 : format_desc->block.bits;
The format_desc describes the whole 64-bit block, so the z shift
will be 32 for big-endian. But since we're accessing the z channel
as a 32-bit value rather than a 64-bit value, we need to mask the shift
with 31.
Signed-off-by: Richard Sandiford <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_bld_depth.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_depth.c b/src/gallium/drivers/llvmpipe/lp_bld_depth.c index 5c13ee5a58e..b6c32ffb979 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_depth.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_depth.c @@ -363,7 +363,8 @@ get_z_shift_and_mask(const struct util_format_description *format_desc, return FALSE; *width = format_desc->channel[z_swizzle].size; - *shift = format_desc->channel[z_swizzle].shift; + /* & 31 is for the same reason as the 32-bit limit above */ + *shift = format_desc->channel[z_swizzle].shift & 31; if (*width == total_bits) { *mask = 0xffffffff; |