diff options
author | Oded Gabbay <[email protected]> | 2016-03-21 23:46:15 +0200 |
---|---|---|
committer | Oded Gabbay <[email protected]> | 2016-04-26 11:00:16 +0300 |
commit | 2242dbe11d56b05ede7a928a9973adda4b145ad7 (patch) | |
tree | 608d5f1c46b354fc4a34f89c03b9bdabb57e6708 /src/gallium/drivers/r600/r600_pipe.h | |
parent | 4965c5bf72d95a73a1a4219843fe36c65b7b10c2 (diff) |
r600g/radeonsi: send endian info to format translation functions
Because r600 GPUs can't do swap in their DB unit, we need to disable
endianess swapping for textures that are handled by DB.
There are four format translation functions in r600g driver:
- r600_translate_texformat
- r600_colorformat_endian_swap
- r600_translate_colorformat
- r600_translate_colorswap
This patch adds a new parameters to those functions, called
"do_endian_swap". When running in a big-endian machine, the calling
functions will check whether the texture/color is handled by DB -
"rtex->is_depth && !rtex->is_flushing_texture" - and if so, they will
send FALSE through this parameter. Otherwise, they will send TRUE.
The translation functions, in specific cases, will look at this parameter
and configure the swapping accordingly.
v4:
evergreen_init_color_surface_rat() is only used by compute and don't
handle DB surfaces, so just sent hard-coded FALSE to translation
functions when called by it.
Signed-off-by: Oded Gabbay <[email protected]>
Cc: "11.1 11.2" <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_pipe.h')
-rw-r--r-- | src/gallium/drivers/r600/r600_pipe.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h index 4d16223eba0..afd046edd80 100644 --- a/src/gallium/drivers/r600/r600_pipe.h +++ b/src/gallium/drivers/r600/r600_pipe.h @@ -734,9 +734,11 @@ unsigned r600_get_swizzle_combined(const unsigned char *swizzle_format, boolean vtx); uint32_t r600_translate_texformat(struct pipe_screen *screen, enum pipe_format format, const unsigned char *swizzle_view, - uint32_t *word4_p, uint32_t *yuv_format_p); -uint32_t r600_translate_colorformat(enum chip_class chip, enum pipe_format format); -uint32_t r600_colorformat_endian_swap(uint32_t colorformat); + uint32_t *word4_p, uint32_t *yuv_format_p, + bool do_endian_swap); +uint32_t r600_translate_colorformat(enum chip_class chip, enum pipe_format format, + bool do_endian_swap); +uint32_t r600_colorformat_endian_swap(uint32_t colorformat, bool do_endian_swap); /* r600_uvd.c */ struct pipe_video_codec *r600_uvd_create_decoder(struct pipe_context *context, |