diff --git a/spirv_msl.cpp b/spirv_msl.cpp index 9593c405..b5113cef 100644 --- a/spirv_msl.cpp +++ b/spirv_msl.cpp @@ -1104,6 +1104,22 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in return string(" [[color(") + convert_to_string(locn) + ")]]"; } + // Compute function inputs + if (execution.model == ExecutionModelGLCompute && type.storage == StorageClassInput) + { + if (is_builtin) + { + switch (builtin) + { + case BuiltInGlobalInvocationId: + return string(" [[") + builtin_qualifier(builtin) + "]]"; + + default: + return ""; + } + } + } + return ""; } @@ -1610,6 +1626,10 @@ string CompilerMSL::builtin_qualifier(BuiltIn builtin) return "depth(any)"; } + // Fragment function in + case BuiltInGlobalInvocationId: + return "thread_position_in_grid"; + default: return "unsupported-built-in"; } @@ -1650,6 +1670,10 @@ string CompilerMSL::builtin_type_decl(BuiltIn builtin) case BuiltInSampleMask: return "uint"; + // Compute function in + case BuiltInGlobalInvocationId: + return "uint3"; + default: return "unsupported-built-in-type"; }