Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2022-01-18 16:34:00 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2022-01-18 16:40:52 +0300
commit5b952d2cbfe38fe34c76b5f3daace8b579e4f9c0 (patch)
tree876e7004ae1c145e4e01d5ea415d874743ba4630 /reference/shaders-msl/frag/separate-image-sampler-argument.frag
parent08d5f5ed181f489e77f94d168071fb5605f2792a (diff)
MSL: Rethink how opaque descriptors are passed to leaf functions.
We were passing arrays by value which the compiler fails to optimize, causing abyssal performance. To fix this, we need to consider that descriptors can be in constant or const device address spaces. Also, lone descriptors are passed by value, so we explicitly remove address space qualifiers. One failure case is when shader passes a texture/sampler array as an argument. It's all UniformConstant in SPIR-V, but in MSL it might be thread, const device or constant, so that won't work ... Global variable use works fine though, and that should cover 99.9999999% of use cases.
Diffstat (limited to 'reference/shaders-msl/frag/separate-image-sampler-argument.frag')
-rw-r--r--reference/shaders-msl/frag/separate-image-sampler-argument.frag2
1 files changed, 1 insertions, 1 deletions
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));
}