This gives the caller a chance to recover (or crash anyway otherwise).
out[3] = TO_8_UNORM(attrib[3]);
}
-static void
-emit_NULL( const float *attrib, void *ptr )
-{
- /* do nothing is the only sensible option */
-}
-
static emit_func get_emit_func( enum pipe_format format )
{
switch (format) {
return &emit_A8R8G8B8_UNORM;
default:
- assert(0);
- return &emit_NULL;
+ return NULL;
}
}
tg->attrib[i].instance_divisor = key->element[i].instance_divisor;
tg->attrib[i].emit = get_emit_func(key->element[i].output_format);
+ if(!tg->attrib[i].emit)
+ {
+ FREE(tg);
+ return NULL;
+ }
tg->attrib[i].output_offset = key->element[i].output_offset;
-
}
tg->nr_attrib = key->nr_elements;