const struct util_format_description *desc;
unsigned i;
+ if (!format)
+ format = PIPE_FORMAT_R32_FLOAT;
+
desc = util_format_description(format);
if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) {
static INLINE uint16_t
r300_translate_vertex_data_swizzle(enum pipe_format format) {
- const struct util_format_description *desc = util_format_description(format);
+ const struct util_format_description *desc;
unsigned i, swizzle = 0;
- assert(format);
+ if (!format)
+ return (R300_SWIZZLE_SELECT_FP_ZERO << R300_SWIZZLE_SELECT_X_SHIFT) |
+ (R300_SWIZZLE_SELECT_FP_ZERO << R300_SWIZZLE_SELECT_Y_SHIFT) |
+ (R300_SWIZZLE_SELECT_FP_ZERO << R300_SWIZZLE_SELECT_Z_SHIFT) |
+ (R300_SWIZZLE_SELECT_FP_ONE << R300_SWIZZLE_SELECT_W_SHIFT);
+
+ desc = util_format_description(format);
if (desc->layout != UTIL_FORMAT_LAYOUT_PLAIN) {
fprintf(stderr, "r300: Bad format %s in %s:%d\n",