summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2021-05-21 16:47:41 +0200
committerHans-Kristian Arntzen <post@arntzen-software.no>2021-05-21 16:47:41 +0200
commitc87cb544992e428bf1eec4bd951a9b1322518482 (patch)
tree3ada64f160eff91a792ed3571ebb3d4cbc674606
parenta6c951485604426bf0ae798196596b9dac656cc5 (diff)
downloadSPIRV-Cross-c87cb544992e428bf1eec4bd951a9b1322518482.tar.gz
SPIRV-Cross-c87cb544992e428bf1eec4bd951a9b1322518482.tar.bz2
SPIRV-Cross-c87cb544992e428bf1eec4bd951a9b1322518482.zip
MSL: Add CLI option for sampler suffix.
-rw-r--r--main.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index f3b27431..0da96449 100644
--- a/main.cpp
+++ b/main.cpp
@@ -658,6 +658,7 @@ struct CLIArguments
bool msl_emulate_subgroups = false;
uint32_t msl_fixed_subgroup_size = 0;
bool msl_force_sample_rate_shading = false;
+ const char *msl_combined_sampler_suffix = nullptr;
bool glsl_emit_push_constant_as_ubo = false;
bool glsl_emit_ubo_as_plain_uniforms = false;
bool glsl_force_flattened_io_blocks = false;
@@ -884,7 +885,8 @@ static void print_help_msl()
"\t\tIntended for Vulkan Portability implementations where VK_EXT_subgroup_size_control is not supported or disabled.\n"
"\t\tIf 0, assume variable subgroup size as actually exposed by Metal.\n"
"\t[--msl-force-sample-rate-shading]:\n\t\tForce fragment shaders to run per sample.\n"
- "\t\tThis adds a [[sample_id]] parameter if none is already present.\n");
+ "\t\tThis adds a [[sample_id]] parameter if none is already present.\n"
+ "\t[--msl-combined-sampler-suffix <suffix>]:\n\t\tUses a custom suffix for combined samplers.\n");
// clang-format on
}
@@ -1147,6 +1149,8 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
msl_comp->add_inline_uniform_block(v.first, v.second);
for (auto &v : args.msl_shader_inputs)
msl_comp->add_msl_shader_input(v);
+ if (args.msl_combined_sampler_suffix)
+ msl_comp->set_combined_sampler_suffix(args.msl_combined_sampler_suffix);
}
else if (args.hlsl)
compiler.reset(new CompilerHLSL(move(spirv_parser.get_parsed_ir())));
@@ -1577,6 +1581,9 @@ static int main_inner(int argc, char *argv[])
cbs.add("--msl-fixed-subgroup-size",
[&args](CLIParser &parser) { args.msl_fixed_subgroup_size = parser.next_uint(); });
cbs.add("--msl-force-sample-rate-shading", [&args](CLIParser &) { args.msl_force_sample_rate_shading = true; });
+ cbs.add("--msl-combined-sampler-suffix", [&args](CLIParser &parser) {
+ args.msl_combined_sampler_suffix = parser.next_string();
+ });
cbs.add("--extension", [&args](CLIParser &parser) { args.extensions.push_back(parser.next_string()); });
cbs.add("--rename-entry-point", [&args](CLIParser &parser) {
auto old_name = parser.next_string();