diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index adcbc0e9217..aba43532469 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -85,6 +85,7 @@ struct spirv_supported_capabilities { bool float_controls; bool shader_clock; bool shader_viewport_index_layer; + bool shader_viewport_mask_nv; bool sparse_residency; bool stencil_export; bool storage_8bit; diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index 204dff2f465..ff61059158f 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -4805,6 +4805,10 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode, spv_check_supported(mesh_shading_nv, cap); break; + case SpvCapabilityShaderViewportMaskNV: + spv_check_supported(shader_viewport_mask_nv, cap); + break; + default: vtn_fail("Unhandled capability: %s (%u)", spirv_capability_to_string(cap), cap); diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index a34debfb8b1..fd17127542f 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -864,6 +864,10 @@ vtn_get_builtin_location(struct vtn_builder *b, else vtn_fail("invalid stage for SpvBuiltInViewportIndex"); break; + case SpvBuiltInViewportMaskNV: + *location = VARYING_SLOT_VIEWPORT_MASK; + *mode = nir_var_shader_out; + break; case SpvBuiltInTessLevelOuter: *location = VARYING_SLOT_TESS_LEVEL_OUTER; break;