diff options
Diffstat (limited to '3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag')
-rw-r--r-- | 3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag index 23c554940b8..67895e3e92c 100644 --- a/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag +++ b/3rdparty/bgfx/3rdparty/spirv-cross/reference/shaders-msl/vulkan/frag/basic.multiview.nocompat.vk.frag @@ -1,8 +1,49 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" +#pragma clang diagnostic ignored "-Wmissing-braces" + #include <metal_stdlib> #include <simd/simd.h> using namespace metal; +template<typename T, size_t Num> +struct spvUnsafeArray +{ + T elements[Num ? Num : 1]; + + thread T& operator [] (size_t pos) thread + { + return elements[pos]; + } + constexpr const thread T& operator [] (size_t pos) const thread + { + return elements[pos]; + } + + device T& operator [] (size_t pos) device + { + return elements[pos]; + } + constexpr const device T& operator [] (size_t pos) const device + { + return elements[pos]; + } + + constexpr const constant T& operator [] (size_t pos) const constant + { + return elements[pos]; + } + + threadgroup T& operator [] (size_t pos) threadgroup + { + return elements[pos]; + } + constexpr const threadgroup T& operator [] (size_t pos) const threadgroup + { + return elements[pos]; + } +}; + struct main0_out { float4 FragColor [[color(0)]]; @@ -20,7 +61,7 @@ struct main0_in fragment main0_out main0(main0_in in [[stage_in]], constant uint* spvViewMask [[buffer(24)]], texture2d<float> uTex [[texture(0)]], sampler uTexSmplr [[sampler(0)]], uint gl_ViewIndex [[render_target_array_index]]) { main0_out out = {}; - float2 vTex[4] = {}; + spvUnsafeArray<float2, 4> vTex = {}; vTex[0] = in.vTex_0; vTex[1] = in.vTex_1; vTex[2] = in.vTex_2; |