case nir_intrinsic_load_sample_pos_from_id:
return emit_load_sample_pos_from_id(ctx, intr);
- case nir_intrinsic_load_helper_invocation:
+ case nir_intrinsic_is_helper_invocation:
return emit_load_unary_external_function(
ctx, intr, "dx.op.isHelperLane", DXIL_INTR_IS_HELPER_LANE);
NIR_PASS_V(s, nir_lower_pack);
NIR_PASS_V(s, dxil_nir_lower_system_values);
NIR_PASS_V(s, nir_lower_io_to_scalar, nir_var_shader_in | nir_var_system_value | nir_var_shader_out);
+ if (opts->shader_model_max < SHADER_MODEL_6_6) {
+ /* In a later pass, load_helper_invocation will be lowered to sample mask based fallback,
+ * so both load- and is- will be emulated eventually.
+ */
+ NIR_PASS_V(s, nir_lower_is_helper_invocation);
+ }
if (ctx->mod.shader_kind == DXIL_HULL_SHADER)
NIR_PASS_V(s, dxil_nir_split_tess_ctrl, &ctx->tess_ctrl_patch_constant_func);
.use_layer_id_sysval = true,
});
+ /* This will lower load_helper to a memoized is_helper if needed; otherwise, load_helper
+ * will stay, but trivially translatable to IsHelperLane(), which will be known to be
+ * constant across the invocation since no demotion would have been used.
+ */
+ NIR_PASS_V(nir, nir_lower_discard_or_demote, nir->info.use_legacy_math_rules);
+
NIR_PASS_V(nir, dxil_nir_lower_discard_and_terminate);
NIR_PASS_V(nir, nir_lower_returns);
NIR_PASS_V(nir, dxil_nir_lower_sample_pos);