MSL: Always use input_attachment_index for framebuffer fetch binding.

--msl-decoration-binding would end up overriding the input attachment
index to binding which is very unexpected and broken.
diff --git a/reference/shaders-msl-no-opt/frag/subpass-input.decoration-binding.ios.framebuffer-fetch.msl2.argument.frag b/reference/shaders-msl-no-opt/frag/subpass-input.decoration-binding.ios.framebuffer-fetch.msl2.argument.frag
new file mode 100644
index 0000000..8c7f67b
--- /dev/null
+++ b/reference/shaders-msl-no-opt/frag/subpass-input.decoration-binding.ios.framebuffer-fetch.msl2.argument.frag
@@ -0,0 +1,23 @@
+#include <metal_stdlib>
+#include <simd/simd.h>
+
+using namespace metal;
+
+struct spvDescriptorSetBuffer0
+{
+    sampler uSampler [[id(8)]];
+    texture2d<float> uTex [[id(9)]];
+};
+
+struct main0_out
+{
+    float4 FragColor [[color(0)]];
+};
+
+fragment main0_out main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], float4 uSub [[color(1)]])
+{
+    main0_out out = {};
+    out.FragColor = uSub + spvDescriptorSet0.uTex.sample(spvDescriptorSet0.uSampler, float2(0.5));
+    return out;
+}
+
diff --git a/shaders-msl-no-opt/frag/subpass-input.decoration-binding.ios.framebuffer-fetch.msl2.argument.frag b/shaders-msl-no-opt/frag/subpass-input.decoration-binding.ios.framebuffer-fetch.msl2.argument.frag
new file mode 100644
index 0000000..671a4d1
--- /dev/null
+++ b/shaders-msl-no-opt/frag/subpass-input.decoration-binding.ios.framebuffer-fetch.msl2.argument.frag
@@ -0,0 +1,12 @@
+#version 450
+
+layout(set = 0, binding = 10, input_attachment_index = 1) uniform subpassInput uSub;
+layout(location = 0) out vec4 FragColor;
+
+layout(set = 0, binding = 9) uniform texture2D uTex;
+layout(set = 0, binding = 8) uniform sampler uSampler;
+
+void main()
+{
+	FragColor = subpassLoad(uSub) + texture(sampler2D(uTex, uSampler), vec2(0.5));
+}
diff --git a/spirv_msl.cpp b/spirv_msl.cpp
index daca7c7..1060bb2 100644
--- a/spirv_msl.cpp
+++ b/spirv_msl.cpp
@@ -11723,10 +11723,18 @@
 	if (has_extended_decoration(var.self, resource_decoration))
 		return get_extended_decoration(var.self, resource_decoration);
 
-	// Allow user to enable decoration binding
-	if (msl_options.enable_decoration_binding)
+	auto &type = get<SPIRType>(var.basetype);
+
+	if (type_is_msl_framebuffer_fetch(type))
 	{
-		// If there is no explicit mapping of bindings to MSL, use the declared binding.
+		// Frame-buffer fetch gets its fallback resource index from the input attachment index,
+		// which is then treated as color index.
+		return get_decoration(var.self, DecorationInputAttachmentIndex);
+	}
+	else if (msl_options.enable_decoration_binding)
+	{
+		// Allow user to enable decoration binding.
+		// If there is no explicit mapping of bindings to MSL, use the declared binding as a fallback.
 		if (has_decoration(var.self, DecorationBinding))
 		{
 			var_binding = get_decoration(var.self, DecorationBinding);
@@ -11745,7 +11753,6 @@
 		allocate_argument_buffer_ids = descriptor_set_is_argument_buffer(var_desc_set);
 
 	uint32_t binding_stride = 1;
-	auto &type = get<SPIRType>(var.basetype);
 	for (uint32_t i = 0; i < uint32_t(type.array.size()); i++)
 		binding_stride *= to_array_size_literal(type, i);
 
@@ -11754,13 +11761,7 @@
 	// If a binding has not been specified, revert to incrementing resource indices.
 	uint32_t resource_index;
 
-	if (type_is_msl_framebuffer_fetch(type))
-	{
-		// Frame-buffer fetch gets its fallback resource index from the input attachment index,
-		// which is then treated as color index.
-		resource_index = get_decoration(var.self, DecorationInputAttachmentIndex);
-	}
-	else if (allocate_argument_buffer_ids)
+	if (allocate_argument_buffer_ids)
 	{
 		// Allocate from a flat ID binding space.
 		resource_index = next_metal_resource_ids[var_desc_set];
diff --git a/test_shaders.py b/test_shaders.py
index 3e0eae3..3d9969d 100755
--- a/test_shaders.py
+++ b/test_shaders.py
@@ -321,6 +321,8 @@
         msl_args.append('32')
     if '.force-sample.' in shader:
         msl_args.append('--msl-force-sample-rate-shading')
+    if '.decoration-binding.' in shader:
+        msl_args.append('--msl-decoration-binding')
 
     subprocess.check_call(msl_args)