diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-11-08 16:46:08 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-11-08 16:46:08 +0300 |
commit | 872721783041530a63a3a62ffa8fbbe1a775e5be (patch) | |
tree | e84b6bb3fed1c37b1968f292627e9ef34ed2cb18 /dxil_converter.cpp | |
parent | 3c41873786c8cd7e2a9eaa751bdcda0976c029a8 (diff) |
Emit SPIR-V 1.4 for fragment shader if stage input can be overridden.
We might have to emit PerPrimitiveEXT which requires 1.4.
Diffstat (limited to 'dxil_converter.cpp')
-rw-r--r-- | dxil_converter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dxil_converter.cpp b/dxil_converter.cpp index 53f8c67..c0cbfbe 100644 --- a/dxil_converter.cpp +++ b/dxil_converter.cpp @@ -5837,6 +5837,14 @@ ConvertedFunction Converter::Impl::convert_entry_point() entry_point_meta = get_entry_point_meta(module, options.entry_point.empty() ? nullptr : options.entry_point.c_str()); execution_model = get_execution_model(module, entry_point_meta); + if (execution_model == spv::ExecutionModelFragment && + resource_mapping_iface && resource_mapping_iface->has_nontrivial_stage_input_remapping()) + { + // Force SPIR-V 1.4 for fragment shaders if we might end up requiring mesh shader capabilities. + // Non-trivial stage input remapping may require PerPrimitiveEXT decoration. + spirv_module.set_override_spirv_version(0x10400); + } + if (!entry_point_meta) { if (!options.entry_point.empty()) |