summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/format_utils.h
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2014-11-26 09:05:08 +0100
committerIago Toral Quiroga <[email protected]>2015-01-12 11:20:28 +0100
commit3171a09c2539a3d08196d6a4cb91ad6276f9383d (patch)
tree79d1a582beeab9e59c11c523f69a2b75221b4051 /src/mesa/main/format_utils.h
parent1aaed753301a4c0d39173616088db66231e7298d (diff)
mesa: Add a rebase_swizzle parameter to _mesa_format_convert
The new parameter allows callers to provide a rebase swizzle that the function needs to use to match the requirements of the base internal format involved. This is necessary when the source or destination internal formats (depending on whether we are doing the conversion for a pixel download or a pixel upload respectively) do not match the base formats of the source or destination formats of the conversion. This can happen when the driver does not support the internal formats and uses a different format to store pixel data internally. For example, a texture upload from RGB to Luminance in a driver that does not support textures with a Luminance format may decide to store the Luminance data as RGBA. In this case we want to store the RGBA values as (R,R,R,1). Following the same example, when we download from that texture to RGBA we want to read (R,0,0,1). The rebase_swizzle parameter allows these transforms to happen. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/main/format_utils.h')
-rw-r--r--src/mesa/main/format_utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/format_utils.h b/src/mesa/main/format_utils.h
index f006e18d785..ae7926e0c75 100644
--- a/src/mesa/main/format_utils.h
+++ b/src/mesa/main/format_utils.h
@@ -215,6 +215,6 @@ _mesa_swizzle_and_convert(void *dst, GLenum dst_type, int num_dst_channels,
void
_mesa_format_convert(void *void_dst, uint32_t dst_format, size_t dst_stride,
void *void_src, uint32_t src_format, size_t src_stride,
- size_t width, size_t height);
+ size_t width, size_t height, uint8_t *rebase_swizzle);
#endif