*/
bool frag_coord_is_sysval;
+ /* Whether to keep ViewIndex as an input instead of rewriting to a sysval.
+ */
+ bool view_index_is_input;
+
struct spirv_supported_capabilities caps;
/* Address format for various kinds of pointers. */
set_mode_system_value(b, mode);
break;
case SpvBuiltInViewIndex:
- *location = SYSTEM_VALUE_VIEW_INDEX;
- set_mode_system_value(b, mode);
+ if (b->options && b->options->view_index_is_input) {
+ *location = VARYING_SLOT_VIEW_INDEX;
+ vtn_assert(*mode == nir_var_shader_in);
+ } else {
+ *location = SYSTEM_VALUE_VIEW_INDEX;
+ set_mode_system_value(b, mode);
+ }
break;
case SpvBuiltInSubgroupEqMask:
*location = SYSTEM_VALUE_SUBGROUP_EQ_MASK,