diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-01-18 17:25:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 17:25:32 +0300 |
commit | 53d94a982e1d654515b44db5391de37f85489204 (patch) | |
tree | 6a70237c9ffd7e733ecf780b30723c97b120042f /reference/shaders-msl | |
parent | 5a29181b357dc572125e7da2b8c24020be848af7 (diff) | |
parent | 5b952d2cbfe38fe34c76b5f3daace8b579e4f9c0 (diff) |
Merge pull request #1852 from KhronosGroup/fix-1850sdk-1.3.204.1sdk-1.3.204.0sdk-1.3.204
MSL: Rethink how opaque descriptors are passed to leaf functions.
Diffstat (limited to 'reference/shaders-msl')
25 files changed, 40 insertions, 40 deletions
diff --git a/reference/shaders-msl/asm/comp/image-load-store-short-vector.invalid.asm.comp b/reference/shaders-msl/asm/comp/image-load-store-short-vector.invalid.asm.comp index fca572e3..53655639 100644 --- a/reference/shaders-msl/asm/comp/image-load-store-short-vector.invalid.asm.comp +++ b/reference/shaders-msl/asm/comp/image-load-store-short-vector.invalid.asm.comp @@ -6,7 +6,7 @@ using namespace metal; static inline __attribute__((always_inline)) -void _main(thread const uint3& id, thread texture2d<float, access::read_write> TargetTexture) +void _main(thread const uint3& id, texture2d<float, access::read_write> TargetTexture) { float2 loaded = TargetTexture.read(uint2(id.xy)).xy; float2 storeTemp = loaded + float2(1.0); diff --git a/reference/shaders-msl/asm/frag/depth-image-color-format-fetch.asm.frag b/reference/shaders-msl/asm/frag/depth-image-color-format-fetch.asm.frag index 01c670d9..46bdd3e4 100644 --- a/reference/shaders-msl/asm/frag/depth-image-color-format-fetch.asm.frag +++ b/reference/shaders-msl/asm/frag/depth-image-color-format-fetch.asm.frag @@ -21,14 +21,14 @@ struct main0_in }; static inline __attribute__((always_inline)) -void _108(int _109, thread texture2d<float> v_8, device _7& v_10) +void _108(int _109, texture2d<float> v_8, device _7& v_10) { int2 _113 = int2(_109 - 8 * (_109 / 8), _109 / 8); v_10._m0[_109] = v_8.read(uint2(_113), 0); } static inline __attribute__((always_inline)) -float4 _98(float4 _119, thread texture2d<float> v_8, device _7& v_10) +float4 _98(float4 _119, texture2d<float> v_8, device _7& v_10) { for (int _121 = 0; _121 < 64; _121++) { diff --git a/reference/shaders-msl/asm/frag/depth-image-color-format-sampled.asm.frag b/reference/shaders-msl/asm/frag/depth-image-color-format-sampled.asm.frag index 9e374c0a..df9f8f43 100644 --- a/reference/shaders-msl/asm/frag/depth-image-color-format-sampled.asm.frag +++ b/reference/shaders-msl/asm/frag/depth-image-color-format-sampled.asm.frag @@ -21,13 +21,13 @@ struct main0_in }; static inline __attribute__((always_inline)) -void _108(int _109, thread texture2d<float> v_8, thread sampler v_9, device _7& v_10) +void _108(int _109, texture2d<float> v_8, sampler v_9, device _7& v_10) { v_10._m0[_109] = v_8.sample(v_9, (float2(int2(_109 - 8 * (_109 / 8), _109 / 8)) / float2(8.0)), level(0.0)); } static inline __attribute__((always_inline)) -float4 _98(float4 _121, thread texture2d<float> v_8, thread sampler v_9, device _7& v_10) +float4 _98(float4 _121, texture2d<float> v_8, sampler v_9, device _7& v_10) { for (int _123 = 0; _123 < 64; _123++) { diff --git a/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag b/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag index 01a0e5a7..e512bdca 100644 --- a/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag +++ b/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag @@ -16,13 +16,13 @@ struct main0_in }; static inline __attribute__((always_inline)) -float sample_combined(thread float3& vUV, thread depth2d<float> uShadow, thread const sampler uShadowSmplr) +float sample_combined(thread float3& vUV, depth2d<float> uShadow, sampler uShadowSmplr) { return uShadow.sample_compare(uShadowSmplr, vUV.xy, vUV.z); } static inline __attribute__((always_inline)) -float sample_separate(thread float3& vUV, thread depth2d<float> uTexture, thread sampler uSampler) +float sample_separate(thread float3& vUV, depth2d<float> uTexture, sampler uSampler) { return uTexture.sample_compare(uSampler, vUV.xy, vUV.z); } diff --git a/reference/shaders-msl/frag/argument-buffers.msl2.argument.frag b/reference/shaders-msl/frag/argument-buffers.msl2.argument.frag index b7005ff9..fd0a3def 100644 --- a/reference/shaders-msl/frag/argument-buffers.msl2.argument.frag +++ b/reference/shaders-msl/frag/argument-buffers.msl2.argument.frag @@ -63,7 +63,7 @@ struct main0_in }; static inline __attribute__((always_inline)) -float4 sample_in_function2(thread texture2d<float> uTexture, thread const sampler uTextureSmplr, thread float2& vUV, thread const array<texture2d<float>, 4> uTexture2, thread const array<sampler, 2> uSampler, thread const array<texture2d<float>, 2> uTextures, thread const array<sampler, 2> uTexturesSmplr, device SSBO& v_60, const device SSBOs* constant (&ssbos)[2], constant Push& registers) +float4 sample_in_function2(texture2d<float> uTexture, sampler uTextureSmplr, thread float2& vUV, constant array<texture2d<float>, 4>& uTexture2, constant array<sampler, 2>& uSampler, constant array<texture2d<float>, 2>& uTextures, constant array<sampler, 2>& uTexturesSmplr, device SSBO& v_60, const device SSBOs* constant (&ssbos)[2], constant Push& registers) { float4 ret = uTexture.sample(uTextureSmplr, vUV); ret += uTexture2[2].sample(uSampler[1], vUV); @@ -75,7 +75,7 @@ float4 sample_in_function2(thread texture2d<float> uTexture, thread const sample } static inline __attribute__((always_inline)) -float4 sample_in_function(thread texture2d<float> uTexture, thread const sampler uTextureSmplr, thread float2& vUV, thread const array<texture2d<float>, 4> uTexture2, thread const array<sampler, 2> uSampler, thread const array<texture2d<float>, 2> uTextures, thread const array<sampler, 2> uTexturesSmplr, device SSBO& v_60, const device SSBOs* constant (&ssbos)[2], constant Push& registers, constant UBO& v_90, constant UBOs* constant (&ubos)[4]) +float4 sample_in_function(texture2d<float> uTexture, sampler uTextureSmplr, thread float2& vUV, constant array<texture2d<float>, 4>& uTexture2, constant array<sampler, 2>& uSampler, constant array<texture2d<float>, 2>& uTextures, constant array<sampler, 2>& uTexturesSmplr, device SSBO& v_60, const device SSBOs* constant (&ssbos)[2], constant Push& registers, constant UBO& v_90, constant UBOs* constant (&ubos)[4]) { float4 ret = sample_in_function2(uTexture, uTextureSmplr, vUV, uTexture2, uSampler, uTextures, uTexturesSmplr, v_60, ssbos, registers); ret += v_90.ubo; diff --git a/reference/shaders-msl/frag/array-of-texture-swizzle-nonconstant-uniform.msl2.argument.discrete.swizzle.frag b/reference/shaders-msl/frag/array-of-texture-swizzle-nonconstant-uniform.msl2.argument.discrete.swizzle.frag index 3e8ce2df..9c02d302 100644 --- a/reference/shaders-msl/frag/array-of-texture-swizzle-nonconstant-uniform.msl2.argument.discrete.swizzle.frag +++ b/reference/shaders-msl/frag/array-of-texture-swizzle-nonconstant-uniform.msl2.argument.discrete.swizzle.frag @@ -95,13 +95,13 @@ struct main0_in }; static inline __attribute__((always_inline)) -float4 sample_in_func(thread const array<texture2d<float>, 4> uSampler, thread const array<sampler, 4> uSamplerSmplr, constant uint* uSamplerSwzl, constant UBO& uUBO, thread float2& vUV) +float4 sample_in_func(constant array<texture2d<float>, 4>& uSampler, constant array<sampler, 4>& uSamplerSmplr, constant uint* uSamplerSwzl, constant UBO& uUBO, thread float2& vUV) { return spvTextureSwizzle(uSampler[uUBO.index].sample(uSamplerSmplr[uUBO.index], vUV), uSamplerSwzl[uUBO.index]); } static inline __attribute__((always_inline)) -float4 sample_single_in_func(thread const texture2d<float> s, thread const sampler sSmplr, constant uint& sSwzl, thread float2& vUV) +float4 sample_single_in_func(texture2d<float> s, sampler sSmplr, constant uint& sSwzl, thread float2& vUV) { return spvTextureSwizzle(s.sample(sSmplr, vUV), sSwzl); } diff --git a/reference/shaders-msl/frag/array-of-texture-swizzle-nonconstant-uniform.msl2.swizzle.frag b/reference/shaders-msl/frag/array-of-texture-swizzle-nonconstant-uniform.msl2.swizzle.frag index 87d33039..978ecbe1 100644 --- a/reference/shaders-msl/frag/array-of-texture-swizzle-nonconstant-uniform.msl2.swizzle.frag +++ b/reference/shaders-msl/frag/array-of-texture-swizzle-nonconstant-uniform.msl2.swizzle.frag @@ -86,13 +86,13 @@ struct main0_in }; static inline __attribute__((always_inline)) -float4 sample_in_func(thread const array<texture2d<float>, 4> uSampler, thread const array<sampler, 4> uSamplerSmplr, constant uint* uSamplerSwzl, constant UBO& uUBO, thread float2& vUV) +float4 sample_in_func(thread const array<texture2d<float>, 4>& uSampler, thread const array<sampler, 4>& uSamplerSmplr, constant uint* uSamplerSwzl, constant UBO& uUBO, thread float2& vUV) { return spvTextureSwizzle(uSampler[uUBO.index].sample(uSamplerSmplr[uUBO.index], vUV), uSamplerSwzl[uUBO.index]); } static inline __attribute__((always_inline)) -float4 sample_single_in_func(thread const texture2d<float> s, thread const sampler sSmplr, constant uint& sSwzl, thread float2& vUV) +float4 sample_single_in_func(texture2d<float> s, sampler sSmplr, constant uint& sSwzl, thread float2& vUV) { return spvTextureSwizzle(s.sample(sSmplr, vUV), sSwzl); } diff --git a/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.argument.discrete.swizzle.frag b/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.argument.discrete.swizzle.frag index 9336688d..43a61e1f 100644 --- a/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.argument.discrete.swizzle.frag +++ b/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.argument.discrete.swizzle.frag @@ -83,19 +83,19 @@ struct main0_in }; static inline __attribute__((always_inline)) -float4 sample_in_func_1(thread const array<texture2d<float>, 4> uSampler0, thread const array<sampler, 4> uSampler0Smplr, constant uint* uSampler0Swzl, thread float2& vUV) +float4 sample_in_func_1(constant array<texture2d<float>, 4>& uSampler0, constant array<sampler, 4>& uSampler0Smplr, constant uint* uSampler0Swzl, thread float2& vUV) { return spvTextureSwizzle(uSampler0[2].sample(uSampler0Smplr[2], vUV), uSampler0Swzl[2]); } static inline __attribute__((always_inline)) -float4 sample_in_func_2(thread float2& vUV, thread texture2d<float> uSampler1, thread const sampler uSampler1Smplr, constant uint& uSampler1Swzl) +float4 sample_in_func_2(thread float2& vUV, texture2d<float> uSampler1, sampler uSampler1Smplr, constant uint& uSampler1Swzl) { return spvTextureSwizzle(uSampler1.sample(uSampler1Smplr, vUV), uSampler1Swzl); } static inline __attribute__((always_inline)) -float4 sample_single_in_func(thread const texture2d<float> s, thread const sampler sSmplr, constant uint& sSwzl, thread float2& vUV) +float4 sample_single_in_func(texture2d<float> s, sampler sSmplr, constant uint& sSwzl, thread float2& vUV) { return spvTextureSwizzle(s.sample(sSmplr, vUV), sSwzl); } diff --git a/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.swizzle.frag b/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.swizzle.frag index e1cb4525..1db803c5 100644 --- a/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.swizzle.frag +++ b/reference/shaders-msl/frag/array-of-texture-swizzle.msl2.swizzle.frag @@ -76,13 +76,13 @@ struct main0_in }; static inline __attribute__((always_inline)) -float4 sample_in_func(thread const array<texture2d<float>, 4> uSampler, thread const array<sampler, 4> uSamplerSmplr, constant uint* uSamplerSwzl, thread float2& vUV) +float4 sample_in_func(thread const array<texture2d<float>, 4>& uSampler, thread const array<sampler, 4>& uSamplerSmplr, constant uint* uSamplerSwzl, thread float2& vUV) { return spvTextureSwizzle(uSampler[2].sample(uSamplerSmplr[2], vUV), uSamplerSwzl[2]); } static inline __attribute__((always_inline)) -float4 sample_single_in_func(thread const texture2d<float> s, thread const sampler sSmplr, constant uint& sSwzl, thread float2& vUV) +float4 sample_single_in_func(texture2d<float> s, sampler sSmplr, constant uint& sSwzl, thread float2& vUV) { return spvTextureSwizzle(s.sample(sSmplr, vUV), sSwzl); } diff --git a/reference/shaders-msl/frag/helper-invocation.msl21.frag b/reference/shaders-msl/frag/helper-invocation.msl21.frag index 97d69e19..7cf97a25 100644 --- a/reference/shaders-msl/frag/helper-invocation.msl21.frag +++ b/reference/shaders-msl/frag/helper-invocation.msl21.frag @@ -16,7 +16,7 @@ struct main0_in }; static inline __attribute__((always_inline)) -float4 foo(thread bool& gl_HelperInvocation, thread texture2d<float> uSampler, thread const sampler uSamplerSmplr, thread float2& vUV) +float4 foo(thread bool& gl_HelperInvocation, texture2d<float> uSampler, sampler uSamplerSmplr, thread float2& vUV) { float4 color; if (!gl_HelperInvocation) diff --git a/reference/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag b/reference/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag index 0e35c248..a3583584 100644 --- a/reference/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag +++ b/reference/shaders-msl/frag/huge-argument-buffer.device-argument-buffer.argument.msl2.frag @@ -38,13 +38,13 @@ struct main0_in }; static inline __attribute__((always_inline)) -float4 samp_array(thread const array<texture2d<float>, 10000> uSamplers, thread const array<sampler, 10000> uSamplersSmplr, thread float2& vUV, constant UBO* const device (&vs)[10000]) +float4 samp_array(const device array<texture2d<float>, 10000>& uSamplers, const device array<sampler, 10000>& uSamplersSmplr, thread float2& vUV, constant UBO* const device (&vs)[10000]) { return uSamplers[9999].sample(uSamplersSmplr[9999], vUV) + vs[5000]->v; } static inline __attribute__((always_inline)) -float4 samp_single(thread float2& vUV, thread texture2d<float> uSampler, thread const sampler uSamplerSmplr) +float4 samp_single(thread float2& vUV, texture2d<float> uSampler, sampler uSamplerSmplr) { return uSampler.sample(uSamplerSmplr, vUV); } diff --git a/reference/shaders-msl/frag/image-query-lod.msl22.frag b/reference/shaders-msl/frag/image-query-lod.msl22.frag index 6e7991f2..2362597f 100644 --- a/reference/shaders-msl/frag/image-query-lod.msl22.frag +++ b/reference/shaders-msl/frag/image-query-lod.msl22.frag @@ -16,7 +16,7 @@ struct main0_in }; static inline __attribute__((always_inline)) -void from_function(thread float2& FragColor, thread texture2d<float> uSampler2D, thread const sampler uSampler2DSmplr, thread float3& vUV, thread texture3d<float> uSampler3D, thread const sampler uSampler3DSmplr, thread texturecube<float> uSamplerCube, thread const sampler uSamplerCubeSmplr, thread texture2d<float> uTexture2D, thread sampler uSampler, thread texture3d<float> uTexture3D, thread texturecube<float> uTextureCube) +void from_function(thread float2& FragColor, texture2d<float> uSampler2D, sampler uSampler2DSmplr, thread float3& vUV, texture3d<float> uSampler3D, sampler uSampler3DSmplr, texturecube<float> uSamplerCube, sampler uSamplerCubeSmplr, texture2d<float> uTexture2D, sampler uSampler, texture3d<float> uTexture3D, texturecube<float> uTextureCube) { float2 _22; _22.x = uSampler2D.calculate_clamped_lod(uSampler2DSmplr, vUV.xy); diff --git a/reference/shaders-msl/frag/input-attachment-ms.arrayed-subpass.msl21.frag b/reference/shaders-msl/frag/input-attachment-ms.arrayed-subpass.msl21.frag index f7b1441f..3f91c2c4 100644 --- a/reference/shaders-msl/frag/input-attachment-ms.arrayed-subpass.msl21.frag +++ b/reference/shaders-msl/frag/input-attachment-ms.arrayed-subpass.msl21.frag @@ -11,7 +11,7 @@ struct main0_out }; static inline __attribute__((always_inline)) -float4 load_subpasses(thread const texture2d_ms_array<float> uInput, thread uint& gl_SampleID, thread float4& gl_FragCoord, thread uint& gl_Layer) +float4 load_subpasses(texture2d_ms_array<float> uInput, thread uint& gl_SampleID, thread float4& gl_FragCoord, thread uint& gl_Layer) { float4 _24 = uInput.read(uint2(gl_FragCoord.xy), gl_Layer, gl_SampleID); return _24; diff --git a/reference/shaders-msl/frag/input-attachment-ms.frag b/reference/shaders-msl/frag/input-attachment-ms.frag index 5e1f504a..97629d8e 100644 --- a/reference/shaders-msl/frag/input-attachment-ms.frag +++ b/reference/shaders-msl/frag/input-attachment-ms.frag @@ -11,7 +11,7 @@ struct main0_out }; static inline __attribute__((always_inline)) -float4 load_subpasses(thread const texture2d_ms<float> uInput, thread uint& gl_SampleID, thread float4& gl_FragCoord) +float4 load_subpasses(texture2d_ms<float> uInput, thread uint& gl_SampleID, thread float4& gl_FragCoord) { float4 _24 = uInput.read(uint2(gl_FragCoord.xy), gl_SampleID); return _24; diff --git a/reference/shaders-msl/frag/input-attachment-ms.multiview.msl21.frag b/reference/shaders-msl/frag/input-attachment-ms.multiview.msl21.frag index 5e8c5339..1b6b9f6a 100644 --- a/reference/shaders-msl/frag/input-attachment-ms.multiview.msl21.frag +++ b/reference/shaders-msl/frag/input-attachment-ms.multiview.msl21.frag @@ -11,7 +11,7 @@ struct main0_out }; static inline __attribute__((always_inline)) -float4 load_subpasses(thread const texture2d_ms_array<float> uInput, thread uint& gl_SampleID, thread float4& gl_FragCoord, thread uint& gl_ViewIndex) +float4 load_subpasses(texture2d_ms_array<float> uInput, thread uint& gl_SampleID, thread float4& gl_FragCoord, thread uint& gl_ViewIndex) { float4 _24 = uInput.read(uint2(gl_FragCoord.xy), gl_ViewIndex, gl_SampleID); return _24; diff --git a/reference/shaders-msl/frag/input-attachment.arrayed-subpass.frag b/reference/shaders-msl/frag/input-attachment.arrayed-subpass.frag index 76d0a3cf..934abd58 100644 --- a/reference/shaders-msl/frag/input-attachment.arrayed-subpass.frag +++ b/reference/shaders-msl/frag/input-attachment.arrayed-subpass.frag @@ -11,7 +11,7 @@ struct main0_out }; static inline __attribute__((always_inline)) -float4 load_subpasses(thread const texture2d_array<float> uInput, thread float4& gl_FragCoord, thread uint& gl_Layer) +float4 load_subpasses(texture2d_array<float> uInput, thread float4& gl_FragCoord, thread uint& gl_Layer) { return uInput.read(uint2(gl_FragCoord.xy), gl_Layer); } diff --git a/reference/shaders-msl/frag/input-attachment.frag b/reference/shaders-msl/frag/input-attachment.frag index 93bbaec0..0643acfa 100644 --- a/reference/shaders-msl/frag/input-attachment.frag +++ b/reference/shaders-msl/frag/input-attachment.frag @@ -11,7 +11,7 @@ struct main0_out }; static inline __attribute__((always_inline)) -float4 load_subpasses(thread const texture2d<float> uInput, thread float4& gl_FragCoord) +float4 load_subpasses(texture2d<float> uInput, thread float4& gl_FragCoord) { return uInput.read(uint2(gl_FragCoord.xy)); } diff --git a/reference/shaders-msl/frag/input-attachment.multiview.frag b/reference/shaders-msl/frag/input-attachment.multiview.frag index 931790b8..6ba24216 100644 --- a/reference/shaders-msl/frag/input-attachment.multiview.frag +++ b/reference/shaders-msl/frag/input-attachment.multiview.frag @@ -11,7 +11,7 @@ struct main0_out }; static inline __attribute__((always_inline)) -float4 load_subpasses(thread const texture2d_array<float> uInput, thread float4& gl_FragCoord, thread uint& gl_ViewIndex) +float4 load_subpasses(texture2d_array<float> uInput, thread float4& gl_FragCoord, thread uint& gl_ViewIndex) { return uInput.read(uint2(gl_FragCoord.xy), gl_ViewIndex); } diff --git a/reference/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag b/reference/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag index a093d3f4..f0bf396c 100644 --- a/reference/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag +++ b/reference/shaders-msl/frag/sample-depth-propagate-state-from-resource.frag @@ -16,19 +16,19 @@ struct main0_in }; static inline __attribute__((always_inline)) -float sample_normal2(thread const depth2d<float> tex, thread sampler uSampler, thread float3& vUV) +float sample_normal2(depth2d<float> tex, sampler uSampler, thread float3& vUV) { return float4(tex.sample(uSampler, vUV.xy)).x; } static inline __attribute__((always_inline)) -float sample_normal(thread const depth2d<float> tex, thread sampler uSampler, thread float3& vUV) +float sample_normal(depth2d<float> tex, sampler uSampler, thread float3& vUV) { return sample_normal2(tex, uSampler, vUV); } static inline __attribute__((always_inline)) -float sample_comp(thread const depth2d<float> tex, thread float3& vUV, thread sampler uSamplerShadow) +float sample_comp(depth2d<float> tex, thread float3& vUV, sampler uSamplerShadow) { return tex.sample_compare(uSamplerShadow, vUV.xy, vUV.z); } diff --git a/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag b/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag index 115ed9fa..27653a06 100644 --- a/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag +++ b/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag @@ -11,13 +11,13 @@ struct main0_out }; static inline __attribute__((always_inline)) -float sample_depth_from_function(thread const depth2d<float> uT, thread const sampler uS) +float sample_depth_from_function(depth2d<float> uT, sampler uS) { return uT.sample_compare(uS, float3(0.5).xy, 0.5); } static inline __attribute__((always_inline)) -float sample_color_from_function(thread const texture2d<float> uT, thread const sampler uS) +float sample_color_from_function(texture2d<float> uT, sampler uS) { return uT.sample(uS, float2(0.5)).x; } diff --git a/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag b/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag index dec6d051..8d1934d4 100644 --- a/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag +++ b/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag @@ -17,19 +17,19 @@ struct main0_in }; static inline __attribute__((always_inline)) -float4 sample_from_global(thread int& vIndex, thread float2& vTex, thread const array<texture2d<float>, 4> uSampler, thread const array<sampler, 4> uSamplerSmplr) +float4 sample_from_global(thread int& vIndex, thread float2& vTex, thread const array<texture2d<float>, 4>& uSampler, thread const array<sampler, 4>& uSamplerSmplr) { return uSampler[vIndex].sample(uSamplerSmplr[vIndex], (vTex + float2(0.100000001490116119384765625))); } static inline __attribute__((always_inline)) -float4 sample_from_argument(thread const array<texture2d<float>, 4> samplers, thread const array<sampler, 4> samplersSmplr, thread int& vIndex, thread float2& vTex) +float4 sample_from_argument(thread const array<texture2d<float>, 4>& samplers, thread const array<sampler, 4>& samplersSmplr, thread int& vIndex, thread float2& vTex) { return samplers[vIndex].sample(samplersSmplr[vIndex], (vTex + float2(0.20000000298023223876953125))); } static inline __attribute__((always_inline)) -float4 sample_single_from_argument(thread const texture2d<float> samp, thread const sampler sampSmplr, thread float2& vTex) +float4 sample_single_from_argument(texture2d<float> samp, sampler sampSmplr, thread float2& vTex) { return samp.sample(sampSmplr, (vTex + float2(0.300000011920928955078125))); } diff --git a/reference/shaders-msl/frag/sampler.frag b/reference/shaders-msl/frag/sampler.frag index 6484161b..84743fbd 100644 --- a/reference/shaders-msl/frag/sampler.frag +++ b/reference/shaders-msl/frag/sampler.frag @@ -17,7 +17,7 @@ struct main0_in }; static inline __attribute__((always_inline)) -float4 sample_texture(thread const texture2d<float> tex, thread const sampler texSmplr, thread const float2& uv) +float4 sample_texture(texture2d<float> tex, sampler texSmplr, thread const float2& uv) { return tex.sample(texSmplr, uv); } diff --git a/reference/shaders-msl/frag/separate-image-sampler-argument.frag b/reference/shaders-msl/frag/separate-image-sampler-argument.frag index d196243d..208f5d90 100644 --- a/reference/shaders-msl/frag/separate-image-sampler-argument.frag +++ b/reference/shaders-msl/frag/separate-image-sampler-argument.frag @@ -11,7 +11,7 @@ struct main0_out }; static inline __attribute__((always_inline)) -float4 samp(thread const texture2d<float> t, thread const sampler s) +float4 samp(texture2d<float> t, sampler s) { return t.sample(s, float2(0.5)); } diff --git a/reference/shaders-msl/tese/water_tess.tese b/reference/shaders-msl/tese/water_tess.tese index 7ecbb166..5f63d94f 100644 --- a/reference/shaders-msl/tese/water_tess.tese +++ b/reference/shaders-msl/tese/water_tess.tese @@ -45,7 +45,7 @@ float2 lod_factor(thread const float2& tess_coord, thread float4& vPatchLods) } static inline __attribute__((always_inline)) -float3 sample_height_displacement(thread const float2& uv, thread const float2& off, thread const float2& lod, thread texture2d<float> uHeightmapDisplacement, thread const sampler uHeightmapDisplacementSmplr) +float3 sample_height_displacement(thread const float2& uv, thread const float2& off, thread const float2& lod, texture2d<float> uHeightmapDisplacement, sampler uHeightmapDisplacementSmplr) { return mix(uHeightmapDisplacement.sample(uHeightmapDisplacementSmplr, (uv + (off * 0.5)), level(lod.x)).xyz, uHeightmapDisplacement.sample(uHeightmapDisplacementSmplr, (uv + (off * 1.0)), level(lod.x + 1.0)).xyz, float3(lod.y)); } diff --git a/reference/shaders-msl/vert/resource-arrays-leaf.ios.vert b/reference/shaders-msl/vert/resource-arrays-leaf.ios.vert index 8ab252f5..fad06d6a 100644 --- a/reference/shaders-msl/vert/resource-arrays-leaf.ios.vert +++ b/reference/shaders-msl/vert/resource-arrays-leaf.ios.vert @@ -23,7 +23,7 @@ struct constant_block constant int arraySize = SPIRV_CROSS_CONSTANT_ID_0; static inline __attribute__((always_inline)) -void doWork(device storage_block* (&storage)[2], constant constant_block* (&constants)[4], thread const array<texture2d<int>, 3> images) +void doWork(device storage_block* (&storage)[2], constant constant_block* (&constants)[4], thread const array<texture2d<int>, 3>& images) { storage[0]->baz = uint4(constants[3]->foo); storage[1]->quux = images[2].read(uint2(int2(constants[1]->bar))).xy; |