From e5f9e2c203e553883cfd9e14c44d83818fac5a9e Mon Sep 17 00:00:00 2001 From: Thomas Roughton Date: Thu, 29 Aug 2019 17:07:57 +1200 Subject: [PATCH] Inline all non-entry-point functions --- spirv_msl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spirv_msl.cpp b/spirv_msl.cpp index 004c56f5..e44b84b1 100644 --- a/spirv_msl.cpp +++ b/spirv_msl.cpp @@ -5368,9 +5368,10 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &) add_function_overload(func); local_variable_names = resource_names; - string decl; processing_entry_point = (func.self == ir.default_entry_point); + + string decl = processing_entry_point ? "" : "inline "; auto &type = get(func.return_type); @@ -5381,7 +5382,7 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &) else { // We cannot return arrays in MSL, so "return" through an out variable. - decl = "void"; + decl += "void"; } decl += " ";