diff options
author | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-01-18 16:34:00 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <post@arntzen-software.no> | 2022-01-18 16:40:52 +0300 |
commit | 5b952d2cbfe38fe34c76b5f3daace8b579e4f9c0 (patch) | |
tree | 876e7004ae1c145e4e01d5ea415d874743ba4630 /reference/opt/shaders-msl | |
parent | 08d5f5ed181f489e77f94d168071fb5605f2792a (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/opt/shaders-msl')
-rw-r--r-- | reference/opt/shaders-msl/asm/comp/image-load-store-short-vector.invalid.asm.comp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/reference/opt/shaders-msl/asm/comp/image-load-store-short-vector.invalid.asm.comp b/reference/opt/shaders-msl/asm/comp/image-load-store-short-vector.invalid.asm.comp index fca572e3..53655639 100644 --- a/reference/opt/shaders-msl/asm/comp/image-load-store-short-vector.invalid.asm.comp +++ b/reference/opt/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); |