break;
/* It appears vertex_id is zero-based with Bifrost geometry flows, but
- * not with Valhall's memory-allocation IDVS geometry flow. Ostensibly
- * we support the legacy geometry flow even on Valhall, so
- * vertex_id_zero_based isn't a machine property for us. Don't set it,
- * and lower here if needed.
+ * not with Valhall's memory-allocation IDVS geometry flow. We only support
+ * the new flow on Valhall so this is lowered in NIR.
*/
case nir_intrinsic_load_vertex_id:
- if (b->shader->malloc_idvs) {
- bi_mov_i32_to(b, dst, bi_vertex_id(b));
- } else {
- bi_index first =
- bi_load_sysval(b, PAN_SYSVAL_VERTEX_INSTANCE_OFFSETS, 1, 0);
-
- bi_iadd_u32_to(b, dst, bi_vertex_id(b), first, false);
- }
-
- break;
-
- /* We only use in our transform feedback lowering */
case nir_intrinsic_load_vertex_id_zero_base:
- assert(b->shader->nir->info.has_transform_feedback_varyings);
+ assert(b->shader->malloc_idvs ==
+ (instr->intrinsic == nir_intrinsic_load_vertex_id));
+
bi_mov_i32_to(b, dst, bi_vertex_id(b));
break;
.lower_insert_byte = true, \
.lower_rotate = true, \
\
+ /* Vertex ID is zero based in the traditional geometry flows, but not in \
+ * the memory-allocated IDVS flow introduced and used exclusively in \
+ * Valhall. So this is a machine property for us. \
+ */ \
+ .vertex_id_zero_based = (arch <= 7), \
+ \
.lower_pack_half_2x16 = true, \
.lower_pack_unorm_2x16 = true, \
.lower_pack_snorm_2x16 = true, \
};
DEFINE_OPTIONS(6);
+DEFINE_OPTIONS(9);
#endif
const nir_shader_compiler_options *
GENX(pan_shader_get_compiler_options)(void)
{
-#if PAN_ARCH >= 6
+#if PAN_ARCH >= 9
+ return &bifrost_nir_options_v9;
+#elif PAN_ARCH >= 6
return &bifrost_nir_options_v6;
#else
return &midgard_nir_options;