[Mesa-dev] [PATCH 8/9] translate: Fix the fetch function assertions.
jfonseca at vmware.com
jfonseca at vmware.com
Tue Dec 4 06:13:51 PST 2012
From: José Fonseca <jfonseca at vmware.com>
fetch_rgba_float is NULL for integer formats, and vice-versa.
---
.../auxiliary/translate/translate_generic.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/translate/translate_generic.c b/src/gallium/auxiliary/translate/translate_generic.c
index 72099af..894c168 100644
--- a/src/gallium/auxiliary/translate/translate_generic.c
+++ b/src/gallium/auxiliary/translate/translate_generic.c
@@ -806,7 +806,6 @@ struct translate *translate_generic_create( const struct translate_key *key )
util_format_description(key->element[i].input_format);
assert(format_desc);
- assert(format_desc->fetch_rgba_float);
tg->attrib[i].type = key->element[i].type;
@@ -820,11 +819,14 @@ struct translate *translate_generic_create( const struct translate_key *key )
}
if (format_desc->channel[0].type == UTIL_FORMAT_TYPE_SIGNED) {
+ assert(format_desc->fetch_rgba_sint);
tg->attrib[i].fetch = (fetch_func)format_desc->fetch_rgba_sint;
} else {
+ assert(format_desc->fetch_rgba_uint);
tg->attrib[i].fetch = (fetch_func)format_desc->fetch_rgba_uint;
}
} else {
+ assert(format_desc->fetch_rgba_float);
tg->attrib[i].fetch = (fetch_func)format_desc->fetch_rgba_float;
}
--
1.7.9.5
More information about the mesa-dev
mailing list