nir/spirv: Add the option to keep ViewIndex as an input
This is necessary for fragment shaders on adreno. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5719>
This commit is contained in:
parent
c1e6957033
commit
340c73d4ef
|
@ -64,6 +64,10 @@ struct spirv_to_nir_options {
|
|||
*/
|
||||
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. */
|
||||
|
|
|
@ -1436,8 +1436,13 @@ vtn_get_builtin_location(struct vtn_builder *b,
|
|||
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,
|
||||
|
|
Loading…
Reference in New Issue