[Mesa-dev] [PATCH 03/29] mesa: Do not assert on integer<->non-integer direct pack/unpack fast paths
Iago Toral Quiroga
itoral at igalia.com
Tue Nov 18 01:23:44 PST 2014
We can have conversions from non-integer types to integer types, so remove
the assertions for these in the pack/unpack fast paths. It could be that
we do not have all the necessary pack/unpack functions in these cases though,
so protect these paths with conditionals and let _mesa_format_convert use
other paths to resolve these kind of conversions if necessary.
---
src/mesa/main/format_utils.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
index 1d65f2b..56a3b8d 100644
--- a/src/mesa/main/format_utils.c
+++ b/src/mesa/main/format_utils.c
@@ -143,8 +143,8 @@ _mesa_format_convert(void *void_dst, uint32_t dst_format, size_t dst_stride,
dst += dst_stride;
}
return;
- } else if (dst_array_format.as_uint == RGBA8888_UBYTE.as_uint) {
- assert(!_mesa_is_format_integer_color(src_format));
+ } else if (dst_array_format.as_uint == RGBA8888_UBYTE.as_uint &&
+ !_mesa_is_format_integer_color(src_format)) {
for (row = 0; row < height; ++row) {
_mesa_unpack_ubyte_rgba_row(src_format, width,
src, (uint8_t (*)[4])dst);
@@ -152,8 +152,8 @@ _mesa_format_convert(void *void_dst, uint32_t dst_format, size_t dst_stride,
dst += dst_stride;
}
return;
- } else if (dst_array_format.as_uint == RGBA8888_UINT.as_uint) {
- assert(_mesa_is_format_integer_color(src_format));
+ } else if (dst_array_format.as_uint == RGBA8888_UINT.as_uint &&
+ _mesa_is_format_integer_color(src_format)) {
for (row = 0; row < height; ++row) {
_mesa_unpack_uint_rgba_row(src_format, width,
src, (uint32_t (*)[4])dst);
@@ -174,8 +174,8 @@ _mesa_format_convert(void *void_dst, uint32_t dst_format, size_t dst_stride,
dst += dst_stride;
}
return;
- } else if (src_array_format.as_uint == RGBA8888_UBYTE.as_uint) {
- assert(!_mesa_is_format_integer_color(dst_format));
+ } else if (src_array_format.as_uint == RGBA8888_UBYTE.as_uint &&
+ !_mesa_is_format_integer_color(dst_format)) {
for (row = 0; row < height; ++row) {
_mesa_pack_ubyte_rgba_row(dst_format, width,
(const uint8_t (*)[4])src, dst);
@@ -183,8 +183,8 @@ _mesa_format_convert(void *void_dst, uint32_t dst_format, size_t dst_stride,
dst += dst_stride;
}
return;
- } else if (src_array_format.as_uint == RGBA8888_UINT.as_uint) {
- assert(_mesa_is_format_integer_color(dst_format));
+ } else if (src_array_format.as_uint == RGBA8888_UINT.as_uint &&
+ _mesa_is_format_integer_color(dst_format)) {
for (row = 0; row < height; ++row) {
_mesa_pack_uint_rgba_row(dst_format, width,
(const uint32_t (*)[4])src, dst);
--
1.9.1
More information about the mesa-dev
mailing list