================ @@ -173,24 +173,84 @@ bool isLegalValidatorVersion(StringRef ValVersionStr, const Driver &D) { return true; } -std::string getSpirvExtArg(ArrayRef<std::string> SpvExtensionArgs) { +void getSpirvExtOperand(llvm::StringRef SpvExtensionArg, raw_ostream &out) { + // The extensions that are commented out are supported in DXC, but the SPIR-V + // backend does not know about them yet. + static const std::vector<StringRef> DxcSupportedExtensions = { + "SPV_KHR_16bit_storage", + "SPV_KHR_device_group", + "SPV_KHR_fragment_shading_rate", + "SPV_KHR_multiview", + "SPV_KHR_post_depth_coverage", + "SPV_KHR_non_semantic_info", + "SPV_KHR_shader_draw_parameters", + "SPV_KHR_ray_tracing", + "SPV_KHR_shader_clock", + "SPV_EXT_demote_to_helper_invocation", + "SPV_EXT_descriptor_indexing", + "SPV_EXT_fragment_fully_covered", + "SPV_EXT_fragment_invocation_density", + "SPV_EXT_fragment_shader_interlock", + "SPV_EXT_mesh_shader", + "SPV_EXT_shader_stencil_export", + "SPV_EXT_shader_viewport_index_layer", + // "SPV_AMD_shader_early_and_late_fragment_tests", + "SPV_GOOGLE_hlsl_functionality1", + "SPV_GOOGLE_user_type", + "SPV_KHR_ray_query", + "SPV_EXT_shader_image_int64", + "SPV_KHR_fragment_shader_barycentric", + "SPV_KHR_physical_storage_buffer", + "SPV_KHR_vulkan_memory_model", + // "SPV_KHR_compute_shader_derivatives", + // "SPV_KHR_maximal_reconvergence", + "SPV_KHR_float_controls", + "SPV_NV_shader_subgroup_partitioned", + // "SPV_KHR_quad_control" + }; + + if (SpvExtensionArg.starts_with("SPV_")) { + out << "+" << SpvExtensionArg; + return; + } + + if (SpvExtensionArg.compare_insensitive("DXC") == 0) { + bool first = true; + std::string Operand; + for (llvm::StringRef E : DxcSupportedExtensions) { ---------------- llvm-beanz wrote:
```suggestion for (StringRef E : DxcSupportedExtensions) { ``` https://github.com/llvm/llvm-project/pull/151554 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits