unsigned num_nodes;
};
+#define compile_error(ctx, args...) ({ \
+ printf(args); \
+ ctx->error = true; \
+ assert(0); \
+})
+
static inline hw_src
src_swizzle(hw_src src, unsigned swizzle)
{
case nir_intrinsic_load_frag_coord:
return SRC_REG(0, INST_SWIZ_IDENTITY);
default:
- assert(0);
+ compile_error(state->c, "Unhandled NIR intrinsic type: %s\n",
+ nir_intrinsic_infos[intr->intrinsic].name);
break;
}
} break;
return src_swizzle(const_src(state, &value, 1), SWIZZLE(X,X,X,X));
}
default:
- assert(0);
+ compile_error(state->c, "Unhandled NIR instruction type: %d\n", instr->type);
break;
}
compare = &tex->src[i].src;
break;
default:
- assert(0);
+ compile_error(state->c, "Unhandled NIR tex src type: %d\n",
+ tex->src[i].src_type);
break;
}
}
case nir_intrinsic_load_instance_id:
break;
default:
- assert(0);
+ compile_error(state->c, "Unhandled NIR intrinsic type: %s\n",
+ nir_intrinsic_infos[intr->intrinsic].name);
}
}
case nir_instr_type_deref:
break;
default:
- assert(0);
+ compile_error(state->c, "Unhandled NIR instruction type: %d\n", instr->type);
break;
}
}
emit_cf_list(state, &nir_cf_node_as_loop(node)->body);
break;
default:
- assert(0);
+ compile_error(state->c, "Unknown NIR node type\n");
break;
}
}