diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index aba43532469..b882481293a 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -75,6 +75,7 @@ struct spirv_supported_capabilities { bool mesh_shading_nv; bool min_lod; bool multiview; + bool per_view_attributes_nv; bool physical_storage_buffer_address; bool post_depth_coverage; bool printf; diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index ff61059158f..15b26754ab4 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -1105,6 +1105,7 @@ struct_member_decoration_cb(struct vtn_builder *b, case SpvDecorationPatch: case SpvDecorationPerPrimitiveNV: case SpvDecorationPerTaskNV: + case SpvDecorationPerViewNV: break; case SpvDecorationSpecId: @@ -1149,11 +1150,6 @@ struct_member_decoration_cb(struct vtn_builder *b, /* User semantic decorations can safely be ignored by the driver. */ break; - case SpvDecorationPerViewNV: - /* TODO(mesh): Handle multiview. */ - vtn_warn("Mesh multiview not yet supported. Needed for decoration PerViewNV."); - break; - default: vtn_fail_with_decoration("Unhandled decoration", dec->decoration); } @@ -4805,6 +4801,10 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode, spv_check_supported(mesh_shading_nv, cap); break; + case SpvCapabilityPerViewAttributesNV: + spv_check_supported(per_view_attributes_nv, cap); + break; + case SpvCapabilityShaderViewportMaskNV: spv_check_supported(shader_viewport_mask_nv, cap); break; diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 3ee5f611d3c..2d0f13c6efd 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -837,6 +837,7 @@ vtn_get_builtin_location(struct vtn_builder *b, set_mode_system_value(b, mode); break; case SpvBuiltInLayer: + case SpvBuiltInLayerPerViewNV: *location = VARYING_SLOT_LAYER; if (b->shader->info.stage == MESA_SHADER_FRAGMENT) *mode = nir_var_shader_in; @@ -865,6 +866,7 @@ vtn_get_builtin_location(struct vtn_builder *b, vtn_fail("invalid stage for SpvBuiltInViewportIndex"); break; case SpvBuiltInViewportMaskNV: + case SpvBuiltInViewportMaskPerViewNV: *location = VARYING_SLOT_VIEWPORT_MASK; *mode = nir_var_shader_out; break; @@ -1342,6 +1344,9 @@ gather_var_kind_cb(struct vtn_builder *b, struct vtn_value *val, int member, case SpvDecorationPerPrimitiveNV: vtn_var->var->data.per_primitive = true; break; + case SpvDecorationPerViewNV: + vtn_var->var->data.per_view = true; + break; default: /* Nothing to do. */ break;