translate: Fix the fetch function assertions.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 21 Nov 2012 16:17:22 +0000 (16:17 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Tue, 4 Dec 2012 19:35:19 +0000 (19:35 +0000)
fetch_rgba_float is NULL for integer formats, and vice-versa.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/translate/translate_generic.c

index 72099af6a9dd2db3840b184a992e3cc5fced4f19..894c1684813714e0bc88ac4bbd6d1d80df66b4b6 100644 (file)
@@ -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;
       }