mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Updated spirv-cross.
This commit is contained in:
2
3rdparty/spirv-cross/CMakeLists.txt
vendored
2
3rdparty/spirv-cross/CMakeLists.txt
vendored
@@ -287,7 +287,7 @@ if (SPIRV_CROSS_STATIC)
|
||||
endif()
|
||||
|
||||
set(spirv-cross-abi-major 0)
|
||||
set(spirv-cross-abi-minor 13)
|
||||
set(spirv-cross-abi-minor 14)
|
||||
set(spirv-cross-abi-patch 0)
|
||||
|
||||
if (SPIRV_CROSS_SHARED)
|
||||
|
||||
@@ -35,7 +35,7 @@ struct B_1
|
||||
/* FIXME: A padded struct is needed here. If you see this message, file a bug! */ A_2 Data[1024];
|
||||
};
|
||||
|
||||
kernel void main0(device B& C3 [[buffer(0)]], device A_1& C1 [[buffer(1)]], constant A_3& C2 [[buffer(2)]], constant B_1& C4 [[buffer(3)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device A_1& C1 [[buffer(0)]], constant A_3& C2 [[buffer(1)]], device B& C3 [[buffer(2)]], constant B_1& C4 [[buffer(3)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
C1.Data[gl_GlobalInvocationID.x].a = C2.Data[gl_GlobalInvocationID.x].a;
|
||||
C1.Data[gl_GlobalInvocationID.x].b = C2.Data[gl_GlobalInvocationID.x].b;
|
||||
|
||||
@@ -16,7 +16,7 @@ uint2 spvTexelBufferCoord(uint tc)
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
kernel void main0(constant cb5_struct& cb0_5 [[buffer(1)]], texture2d<uint, access::write> u0 [[texture(0)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
kernel void main0(constant cb5_struct& cb0_5 [[buffer(0)]], texture2d<uint, access::write> u0 [[texture(0)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
{
|
||||
uint _44 = as_type<uint>(as_type<float>(int(gl_LocalInvocationID.x) << 4)) >> 2u;
|
||||
uint4 _51 = as_type<uint4>(cb0_5._m0[uint(as_type<int>(as_type<float>(int(gl_LocalInvocationID.x)))) + 1u]);
|
||||
|
||||
@@ -16,7 +16,7 @@ uint2 spvTexelBufferCoord(uint tc)
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
kernel void main0(constant cb& _6 [[buffer(7)]], texture2d<float, access::write> _buffer [[texture(0)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
|
||||
kernel void main0(constant cb& _6 [[buffer(0)]], texture2d<float, access::write> _buffer [[texture(0)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
|
||||
{
|
||||
_buffer.write(float4(_6.value), spvTexelBufferCoord(((32u * gl_WorkGroupID.x) + gl_LocalInvocationIndex)));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ struct cb1_struct
|
||||
|
||||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(16u, 16u, 1u);
|
||||
|
||||
kernel void main0(constant cb1_struct& cb0_1 [[buffer(0)]], texture2d<float, access::write> u0 [[texture(1)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
kernel void main0(constant cb1_struct& cb0_1 [[buffer(0)]], texture2d<float, access::write> u0 [[texture(0)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
{
|
||||
int2 _46 = int2(u0.get_width(), u0.get_height()) >> int2(uint2(4u));
|
||||
int _97;
|
||||
|
||||
@@ -10,7 +10,7 @@ struct cb1_struct
|
||||
|
||||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(16u, 16u, 1u);
|
||||
|
||||
kernel void main0(constant cb1_struct& cb0_1 [[buffer(0)]], texture2d<float, access::write> u0 [[texture(1)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
kernel void main0(constant cb1_struct& cb0_1 [[buffer(0)]], texture2d<float, access::write> u0 [[texture(0)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
{
|
||||
int2 _40 = int2(u0.get_width(), u0.get_height()) >> int2(uint2(4u));
|
||||
int _80;
|
||||
|
||||
@@ -13,7 +13,7 @@ struct main0_in
|
||||
float2 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uTex [[texture(1)]], sampler uSampler [[sampler(0)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uTex [[texture(0)]], sampler uSampler [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uTex.sample(uSampler, in.vUV);
|
||||
|
||||
@@ -23,16 +23,8 @@ struct main0_out
|
||||
float4 m_3 [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(constant _6& _20 [[buffer(0)]], constant _7* _8_0 [[buffer(1)]], constant _7* _8_1 [[buffer(2)]], constant _7* _8_2 [[buffer(3)]], constant _7* _8_3 [[buffer(4)]], const device _4* _5_0 [[buffer(5)]], const device _4* _5_1 [[buffer(6)]], const device _4* _5_2 [[buffer(7)]], const device _4* _5_3 [[buffer(8)]])
|
||||
fragment main0_out main0(const device _4* _5_0 [[buffer(0)]], const device _4* _5_1 [[buffer(1)]], const device _4* _5_2 [[buffer(2)]], const device _4* _5_3 [[buffer(3)]], constant _6& _20 [[buffer(4)]], constant _7* _8_0 [[buffer(5)]], constant _7* _8_1 [[buffer(6)]], constant _7* _8_2 [[buffer(7)]], constant _7* _8_3 [[buffer(8)]])
|
||||
{
|
||||
constant _7* _8[] =
|
||||
{
|
||||
_8_0,
|
||||
_8_1,
|
||||
_8_2,
|
||||
_8_3,
|
||||
};
|
||||
|
||||
const device _4* _5[] =
|
||||
{
|
||||
_5_0,
|
||||
@@ -41,6 +33,14 @@ fragment main0_out main0(constant _6& _20 [[buffer(0)]], constant _7* _8_0 [[buf
|
||||
_5_3,
|
||||
};
|
||||
|
||||
constant _7* _8[] =
|
||||
{
|
||||
_8_0,
|
||||
_8_1,
|
||||
_8_2,
|
||||
_8_3,
|
||||
};
|
||||
|
||||
main0_out out = {};
|
||||
out.m_3 = _5[_20._m0]->_m0 + (_8[_20._m0]->_m0 * float4(0.20000000298023223876953125));
|
||||
return out;
|
||||
|
||||
22
3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/min-lod.msl22.asm.frag
vendored
Normal file
22
3rdparty/spirv-cross/reference/opt/shaders-msl/asm/frag/min-lod.msl22.asm.frag
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float2 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uSampler [[texture(0)]], sampler uSamplerSmplr [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uSampler.sample(uSamplerSmplr, in.vUV, min_lod_clamp(4.0));
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct main0_out
|
||||
float4 o0 [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(constant push_cb& _19 [[buffer(0)]], texture2d<float> t0 [[texture(2)]], sampler dummy_sampler [[sampler(4)]])
|
||||
fragment main0_out main0(constant push_cb& _19 [[buffer(0)]], texture2d<float> t0 [[texture(0)]], sampler dummy_sampler [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.o0 = t0.read(uint2(as_type<int2>(_19.cb0[0u].zw)) + uint2(int2(-1, -2)), as_type<int>(0.0));
|
||||
|
||||
@@ -13,7 +13,7 @@ struct main0_in
|
||||
float3 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow [[texture(0)]], depth2d<float> uTexture [[texture(1)]], sampler uShadowSmplr [[sampler(0)]], sampler uSampler [[sampler(2)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow [[texture(0)]], depth2d<float> uTexture [[texture(1)]], sampler uShadowSmplr [[sampler(0)]], sampler uSampler [[sampler(1)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uShadow.sample_compare(uShadowSmplr, in.vUV.xy, in.vUV.z) + uTexture.sample_compare(uSampler, in.vUV.xy, in.vUV.z);
|
||||
|
||||
@@ -95,7 +95,7 @@ struct main0_out
|
||||
float4 m_5 [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _18& _19 [[buffer(1)]], constant _10& _11 [[buffer(2)]], texture2d<float> _14 [[texture(4)]], texture2d<float> _12 [[texture(13)]], texture2d<float> _8 [[texture(14)]], sampler _15 [[sampler(3)]], sampler _13 [[sampler(5)]], sampler _9 [[sampler(6)]], float4 gl_FragCoord [[position]])
|
||||
fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buffer(1)]], constant _18& _19 [[buffer(2)]], texture2d<float> _8 [[texture(0)]], texture2d<float> _12 [[texture(1)]], texture2d<float> _14 [[texture(2)]], sampler _9 [[sampler(0)]], sampler _13 [[sampler(1)]], sampler _15 [[sampler(2)]], float4 gl_FragCoord [[position]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float2 _82 = gl_FragCoord.xy * _19._m23.xy;
|
||||
|
||||
@@ -33,7 +33,7 @@ struct spvDescriptorSetBuffer1
|
||||
const device SSBO1* ssbo1 [[id(0)]];
|
||||
};
|
||||
|
||||
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], const device SSBO2& ssbo2 [[buffer(5)]], device SSBO3& ssbo3 [[buffer(6)]])
|
||||
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], device SSBO3& ssbo3 [[buffer(2)]], const device SSBO2& ssbo2 [[buffer(3)]])
|
||||
{
|
||||
ssbo3.v = ((*spvDescriptorSet0.ssbo0).v + (*spvDescriptorSet1.ssbo1).v) + ssbo2.v;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ using namespace metal;
|
||||
|
||||
struct spvDescriptorSetBuffer0
|
||||
{
|
||||
texture2d<float, access::write> uImage [[id(1)]];
|
||||
texture2d<float> uImageRead [[id(2)]];
|
||||
texture2d<float, access::write> uImage [[id(0)]];
|
||||
texture2d<float> uImageRead [[id(1)]];
|
||||
};
|
||||
|
||||
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
|
||||
@@ -14,7 +14,7 @@ struct SSBO1
|
||||
float bz[1];
|
||||
};
|
||||
|
||||
kernel void main0(constant uint* spvBufferSizeConstants [[buffer(25)]], device SSBO& _14 [[buffer(1)]], device SSBO1* ssbos_0 [[buffer(2)]], device SSBO1* ssbos_1 [[buffer(3)]])
|
||||
kernel void main0(constant uint* spvBufferSizeConstants [[buffer(25)]], device SSBO& _14 [[buffer(0)]], device SSBO1* ssbos_0 [[buffer(1)]], device SSBO1* ssbos_1 [[buffer(2)]])
|
||||
{
|
||||
device SSBO1* ssbos[] =
|
||||
{
|
||||
@@ -22,8 +22,8 @@ kernel void main0(constant uint* spvBufferSizeConstants [[buffer(25)]], device S
|
||||
ssbos_1,
|
||||
};
|
||||
|
||||
constant uint& _14BufferSize = spvBufferSizeConstants[1];
|
||||
constant uint* ssbosBufferSize = &spvBufferSizeConstants[2];
|
||||
constant uint& _14BufferSize = spvBufferSizeConstants[0];
|
||||
constant uint* ssbosBufferSize = &spvBufferSizeConstants[1];
|
||||
_14.size = uint(int((_14BufferSize - 16) / 16) + int((ssbosBufferSize[1] - 0) / 4));
|
||||
}
|
||||
|
||||
|
||||
@@ -27,17 +27,17 @@ struct SSBO3
|
||||
|
||||
struct spvDescriptorSetBuffer0
|
||||
{
|
||||
constant uint* spvBufferSizeConstants [[id(0)]];
|
||||
device SSBO* m_16 [[id(1)]];
|
||||
device SSBO* m_16 [[id(0)]];
|
||||
constant uint* spvBufferSizeConstants [[id(1)]];
|
||||
};
|
||||
|
||||
struct spvDescriptorSetBuffer1
|
||||
{
|
||||
constant uint* spvBufferSizeConstants [[id(1)]];
|
||||
device SSBO1* ssbos [[id(2)]][2];
|
||||
device SSBO1* ssbos [[id(0)]][2];
|
||||
constant uint* spvBufferSizeConstants [[id(2)]];
|
||||
};
|
||||
|
||||
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], constant uint* spvBufferSizeConstants [[buffer(25)]], device SSBO3* ssbos2_0 [[buffer(2)]], device SSBO3* ssbos2_1 [[buffer(3)]], device SSBO2& _38 [[buffer(5)]])
|
||||
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], constant uint* spvBufferSizeConstants [[buffer(25)]], device SSBO2& _38 [[buffer(2)]], device SSBO3* ssbos2_0 [[buffer(3)]], device SSBO3* ssbos2_1 [[buffer(4)]])
|
||||
{
|
||||
device SSBO3* ssbos2[] =
|
||||
{
|
||||
@@ -45,10 +45,10 @@ kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0
|
||||
ssbos2_1,
|
||||
};
|
||||
|
||||
constant uint& spvDescriptorSet0_m_16BufferSize = spvDescriptorSet0.spvBufferSizeConstants[1];
|
||||
constant uint* spvDescriptorSet1_ssbosBufferSize = &spvDescriptorSet1.spvBufferSizeConstants[2];
|
||||
constant uint& _38BufferSize = spvBufferSizeConstants[5];
|
||||
constant uint* ssbos2BufferSize = &spvBufferSizeConstants[2];
|
||||
constant uint& spvDescriptorSet0_m_16BufferSize = spvDescriptorSet0.spvBufferSizeConstants[0];
|
||||
constant uint* spvDescriptorSet1_ssbosBufferSize = &spvDescriptorSet1.spvBufferSizeConstants[0];
|
||||
constant uint& _38BufferSize = spvBufferSizeConstants[2];
|
||||
constant uint* ssbos2BufferSize = &spvBufferSizeConstants[3];
|
||||
(*spvDescriptorSet0.m_16).size = ((uint(int((spvDescriptorSet0_m_16BufferSize - 16) / 16)) + uint(int((spvDescriptorSet1_ssbosBufferSize[1] - 0) / 4))) + uint(int((_38BufferSize - 16) / 16))) + uint(int((ssbos2BufferSize[0] - 0) / 4));
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ struct SSBO
|
||||
int i32;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& ssbo [[buffer(2)]])
|
||||
kernel void main0(device SSBO& ssbo [[buffer(0)]])
|
||||
{
|
||||
threadgroup uint shared_u32;
|
||||
threadgroup int shared_i32;
|
||||
|
||||
@@ -18,7 +18,7 @@ struct UBO
|
||||
half4 const0;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO0& _29 [[buffer(0)]], device SSBO1& _21 [[buffer(1)]], constant UBO& _40 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO1& _21 [[buffer(0)]], device SSBO0& _29 [[buffer(1)]], constant UBO& _40 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
short2 _47 = as_type<short2>(_29.inputs[gl_GlobalInvocationID.x].x) + as_type<short2>(_40.const0.xy);
|
||||
_21.outputs[gl_GlobalInvocationID.x] = short4(_47.x, _47.y, _21.outputs[gl_GlobalInvocationID.x].z, _21.outputs[gl_GlobalInvocationID.x].w);
|
||||
|
||||
@@ -8,7 +8,7 @@ struct SSBO
|
||||
float4 value;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _10 [[buffer(1)]])
|
||||
kernel void main0(device SSBO& _10 [[buffer(0)]])
|
||||
{
|
||||
_10.value = float4(20.0);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ struct SSBO
|
||||
int4 value;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _10 [[buffer(1)]], texture2d<int> uImage [[texture(3)]])
|
||||
kernel void main0(device SSBO& _10 [[buffer(0)]], texture2d<int> uImage [[texture(0)]])
|
||||
{
|
||||
_10.value = uImage.read(uint2(int2(10)));
|
||||
}
|
||||
|
||||
24
3rdparty/spirv-cross/reference/opt/shaders-msl/comp/int64.invalid.msl22.comp
vendored
Normal file
24
3rdparty/spirv-cross/reference/opt/shaders-msl/comp/int64.invalid.msl22.comp
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct SSBO
|
||||
{
|
||||
int s32;
|
||||
uint u32;
|
||||
};
|
||||
|
||||
constant long _162 = {};
|
||||
|
||||
kernel void main0(device SSBO& _96 [[buffer(0)]])
|
||||
{
|
||||
long4 _137;
|
||||
ulong4 _141;
|
||||
_137 = abs((_137 + long4(30l, 40l, 50l, 60l)) + long4(_141 + ulong4(999999999999999999ul, 8888888888888888ul, 77777777777777777ul, 6666666666666666ul)));
|
||||
_141 += ulong4(long4(999999999999999999l, 8888888888888888l, 77777777777777777l, 6666666666666666l));
|
||||
ulong _109 = ulong(_162);
|
||||
_96.s32 = int(uint(((ulong(_137.x) + _141.y) + _109) + _109));
|
||||
_96.u32 = uint(((ulong(_137.y) + _141.z) + ulong(_162 + 1l)) + _109);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ struct SSBO2
|
||||
float3x3 out_data[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO2& _22 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO2& _22 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_22.out_data[gl_GlobalInvocationID.x] = float3x3(float3(10.0), float3(20.0), float3(40.0));
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ struct Buffer1
|
||||
|
||||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(32u, 1u, 1u);
|
||||
|
||||
kernel void main0(device Buffer0& _15 [[buffer(1)]], device Buffer1& _34 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device Buffer0& _15 [[buffer(0)]], device Buffer1& _34 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_34.buf1[gl_GlobalInvocationID.x] = _15.buf0[0].b;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ struct Buffer1
|
||||
|
||||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(32u, 1u, 1u);
|
||||
|
||||
kernel void main0(device Buffer0& _14 [[buffer(1)]], device Buffer1& _24 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device Buffer0& _14 [[buffer(0)]], device Buffer1& _24 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_24.buf1[gl_GlobalInvocationID.x] = _14.buf0[0].b;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ struct SSBO1
|
||||
float4 data3;
|
||||
};
|
||||
|
||||
kernel void main0(const device SSBO0& _15 [[buffer(0)]], device SSBO1& _21 [[buffer(1)]], device SSBO2& _10 [[buffer(2)]])
|
||||
kernel void main0(device SSBO2& _10 [[buffer(0)]], const device SSBO0& _15 [[buffer(1)]], device SSBO1& _21 [[buffer(2)]])
|
||||
{
|
||||
_10.data4 = _15.data0 + _21.data2;
|
||||
_10.data5 = _15.data1 + _21.data3;
|
||||
|
||||
@@ -18,7 +18,7 @@ struct SSBO
|
||||
Foo in_data[1];
|
||||
};
|
||||
|
||||
kernel void main0(const device SSBO& _30 [[buffer(0)]], device SSBO2& _23 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO2& _23 [[buffer(0)]], const device SSBO& _30 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_23.out_data[gl_GlobalInvocationID.x].m = _30.in_data[gl_GlobalInvocationID.x].m * _30.in_data[gl_GlobalInvocationID.x].m;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ struct dstbuffer
|
||||
s2 test[1];
|
||||
};
|
||||
|
||||
kernel void main0(device dstbuffer& _19 [[buffer(1)]])
|
||||
kernel void main0(device dstbuffer& _19 [[buffer(0)]])
|
||||
{
|
||||
_19.test[0].b.a = 0;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ struct SSBO0
|
||||
float4 array[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO0& ssbo_140 [[buffer(0)]], device SSBO1& ssbo_430 [[buffer(1)]])
|
||||
kernel void main0(device SSBO1& ssbo_430 [[buffer(0)]], device SSBO0& ssbo_140 [[buffer(1)]])
|
||||
{
|
||||
Content_1 _60 = ssbo_140.content;
|
||||
ssbo_430.content.m0s[0].a[0] = _60.m0s[0].a[0].xy;
|
||||
|
||||
@@ -13,7 +13,7 @@ struct SSBO
|
||||
uint inputs[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _10 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO2& _10 [[buffer(0)]], device SSBO& _23 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_10.outputs[gl_GlobalInvocationID.x] = _23.inputs[gl_GlobalInvocationID.x] / 29u;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
fragment void main0(texture2d<float, access::write> uImage [[texture(0)]], texture2d_array<float, access::read_write> uImageArray [[texture(1)]], texture2d_ms<float> uImageMS [[texture(2)]])
|
||||
fragment void main0(texture2d_ms<float> uImageMS [[texture(0)]], texture2d_array<float, access::read_write> uImageArray [[texture(1)]], texture2d<float, access::write> uImage [[texture(2)]])
|
||||
{
|
||||
uImage.write(uImageMS.read(uint2(int2(1, 2)), 2), uint2(int2(2, 3)));
|
||||
uImageArray.write(uImageArray.read(uint2(int3(1, 2, 4).xy), uint(int3(1, 2, 4).z)), uint2(int3(2, 3, 7).xy), uint(int3(2, 3, 7).z));
|
||||
|
||||
@@ -8,7 +8,7 @@ struct main0_out
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(texture2d_ms<float> uSampler [[texture(0)]], texture2d_ms<float> uImage [[texture(2)]], sampler uSamplerSmplr [[sampler(0)]])
|
||||
fragment main0_out main0(texture2d_ms<float> uSampler [[texture(0)]], texture2d_ms<float> uImage [[texture(1)]], sampler uSamplerSmplr [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = float4(float(int(uSampler.get_num_samples()) + int(uImage.get_num_samples())));
|
||||
|
||||
@@ -7,7 +7,6 @@ struct main0_out
|
||||
{
|
||||
float4 gl_Position [[position]];
|
||||
float gl_ClipDistance [[clip_distance]] [2];
|
||||
float gl_CullDistance[2];
|
||||
};
|
||||
|
||||
vertex main0_out main0()
|
||||
@@ -16,8 +15,6 @@ vertex main0_out main0()
|
||||
out.gl_Position = float4(10.0);
|
||||
out.gl_ClipDistance[0] = 1.0;
|
||||
out.gl_ClipDistance[1] = 4.0;
|
||||
out.gl_CullDistance[0] = 4.0;
|
||||
out.gl_CullDistance[1] = 9.0;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ struct main0_out
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(constant UBO0& _41 [[buffer(0)]], constant UBO1& _14 [[buffer(1)]], constant UBO2& _29 [[buffer(2)]])
|
||||
fragment main0_out main0(constant UBO1& _14 [[buffer(0)]], constant UBO2& _29 [[buffer(1)]], constant UBO0& _41 [[buffer(2)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = ((((float4(_14.c) + float4(_14.d)) + float4(_29.e)) + float4(_29.f)) + _41.a) + _41.b;
|
||||
|
||||
@@ -30,24 +30,24 @@ struct UBOs
|
||||
|
||||
struct spvDescriptorSetBuffer0
|
||||
{
|
||||
texture2d<float> uTexture [[id(2)]];
|
||||
sampler uTextureSmplr [[id(3)]];
|
||||
constant UBO* m_90 [[id(5)]];
|
||||
array<texture2d<float>, 2> uTextures [[id(6)]];
|
||||
array<sampler, 2> uTexturesSmplr [[id(8)]];
|
||||
texture2d<float> uTexture [[id(0)]];
|
||||
sampler uTextureSmplr [[id(1)]];
|
||||
array<texture2d<float>, 2> uTextures [[id(2)]];
|
||||
array<sampler, 2> uTexturesSmplr [[id(4)]];
|
||||
constant UBO* m_90 [[id(6)]];
|
||||
};
|
||||
|
||||
struct spvDescriptorSetBuffer1
|
||||
{
|
||||
array<texture2d<float>, 4> uTexture2 [[id(3)]];
|
||||
device SSBO* m_60 [[id(7)]];
|
||||
const device SSBOs* ssbos [[id(8)]][2];
|
||||
array<sampler, 2> uSampler [[id(10)]];
|
||||
array<texture2d<float>, 4> uTexture2 [[id(0)]];
|
||||
array<sampler, 2> uSampler [[id(4)]];
|
||||
device SSBO* m_60 [[id(6)]];
|
||||
const device SSBOs* ssbos [[id(7)]][2];
|
||||
};
|
||||
|
||||
struct spvDescriptorSetBuffer2
|
||||
{
|
||||
constant UBOs* ubos [[id(4)]][4];
|
||||
constant UBOs* ubos [[id(0)]][4];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
|
||||
@@ -7,9 +7,9 @@ using namespace metal;
|
||||
|
||||
struct spvDescriptorSetBuffer0
|
||||
{
|
||||
constant uint* spvSwizzleConstants [[id(0)]];
|
||||
array<texture2d<float>, 4> uSampler0 [[id(1)]];
|
||||
array<sampler, 4> uSampler0Smplr [[id(5)]];
|
||||
array<texture2d<float>, 4> uSampler0 [[id(0)]];
|
||||
array<sampler, 4> uSampler0Smplr [[id(4)]];
|
||||
constant uint* spvSwizzleConstants [[id(8)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
@@ -145,7 +145,7 @@ inline vec<T, 4> spvGatherCompareSwizzle(sampler s, const thread Tex& t, Ts... p
|
||||
fragment main0_out main0(main0_in in [[stage_in]], constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant uint* spvSwizzleConstants [[buffer(30)]], texture2d<float> uSampler1 [[texture(0)]], sampler uSampler1Smplr [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
constant uint* spvDescriptorSet0_uSampler0Swzl = &spvDescriptorSet0.spvSwizzleConstants[1];
|
||||
constant uint* spvDescriptorSet0_uSampler0Swzl = &spvDescriptorSet0.spvSwizzleConstants[0];
|
||||
constant uint& uSampler1Swzl = spvSwizzleConstants[0];
|
||||
out.FragColor = spvTextureSwizzle(spvDescriptorSet0.uSampler0[2].sample(spvDescriptorSet0.uSampler0Smplr[2], in.vUV), spvDescriptorSet0_uSampler0Swzl[2]);
|
||||
out.FragColor += spvTextureSwizzle(uSampler1.sample(uSampler1Smplr, in.vUV), uSampler1Swzl);
|
||||
|
||||
28
3rdparty/spirv-cross/reference/opt/shaders-msl/frag/barycentric-nv-nopersp.msl22.frag
vendored
Normal file
28
3rdparty/spirv-cross/reference/opt/shaders-msl/frag/barycentric-nv-nopersp.msl22.frag
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct Vertices
|
||||
{
|
||||
float2 uvs[1];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float2 value [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 gl_BaryCoordNoPerspNV [[barycentric_coord, center_no_perspective]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], const device Vertices& _19 [[buffer(0)]], uint gl_PrimitiveID [[primitive_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
int _23 = 3 * int(gl_PrimitiveID);
|
||||
out.value = ((_19.uvs[_23] * in.gl_BaryCoordNoPerspNV.x) + (_19.uvs[_23 + 1] * in.gl_BaryCoordNoPerspNV.y)) + (_19.uvs[_23 + 2] * in.gl_BaryCoordNoPerspNV.z);
|
||||
return out;
|
||||
}
|
||||
|
||||
28
3rdparty/spirv-cross/reference/opt/shaders-msl/frag/barycentric-nv.msl22.frag
vendored
Normal file
28
3rdparty/spirv-cross/reference/opt/shaders-msl/frag/barycentric-nv.msl22.frag
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct Vertices
|
||||
{
|
||||
float2 uvs[1];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float2 value [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 gl_BaryCoordNV [[barycentric_coord, center_perspective]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], const device Vertices& _19 [[buffer(0)]], uint gl_PrimitiveID [[primitive_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
int _23 = 3 * int(gl_PrimitiveID);
|
||||
out.value = ((_19.uvs[_23] * in.gl_BaryCoordNV.x) + (_19.uvs[_23 + 1] * in.gl_BaryCoordNV.y)) + (_19.uvs[_23 + 2] * in.gl_BaryCoordNV.z);
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ struct main0_in
|
||||
int vIn2 [[user(locn1)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], device UBO& _34 [[buffer(0)]], texture2d<int> Buf [[texture(1)]], sampler BufSmplr [[sampler(1)]], float4 gl_FragCoord [[position]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], device UBO& _34 [[buffer(0)]], texture2d<int> Buf [[texture(0)]], sampler BufSmplr [[sampler(0)]], float4 gl_FragCoord [[position]])
|
||||
{
|
||||
main0_out out = {};
|
||||
int _40 = Buf.read(uint2(int2(gl_FragCoord.xy)), 0).x % 16;
|
||||
|
||||
70
3rdparty/spirv-cross/reference/opt/shaders-msl/frag/image-query-lod.msl22.frag
vendored
Normal file
70
3rdparty/spirv-cross/reference/opt/shaders-msl/frag/image-query-lod.msl22.frag
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float2 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float3 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uSampler2D [[texture(0)]], texture3d<float> uSampler3D [[texture(1)]], texturecube<float> uSamplerCube [[texture(2)]], texture2d<float> uTexture2D [[texture(3)]], texture3d<float> uTexture3D [[texture(4)]], texturecube<float> uTextureCube [[texture(5)]], sampler uSampler2DSmplr [[sampler(0)]], sampler uSampler3DSmplr [[sampler(1)]], sampler uSamplerCubeSmplr [[sampler(2)]], sampler uSampler [[sampler(3)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = float2(0.0);
|
||||
float2 _79;
|
||||
_79.x = uSampler2D.calculate_clamped_lod(uSampler2DSmplr, in.vUV.xy);
|
||||
_79.y = uSampler2D.calculate_unclamped_lod(uSampler2DSmplr, in.vUV.xy);
|
||||
out.FragColor += _79;
|
||||
float2 _84;
|
||||
_84.x = uSampler3D.calculate_clamped_lod(uSampler3DSmplr, in.vUV);
|
||||
_84.y = uSampler3D.calculate_unclamped_lod(uSampler3DSmplr, in.vUV);
|
||||
out.FragColor += _84;
|
||||
float2 _89;
|
||||
_89.x = uSamplerCube.calculate_clamped_lod(uSamplerCubeSmplr, in.vUV);
|
||||
_89.y = uSamplerCube.calculate_unclamped_lod(uSamplerCubeSmplr, in.vUV);
|
||||
out.FragColor += _89;
|
||||
float2 _97;
|
||||
_97.x = uTexture2D.calculate_clamped_lod(uSampler, in.vUV.xy);
|
||||
_97.y = uTexture2D.calculate_unclamped_lod(uSampler, in.vUV.xy);
|
||||
out.FragColor += _97;
|
||||
float2 _104;
|
||||
_104.x = uTexture3D.calculate_clamped_lod(uSampler, in.vUV);
|
||||
_104.y = uTexture3D.calculate_unclamped_lod(uSampler, in.vUV);
|
||||
out.FragColor += _104;
|
||||
float2 _111;
|
||||
_111.x = uTextureCube.calculate_clamped_lod(uSampler, in.vUV);
|
||||
_111.y = uTextureCube.calculate_unclamped_lod(uSampler, in.vUV);
|
||||
out.FragColor += _111;
|
||||
float2 _118;
|
||||
_118.x = uSampler2D.calculate_clamped_lod(uSampler2DSmplr, in.vUV.xy);
|
||||
_118.y = uSampler2D.calculate_unclamped_lod(uSampler2DSmplr, in.vUV.xy);
|
||||
out.FragColor += _118;
|
||||
float2 _123;
|
||||
_123.x = uSampler3D.calculate_clamped_lod(uSampler3DSmplr, in.vUV);
|
||||
_123.y = uSampler3D.calculate_unclamped_lod(uSampler3DSmplr, in.vUV);
|
||||
out.FragColor += _123;
|
||||
float2 _128;
|
||||
_128.x = uSamplerCube.calculate_clamped_lod(uSamplerCubeSmplr, in.vUV);
|
||||
_128.y = uSamplerCube.calculate_unclamped_lod(uSamplerCubeSmplr, in.vUV);
|
||||
out.FragColor += _128;
|
||||
float2 _136;
|
||||
_136.x = uTexture2D.calculate_clamped_lod(uSampler, in.vUV.xy);
|
||||
_136.y = uTexture2D.calculate_unclamped_lod(uSampler, in.vUV.xy);
|
||||
out.FragColor += _136;
|
||||
float2 _143;
|
||||
_143.x = uTexture3D.calculate_clamped_lod(uSampler, in.vUV);
|
||||
_143.y = uTexture3D.calculate_unclamped_lod(uSampler, in.vUV);
|
||||
out.FragColor += _143;
|
||||
float2 _150;
|
||||
_150.x = uTextureCube.calculate_clamped_lod(uSampler, in.vUV);
|
||||
_150.y = uTextureCube.calculate_unclamped_lod(uSampler, in.vUV);
|
||||
out.FragColor += _150;
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ struct main0_in
|
||||
float inLodBias [[user(locn6)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texturecube<float> samplerColor [[texture(1)]], sampler samplerColorSmplr [[sampler(1)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texturecube<float> samplerColor [[texture(0)]], sampler samplerColorSmplr [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4x4 inInvModelView = {};
|
||||
|
||||
@@ -24,7 +24,7 @@ struct main0_in
|
||||
float2 vUV [[user(locn1)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], constant UBO* ubos_0 [[buffer(0)]], constant UBO* ubos_1 [[buffer(1)]], const device SSBO* ssbos_0 [[buffer(2)]], const device SSBO* ssbos_1 [[buffer(3)]], array<texture2d<float>, 8> uSamplers [[texture(0)]], array<texture2d<float>, 8> uCombinedSamplers [[texture(8)]], array<sampler, 7> uSamps [[sampler(1)]], array<sampler, 8> uCombinedSamplersSmplr [[sampler(8)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], constant UBO* ubos_0 [[buffer(0)]], constant UBO* ubos_1 [[buffer(1)]], const device SSBO* ssbos_0 [[buffer(2)]], const device SSBO* ssbos_1 [[buffer(3)]], array<texture2d<float>, 8> uSamplers [[texture(0)]], array<texture2d<float>, 8> uCombinedSamplers [[texture(8)]], array<sampler, 7> uSamps [[sampler(0)]], array<sampler, 8> uCombinedSamplersSmplr [[sampler(7)]])
|
||||
{
|
||||
constant UBO* ubos[] =
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ struct main0_out
|
||||
float FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(depth2d<float> uDepth [[texture(0)]], texture2d<float> uColor [[texture(1)]], sampler uSampler [[sampler(2)]], sampler uSamplerShadow [[sampler(3)]])
|
||||
fragment main0_out main0(depth2d<float> uDepth [[texture(0)]], texture2d<float> uColor [[texture(1)]], sampler uSamplerShadow [[sampler(0)]], sampler uSampler [[sampler(1)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uDepth.sample_compare(uSamplerShadow, float3(0.5).xy, 0.5) + uColor.sample(uSampler, float2(0.5)).x;
|
||||
|
||||
@@ -13,7 +13,7 @@ struct main0_in
|
||||
float4 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d_array<float> uTex [[texture(0)]], sampler uShadow [[sampler(1)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d_array<float> uTex [[texture(0)]], sampler uShadow [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uTex.sample_compare(uShadow, in.vUV.xy, uint(round(in.vUV.z)), in.vUV.w, level(0));
|
||||
|
||||
@@ -13,7 +13,7 @@ struct main0_in
|
||||
float4 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d_array<float> uTex [[texture(0)]], sampler uShadow [[sampler(1)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d_array<float> uTex [[texture(0)]], sampler uShadow [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uTex.sample_compare(uShadow, in.vUV.xy, uint(round(in.vUV.z)), in.vUV.w, gradient2d(float2(0.0), float2(0.0)));
|
||||
|
||||
@@ -14,7 +14,7 @@ struct main0_in
|
||||
int vIndex [[user(locn1)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], array<texture2d<float>, 4> uSampler [[texture(0)]], array<texture2d<float>, 4> uTextures [[texture(8)]], array<sampler, 4> uSamplerSmplr [[sampler(0)]], array<sampler, 4> uSamplers [[sampler(4)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], array<texture2d<float>, 4> uSampler [[texture(0)]], array<texture2d<float>, 4> uTextures [[texture(4)]], array<sampler, 4> uSamplerSmplr [[sampler(0)]], array<sampler, 4> uSamplers [[sampler(4)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = float4(0.0);
|
||||
|
||||
@@ -8,7 +8,7 @@ struct main0_out
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(texture2d<float> uDepth [[texture(1)]], sampler uSampler [[sampler(0)]])
|
||||
fragment main0_out main0(texture2d<float> uDepth [[texture(0)]], sampler uSampler [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uDepth.sample(uSampler, float2(0.5));
|
||||
|
||||
@@ -32,7 +32,7 @@ struct main0_in
|
||||
int4 vColor [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], constant Push& registers [[buffer(0)]], constant UBO& ubo [[buffer(1)]], device SSBO& ssbo [[buffer(2)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], device SSBO& ssbo [[buffer(0)]], constant Push& registers [[buffer(1)]], constant UBO& ubo [[buffer(2)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
short _196 = 10;
|
||||
|
||||
@@ -13,7 +13,7 @@ struct main0_in
|
||||
float3 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uSampler [[texture(0)]], depth2d<float> uTex [[texture(1)]], sampler uSamplerSmplr [[sampler(0)]], sampler uSamp [[sampler(2)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uTex [[texture(0)]], depth2d<float> uSampler [[texture(1)]], sampler uSamp [[sampler(0)]], sampler uSamplerSmplr [[sampler(1)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uSampler.sample_compare(uSamplerSmplr, in.vUV.xy, in.vUV.z);
|
||||
|
||||
@@ -15,7 +15,7 @@ struct main0_in
|
||||
float2 vClip2 [[user(locn2)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow2D [[texture(1)]], texture1d<float> uSampler1D [[texture(2)]], texture2d<float> uSampler2D [[texture(3)]], texture3d<float> uSampler3D [[texture(4)]], sampler uShadow2DSmplr [[sampler(1)]], sampler uSampler1DSmplr [[sampler(2)]], sampler uSampler2DSmplr [[sampler(3)]], sampler uSampler3DSmplr [[sampler(4)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow2D [[texture(0)]], texture1d<float> uSampler1D [[texture(1)]], texture2d<float> uSampler2D [[texture(2)]], texture3d<float> uSampler3D [[texture(3)]], sampler uShadow2DSmplr [[sampler(0)]], sampler uSampler1DSmplr [[sampler(1)]], sampler uSampler2DSmplr [[sampler(2)]], sampler uSampler3DSmplr [[sampler(3)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _20 = in.vClip4;
|
||||
|
||||
@@ -26,7 +26,7 @@ struct main0_patchIn
|
||||
float4 vPatchLods [[attribute(1)]];
|
||||
};
|
||||
|
||||
[[ patch(quad, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant UBO& _31 [[buffer(1)]], texture2d<float> uHeightmapDisplacement [[texture(0)]], sampler uHeightmapDisplacementSmplr [[sampler(0)]], float2 gl_TessCoord [[position_in_patch]])
|
||||
[[ patch(quad, 0) ]] vertex main0_out main0(main0_patchIn patchIn [[stage_in]], constant UBO& _31 [[buffer(0)]], texture2d<float> uHeightmapDisplacement [[texture(0)]], sampler uHeightmapDisplacementSmplr [[sampler(0)]], float2 gl_TessCoord [[position_in_patch]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float2 _201 = patchIn.vOutPatchPosBase + (float3(gl_TessCoord, 0).xy * _31.uPatchSize);
|
||||
|
||||
@@ -23,7 +23,7 @@ struct main0_in
|
||||
float4 m_17 [[attribute(0)]];
|
||||
};
|
||||
|
||||
vertex void main0(main0_in in [[stage_in]], constant _40& _42 [[buffer(0)]], device _35& _37 [[buffer(1)]])
|
||||
vertex void main0(main0_in in [[stage_in]], device _35& _37 [[buffer(0)]], constant _40& _42 [[buffer(1)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.gl_Position = in.m_17;
|
||||
|
||||
@@ -13,7 +13,7 @@ struct main0_in
|
||||
float4 m_17 [[attribute(0)]];
|
||||
};
|
||||
|
||||
vertex void main0(main0_in in [[stage_in]], texture1d<uint> _37 [[texture(0)]], texture1d<uint, access::write> _34 [[texture(1)]])
|
||||
vertex void main0(main0_in in [[stage_in]], texture1d<uint, access::write> _34 [[texture(0)]], texture1d<uint> _37 [[texture(1)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.gl_Position = in.m_17;
|
||||
|
||||
@@ -37,7 +37,7 @@ struct main0_in
|
||||
float4 m_25 [[attribute(0)]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant _42& _44 [[buffer(12)]], constant _15& _17 [[buffer(13)]])
|
||||
vertex main0_out main0(main0_in in [[stage_in]], constant _15& _17 [[buffer(0)]], constant _42& _44 [[buffer(1)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 _70 = _44._m0 * float4(float3(_44._m3) + (in.m_25.xyz * (_44._m6 + _44._m7)), 1.0);
|
||||
|
||||
@@ -20,8 +20,14 @@ struct constant_block
|
||||
#endif
|
||||
constant int arraySize = SPIRV_CROSS_CONSTANT_ID_0;
|
||||
|
||||
vertex void main0(constant constant_block* constants_0 [[buffer(4)]], constant constant_block* constants_1 [[buffer(5)]], constant constant_block* constants_2 [[buffer(6)]], constant constant_block* constants_3 [[buffer(7)]], device storage_block* storage_0 [[buffer(8)]], device storage_block* storage_1 [[buffer(9)]], array<texture2d<int>, 3> images [[texture(0)]])
|
||||
vertex void main0(device storage_block* storage_0 [[buffer(0)]], device storage_block* storage_1 [[buffer(1)]], constant constant_block* constants_0 [[buffer(2)]], constant constant_block* constants_1 [[buffer(3)]], constant constant_block* constants_2 [[buffer(4)]], constant constant_block* constants_3 [[buffer(5)]], array<texture2d<int>, 3> images [[texture(0)]])
|
||||
{
|
||||
device storage_block* storage[] =
|
||||
{
|
||||
storage_0,
|
||||
storage_1,
|
||||
};
|
||||
|
||||
constant constant_block* constants[] =
|
||||
{
|
||||
constants_0,
|
||||
@@ -30,12 +36,6 @@ vertex void main0(constant constant_block* constants_0 [[buffer(4)]], constant c
|
||||
constants_3,
|
||||
};
|
||||
|
||||
device storage_block* storage[] =
|
||||
{
|
||||
storage_0,
|
||||
storage_1,
|
||||
};
|
||||
|
||||
storage[0]->baz = uint4(constants[3]->foo);
|
||||
storage[1]->quux = images[2].read(uint2(int2(constants[1]->bar))).xy;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,14 @@ struct constant_block
|
||||
#endif
|
||||
constant int arraySize = SPIRV_CROSS_CONSTANT_ID_0;
|
||||
|
||||
vertex void main0(constant constant_block* constants_0 [[buffer(4)]], constant constant_block* constants_1 [[buffer(5)]], constant constant_block* constants_2 [[buffer(6)]], constant constant_block* constants_3 [[buffer(7)]], device storage_block* storage_0 [[buffer(8)]], device storage_block* storage_1 [[buffer(9)]], array<texture2d<int>, 3> images [[texture(0)]])
|
||||
vertex void main0(device storage_block* storage_0 [[buffer(0)]], device storage_block* storage_1 [[buffer(1)]], constant constant_block* constants_0 [[buffer(2)]], constant constant_block* constants_1 [[buffer(3)]], constant constant_block* constants_2 [[buffer(4)]], constant constant_block* constants_3 [[buffer(5)]], array<texture2d<int>, 3> images [[texture(0)]])
|
||||
{
|
||||
device storage_block* storage[] =
|
||||
{
|
||||
storage_0,
|
||||
storage_1,
|
||||
};
|
||||
|
||||
constant constant_block* constants[] =
|
||||
{
|
||||
constants_0,
|
||||
@@ -30,12 +36,6 @@ vertex void main0(constant constant_block* constants_0 [[buffer(4)]], constant c
|
||||
constants_3,
|
||||
};
|
||||
|
||||
device storage_block* storage[] =
|
||||
{
|
||||
storage_0,
|
||||
storage_1,
|
||||
};
|
||||
|
||||
storage[0]->baz = uint4(constants[3]->foo);
|
||||
storage[1]->quux = images[2].read(uint2(int2(constants[1]->bar))).xy;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ struct main0_out
|
||||
float4 gl_Position [[position]];
|
||||
};
|
||||
|
||||
vertex main0_out main0(texture_buffer<float> uSamp [[texture(4)]], texture_buffer<float> uSampo [[texture(5)]])
|
||||
vertex main0_out main0(texture_buffer<float> uSamp [[texture(0)]], texture_buffer<float> uSampo [[texture(1)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.gl_Position = uSamp.read(uint(10)) + uSampo.read(uint(100));
|
||||
|
||||
@@ -16,7 +16,7 @@ uint2 spvTexelBufferCoord(uint tc)
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
vertex main0_out main0(texture2d<float> uSamp [[texture(4)]], texture2d<float> uSampo [[texture(5)]])
|
||||
vertex main0_out main0(texture2d<float> uSamp [[texture(0)]], texture2d<float> uSampo [[texture(1)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.gl_Position = uSamp.read(spvTexelBufferCoord(10)) + uSampo.read(spvTexelBufferCoord(100));
|
||||
|
||||
@@ -16,7 +16,6 @@ void main()
|
||||
_19 = 1.0;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
default:
|
||||
{
|
||||
_19 = 3.0;
|
||||
|
||||
19
3rdparty/spirv-cross/reference/opt/shaders/frag/barycentric-nv.frag
vendored
Normal file
19
3rdparty/spirv-cross/reference/opt/shaders/frag/barycentric-nv.frag
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
#version 450
|
||||
#extension GL_NV_fragment_shader_barycentric : require
|
||||
|
||||
layout(binding = 0, std430) readonly buffer Vertices
|
||||
{
|
||||
vec2 uvs[];
|
||||
} _19;
|
||||
|
||||
layout(location = 0) out vec2 value;
|
||||
|
||||
void main()
|
||||
{
|
||||
int _23 = 3 * gl_PrimitiveID;
|
||||
int _32 = _23 + 1;
|
||||
int _39 = _23 + 2;
|
||||
value = ((_19.uvs[_23] * gl_BaryCoordNV.x) + (_19.uvs[_32] * gl_BaryCoordNV.y)) + (_19.uvs[_39] * gl_BaryCoordNV.z);
|
||||
value += (((_19.uvs[_23] * gl_BaryCoordNoPerspNV.x) + (_19.uvs[_32] * gl_BaryCoordNoPerspNV.y)) + (_19.uvs[_39] * gl_BaryCoordNoPerspNV.z));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
static int vIndex;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int vIndex : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
int i = 0;
|
||||
int j;
|
||||
int _30;
|
||||
int _31;
|
||||
if (vIndex != 0 && vIndex != 1 && vIndex != 11 && vIndex != 2 && vIndex != 3 && vIndex != 4 && vIndex != 5)
|
||||
{
|
||||
_30 = 2;
|
||||
}
|
||||
if (vIndex == 1 || vIndex == 11)
|
||||
{
|
||||
_31 = 1;
|
||||
}
|
||||
switch (vIndex)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
_30 = 3;
|
||||
}
|
||||
default:
|
||||
{
|
||||
j = _30;
|
||||
_31 = 0;
|
||||
}
|
||||
case 1:
|
||||
case 11:
|
||||
{
|
||||
j = _31;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
if (vIndex > 3)
|
||||
{
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
FragColor = float(i).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vIndex = stage_input.vIndex;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ threadgroup int* select_tgsm(constant bar& cb, threadgroup int (&tgsm)[128])
|
||||
return (cb.d != 0) ? &tgsm[0u] : nullptr;
|
||||
}
|
||||
|
||||
kernel void main0(device foo& buf [[buffer(0)]], constant bar& cb [[buffer(3)]], device baz& buf2 [[buffer(4)]])
|
||||
kernel void main0(device foo& buf [[buffer(0)]], constant bar& cb [[buffer(1)]], device baz& buf2 [[buffer(2)]])
|
||||
{
|
||||
threadgroup int tgsm[128];
|
||||
device int* sbuf = select_buffer(buf, buf2, cb);
|
||||
|
||||
@@ -101,7 +101,7 @@ struct main0_in
|
||||
float IN_studIndex [[user(locn8)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], constant CB0& _19 [[buffer(0)]], texture2d<float> StudsMapTexture [[texture(0)]], texture2d<float> ShadowMapTexture [[texture(1)]], texturecube<float> EnvironmentMapTexture [[texture(2)]], texture2d<float> DiffuseMapTexture [[texture(3)]], texture2d<float> NormalMapTexture [[texture(4)]], texture2d<float> SpecularMapTexture [[texture(5)]], texture3d<float> LightMapTexture [[texture(6)]], texture2d<float> NormalDetailMapTexture [[texture(8)]], sampler StudsMapSampler [[sampler(0)]], sampler ShadowMapSampler [[sampler(1)]], sampler EnvironmentMapSampler [[sampler(2)]], sampler DiffuseMapSampler [[sampler(3)]], sampler NormalMapSampler [[sampler(4)]], sampler SpecularMapSampler [[sampler(5)]], sampler LightMapSampler [[sampler(6)]], sampler NormalDetailMapSampler [[sampler(8)]], float4 gl_FragCoord [[position]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], constant CB0& _19 [[buffer(0)]], texture3d<float> LightMapTexture [[texture(0)]], texture2d<float> ShadowMapTexture [[texture(1)]], texturecube<float> EnvironmentMapTexture [[texture(2)]], texture2d<float> DiffuseMapTexture [[texture(3)]], texture2d<float> NormalMapTexture [[texture(4)]], texture2d<float> NormalDetailMapTexture [[texture(5)]], texture2d<float> StudsMapTexture [[texture(6)]], texture2d<float> SpecularMapTexture [[texture(7)]], sampler LightMapSampler [[sampler(0)]], sampler ShadowMapSampler [[sampler(1)]], sampler EnvironmentMapSampler [[sampler(2)]], sampler DiffuseMapSampler [[sampler(3)]], sampler NormalMapSampler [[sampler(4)]], sampler NormalDetailMapSampler [[sampler(5)]], sampler StudsMapSampler [[sampler(6)]], sampler SpecularMapSampler [[sampler(7)]], float4 gl_FragCoord [[position]])
|
||||
{
|
||||
main0_out out = {};
|
||||
VertexOutput _128 = _121;
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
int vIndex [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]])
|
||||
{
|
||||
int i = 0;
|
||||
main0_out out = {};
|
||||
int j;
|
||||
int _30;
|
||||
int _31;
|
||||
if (in.vIndex != 0 && in.vIndex != 1 && in.vIndex != 11 && in.vIndex != 2 && in.vIndex != 3 && in.vIndex != 4 && in.vIndex != 5)
|
||||
{
|
||||
_30 = 2;
|
||||
}
|
||||
if (in.vIndex == 1 || in.vIndex == 11)
|
||||
{
|
||||
_31 = 1;
|
||||
}
|
||||
switch (in.vIndex)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
_30 = 3;
|
||||
}
|
||||
default:
|
||||
{
|
||||
j = _30;
|
||||
_31 = 0;
|
||||
}
|
||||
case 1:
|
||||
case 11:
|
||||
{
|
||||
j = _31;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
if (in.vIndex > 3)
|
||||
{
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
case 4:
|
||||
{
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
i = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
out.FragColor = float4(float(i));
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ inline vec<T, 4> spvGatherCompareSwizzle(sampler s, const thread Tex& t, Ts... p
|
||||
return t.gather_compare(s, spvForward<Ts>(params)...);
|
||||
}
|
||||
|
||||
fragment void main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d<float> tex1d [[texture(0)]], texture2d<float> tex2d [[texture(1)]], texture3d<float> tex3d [[texture(2)]], texturecube<float> texCube [[texture(3)]], texture2d_array<float> tex2dArray [[texture(4)]], texturecube_array<float> texCubeArray [[texture(5)]], texture2d<float> texBuffer [[texture(6)]], depth2d<float> depth2d [[texture(7)]], depthcube<float> depthCube [[texture(8)]], depth2d_array<float> depth2dArray [[texture(9)]], depthcube_array<float> depthCubeArray [[texture(10)]], sampler tex1dSamp [[sampler(0)]], sampler tex2dSamp [[sampler(1)]], sampler tex3dSamp [[sampler(2)]], sampler texCubeSamp [[sampler(3)]], sampler tex2dArraySamp [[sampler(4)]], sampler texCubeArraySamp [[sampler(5)]], sampler depth2dSamp [[sampler(7)]], sampler depthCubeSamp [[sampler(8)]], sampler depth2dArraySamp [[sampler(9)]], sampler depthCubeArraySamp [[sampler(10)]])
|
||||
fragment void main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d<float> tex1d [[texture(0)]], texture2d<float> tex2d [[texture(1)]], texture3d<float> tex3d [[texture(2)]], texturecube<float> texCube [[texture(3)]], texture2d_array<float> tex2dArray [[texture(4)]], texturecube_array<float> texCubeArray [[texture(5)]], depth2d<float> depth2d [[texture(6)]], depthcube<float> depthCube [[texture(7)]], depth2d_array<float> depth2dArray [[texture(8)]], depthcube_array<float> depthCubeArray [[texture(9)]], texture2d<float> texBuffer [[texture(10)]], sampler tex1dSamp [[sampler(0)]], sampler tex2dSamp [[sampler(1)]], sampler tex3dSamp [[sampler(2)]], sampler texCubeSamp [[sampler(3)]], sampler tex2dArraySamp [[sampler(4)]], sampler texCubeArraySamp [[sampler(5)]], sampler depth2dSamp [[sampler(6)]], sampler depthCubeSamp [[sampler(7)]], sampler depth2dArraySamp [[sampler(8)]], sampler depthCubeArraySamp [[sampler(9)]])
|
||||
{
|
||||
constant uint& tex1dSwzl = spvSwizzleConstants[0];
|
||||
constant uint& tex2dSwzl = spvSwizzleConstants[1];
|
||||
@@ -139,10 +139,10 @@ fragment void main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d
|
||||
constant uint& texCubeSwzl = spvSwizzleConstants[3];
|
||||
constant uint& tex2dArraySwzl = spvSwizzleConstants[4];
|
||||
constant uint& texCubeArraySwzl = spvSwizzleConstants[5];
|
||||
constant uint& depth2dSwzl = spvSwizzleConstants[7];
|
||||
constant uint& depthCubeSwzl = spvSwizzleConstants[8];
|
||||
constant uint& depth2dArraySwzl = spvSwizzleConstants[9];
|
||||
constant uint& depthCubeArraySwzl = spvSwizzleConstants[10];
|
||||
constant uint& depth2dSwzl = spvSwizzleConstants[6];
|
||||
constant uint& depthCubeSwzl = spvSwizzleConstants[7];
|
||||
constant uint& depth2dArraySwzl = spvSwizzleConstants[8];
|
||||
constant uint& depthCubeArraySwzl = spvSwizzleConstants[9];
|
||||
float4 c = spvTextureSwizzle(tex1d.sample(tex1dSamp, 0.0), tex1dSwzl);
|
||||
c = spvTextureSwizzle(tex2d.sample(tex2dSamp, float2(0.0)), tex2dSwzl);
|
||||
c = spvTextureSwizzle(tex3d.sample(tex3dSamp, float3(0.0)), tex3dSwzl);
|
||||
|
||||
@@ -8,7 +8,7 @@ struct SSBO2
|
||||
float4 out_data[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO2& _27 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO2& _27 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
uint ident = gl_GlobalInvocationID.x;
|
||||
if (ident == 2u)
|
||||
|
||||
@@ -178,7 +178,7 @@ float4 doSwizzle(thread texture1d<float> tex1d, thread const sampler tex1dSmplr,
|
||||
return c;
|
||||
}
|
||||
|
||||
fragment void main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d<float> tex1d [[texture(0)]], texture2d<float> tex2d [[texture(1)]], texture3d<float> tex3d [[texture(2)]], texturecube<float> texCube [[texture(3)]], texture2d_array<float> tex2dArray [[texture(4)]], texturecube_array<float> texCubeArray [[texture(5)]], texture2d<float> texBuffer [[texture(6)]], depth2d<float> depth2d [[texture(7)]], depthcube<float> depthCube [[texture(8)]], depth2d_array<float> depth2dArray [[texture(9)]], depthcube_array<float> depthCubeArray [[texture(10)]], sampler tex1dSmplr [[sampler(0)]], sampler tex2dSmplr [[sampler(1)]], sampler tex3dSmplr [[sampler(2)]], sampler texCubeSmplr [[sampler(3)]], sampler tex2dArraySmplr [[sampler(4)]], sampler texCubeArraySmplr [[sampler(5)]], sampler depth2dSmplr [[sampler(7)]], sampler depthCubeSmplr [[sampler(8)]], sampler depth2dArraySmplr [[sampler(9)]], sampler depthCubeArraySmplr [[sampler(10)]])
|
||||
fragment void main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d<float> tex1d [[texture(0)]], texture2d<float> tex2d [[texture(1)]], texture3d<float> tex3d [[texture(2)]], texturecube<float> texCube [[texture(3)]], texture2d_array<float> tex2dArray [[texture(4)]], texturecube_array<float> texCubeArray [[texture(5)]], depth2d<float> depth2d [[texture(6)]], depthcube<float> depthCube [[texture(7)]], depth2d_array<float> depth2dArray [[texture(8)]], depthcube_array<float> depthCubeArray [[texture(9)]], texture2d<float> texBuffer [[texture(10)]], sampler tex1dSmplr [[sampler(0)]], sampler tex2dSmplr [[sampler(1)]], sampler tex3dSmplr [[sampler(2)]], sampler texCubeSmplr [[sampler(3)]], sampler tex2dArraySmplr [[sampler(4)]], sampler texCubeArraySmplr [[sampler(5)]], sampler depth2dSmplr [[sampler(6)]], sampler depthCubeSmplr [[sampler(7)]], sampler depth2dArraySmplr [[sampler(8)]], sampler depthCubeArraySmplr [[sampler(9)]])
|
||||
{
|
||||
constant uint& tex1dSwzl = spvSwizzleConstants[0];
|
||||
constant uint& tex2dSwzl = spvSwizzleConstants[1];
|
||||
@@ -186,10 +186,10 @@ fragment void main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d
|
||||
constant uint& texCubeSwzl = spvSwizzleConstants[3];
|
||||
constant uint& tex2dArraySwzl = spvSwizzleConstants[4];
|
||||
constant uint& texCubeArraySwzl = spvSwizzleConstants[5];
|
||||
constant uint& depth2dSwzl = spvSwizzleConstants[7];
|
||||
constant uint& depthCubeSwzl = spvSwizzleConstants[8];
|
||||
constant uint& depth2dArraySwzl = spvSwizzleConstants[9];
|
||||
constant uint& depthCubeArraySwzl = spvSwizzleConstants[10];
|
||||
constant uint& depth2dSwzl = spvSwizzleConstants[6];
|
||||
constant uint& depthCubeSwzl = spvSwizzleConstants[7];
|
||||
constant uint& depth2dArraySwzl = spvSwizzleConstants[8];
|
||||
constant uint& depthCubeArraySwzl = spvSwizzleConstants[9];
|
||||
float4 c = doSwizzle(tex1d, tex1dSmplr, tex1dSwzl, tex2d, tex2dSmplr, tex2dSwzl, tex3d, tex3dSmplr, tex3dSwzl, texCube, texCubeSmplr, texCubeSwzl, tex2dArray, tex2dArraySmplr, tex2dArraySwzl, texCubeArray, texCubeArraySmplr, texCubeArraySwzl, depth2d, depth2dSmplr, depth2dSwzl, depthCube, depthCubeSmplr, depthCubeSwzl, depth2dArray, depth2dArraySmplr, depth2dArraySwzl, depthCubeArray, depthCubeArraySmplr, depthCubeArraySwzl, texBuffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ inline vec<T, 4> spvGatherCompareSwizzle(sampler s, const thread Tex& t, Ts... p
|
||||
return t.gather_compare(s, spvForward<Ts>(params)...);
|
||||
}
|
||||
|
||||
fragment void main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d<float> tex1d [[texture(0)]], texture2d<float> tex2d [[texture(1)]], texture3d<float> tex3d [[texture(2)]], texturecube<float> texCube [[texture(3)]], texture2d_array<float> tex2dArray [[texture(4)]], texturecube_array<float> texCubeArray [[texture(5)]], texture2d<float> texBuffer [[texture(6)]], depth2d<float> depth2d [[texture(7)]], depthcube<float> depthCube [[texture(8)]], depth2d_array<float> depth2dArray [[texture(9)]], depthcube_array<float> depthCubeArray [[texture(10)]], sampler tex1dSmplr [[sampler(0)]], sampler tex2dSmplr [[sampler(1)]], sampler tex3dSmplr [[sampler(2)]], sampler texCubeSmplr [[sampler(3)]], sampler tex2dArraySmplr [[sampler(4)]], sampler texCubeArraySmplr [[sampler(5)]], sampler depth2dSmplr [[sampler(7)]], sampler depthCubeSmplr [[sampler(8)]], sampler depth2dArraySmplr [[sampler(9)]], sampler depthCubeArraySmplr [[sampler(10)]])
|
||||
fragment void main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d<float> tex1d [[texture(0)]], texture2d<float> tex2d [[texture(1)]], texture3d<float> tex3d [[texture(2)]], texturecube<float> texCube [[texture(3)]], texture2d_array<float> tex2dArray [[texture(4)]], texturecube_array<float> texCubeArray [[texture(5)]], depth2d<float> depth2d [[texture(6)]], depthcube<float> depthCube [[texture(7)]], depth2d_array<float> depth2dArray [[texture(8)]], depthcube_array<float> depthCubeArray [[texture(9)]], texture2d<float> texBuffer [[texture(10)]], sampler tex1dSmplr [[sampler(0)]], sampler tex2dSmplr [[sampler(1)]], sampler tex3dSmplr [[sampler(2)]], sampler texCubeSmplr [[sampler(3)]], sampler tex2dArraySmplr [[sampler(4)]], sampler texCubeArraySmplr [[sampler(5)]], sampler depth2dSmplr [[sampler(6)]], sampler depthCubeSmplr [[sampler(7)]], sampler depth2dArraySmplr [[sampler(8)]], sampler depthCubeArraySmplr [[sampler(9)]])
|
||||
{
|
||||
constant uint& tex1dSwzl = spvSwizzleConstants[0];
|
||||
constant uint& tex2dSwzl = spvSwizzleConstants[1];
|
||||
@@ -139,10 +139,10 @@ fragment void main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d
|
||||
constant uint& texCubeSwzl = spvSwizzleConstants[3];
|
||||
constant uint& tex2dArraySwzl = spvSwizzleConstants[4];
|
||||
constant uint& texCubeArraySwzl = spvSwizzleConstants[5];
|
||||
constant uint& depth2dSwzl = spvSwizzleConstants[7];
|
||||
constant uint& depthCubeSwzl = spvSwizzleConstants[8];
|
||||
constant uint& depth2dArraySwzl = spvSwizzleConstants[9];
|
||||
constant uint& depthCubeArraySwzl = spvSwizzleConstants[10];
|
||||
constant uint& depth2dSwzl = spvSwizzleConstants[6];
|
||||
constant uint& depthCubeSwzl = spvSwizzleConstants[7];
|
||||
constant uint& depth2dArraySwzl = spvSwizzleConstants[8];
|
||||
constant uint& depthCubeArraySwzl = spvSwizzleConstants[9];
|
||||
float4 c = spvTextureSwizzle(tex1d.sample(tex1dSmplr, 0.0), tex1dSwzl);
|
||||
c = spvTextureSwizzle(tex2d.sample(tex2dSmplr, float2(0.0)), tex2dSwzl);
|
||||
c = spvTextureSwizzle(tex3d.sample(tex3dSmplr, float3(0.0)), tex3dSwzl);
|
||||
|
||||
@@ -173,7 +173,7 @@ void vs_adjust(thread float4& dst_reg0, thread float4& dst_reg1, thread float4&
|
||||
dst_reg0.x = float4(dot(float4(tmp0.xyz, 1.0), v_309.vc[0])).x;
|
||||
}
|
||||
|
||||
vertex main0_out main0(constant VertexBuffer& v_227 [[buffer(0)]], constant VertexConstantsBuffer& v_309 [[buffer(1)]], texture2d<uint> buff_in_1 [[texture(3)]], texture2d<uint> buff_in_2 [[texture(4)]], uint gl_VertexIndex [[vertex_id]])
|
||||
vertex main0_out main0(constant VertexBuffer& v_227 [[buffer(0)]], constant VertexConstantsBuffer& v_309 [[buffer(1)]], texture2d<uint> buff_in_2 [[texture(0)]], texture2d<uint> buff_in_1 [[texture(1)]], uint gl_VertexIndex [[vertex_id]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 dst_reg0 = float4(0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
@@ -183,7 +183,7 @@ float4 do_samples(thread const texture1d<float> t1, thread const sampler t1Smplr
|
||||
return c;
|
||||
}
|
||||
|
||||
fragment main0_out main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d<float> tex1d [[texture(0)]], texture2d<float> tex2d [[texture(1)]], texture3d<float> tex3d [[texture(2)]], texturecube<float> texCube [[texture(3)]], texture2d_array<float> tex2dArray [[texture(4)]], texturecube_array<float> texCubeArray [[texture(5)]], texture2d<float> texBuffer [[texture(6)]], depth2d<float> depth2d [[texture(7)]], depthcube<float> depthCube [[texture(8)]], depth2d_array<float> depth2dArray [[texture(9)]], depthcube_array<float> depthCubeArray [[texture(10)]], sampler tex1dSmplr [[sampler(0)]], sampler tex3dSmplr [[sampler(2)]], sampler tex2dArraySmplr [[sampler(4)]], sampler texCubeArraySmplr [[sampler(5)]], sampler depth2dSmplr [[sampler(7)]], sampler depthCubeSmplr [[sampler(8)]], sampler depthCubeArraySmplr [[sampler(10)]], sampler defaultSampler [[sampler(11)]], sampler shadowSampler [[sampler(12)]])
|
||||
fragment main0_out main0(constant uint* spvSwizzleConstants [[buffer(30)]], texture1d<float> tex1d [[texture(0)]], texture2d<float> tex2d [[texture(1)]], texture3d<float> tex3d [[texture(2)]], texturecube<float> texCube [[texture(3)]], texture2d_array<float> tex2dArray [[texture(4)]], texturecube_array<float> texCubeArray [[texture(5)]], texture2d<float> texBuffer [[texture(6)]], depth2d<float> depth2d [[texture(7)]], depthcube<float> depthCube [[texture(8)]], depth2d_array<float> depth2dArray [[texture(9)]], depthcube_array<float> depthCubeArray [[texture(10)]], sampler defaultSampler [[sampler(0)]], sampler shadowSampler [[sampler(1)]], sampler tex1dSmplr [[sampler(2)]], sampler tex3dSmplr [[sampler(3)]], sampler tex2dArraySmplr [[sampler(4)]], sampler texCubeArraySmplr [[sampler(5)]], sampler depth2dSmplr [[sampler(6)]], sampler depthCubeSmplr [[sampler(7)]], sampler depthCubeArraySmplr [[sampler(8)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
constant uint& tex1dSwzl = spvSwizzleConstants[0];
|
||||
|
||||
@@ -35,7 +35,7 @@ struct B_1
|
||||
/* FIXME: A padded struct is needed here. If you see this message, file a bug! */ A_2 Data[1024];
|
||||
};
|
||||
|
||||
kernel void main0(device B& C3 [[buffer(0)]], device A_1& C1 [[buffer(1)]], constant A_3& C2 [[buffer(2)]], constant B_1& C4 [[buffer(3)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device A_1& C1 [[buffer(0)]], constant A_3& C2 [[buffer(1)]], device B& C3 [[buffer(2)]], constant B_1& C4 [[buffer(3)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
C1.Data[gl_GlobalInvocationID.x].a = C2.Data[gl_GlobalInvocationID.x].a;
|
||||
C1.Data[gl_GlobalInvocationID.x].b = C2.Data[gl_GlobalInvocationID.x].b;
|
||||
|
||||
@@ -16,7 +16,7 @@ uint2 spvTexelBufferCoord(uint tc)
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
kernel void main0(constant cb5_struct& cb0_5 [[buffer(1)]], texture2d<uint, access::write> u0 [[texture(0)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
kernel void main0(constant cb5_struct& cb0_5 [[buffer(0)]], texture2d<uint, access::write> u0 [[texture(0)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
{
|
||||
float4 r0;
|
||||
r0.x = as_type<float>(int(gl_LocalInvocationID.x) << 4);
|
||||
|
||||
@@ -16,7 +16,7 @@ uint2 spvTexelBufferCoord(uint tc)
|
||||
return uint2(tc % 4096, tc / 4096);
|
||||
}
|
||||
|
||||
kernel void main0(constant cb& _6 [[buffer(7)]], texture2d<float, access::write> _buffer [[texture(0)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
|
||||
kernel void main0(constant cb& _6 [[buffer(0)]], texture2d<float, access::write> _buffer [[texture(0)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]])
|
||||
{
|
||||
_buffer.write(float4(_6.value), spvTexelBufferCoord(((32u * gl_WorkGroupID.x) + gl_LocalInvocationIndex)));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ void _main(thread const uint3& id, const device ssbo& ssbo_1)
|
||||
Load(param, ssbo_1);
|
||||
}
|
||||
|
||||
kernel void main0(const device ssbo& ssbo_1 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(const device ssbo& ssbo_1 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
uint3 id = gl_GlobalInvocationID;
|
||||
uint3 param = id;
|
||||
|
||||
@@ -17,7 +17,7 @@ int2 get_texcoord(thread const int2& base, thread const int2& index, thread uint
|
||||
return (base * int3(gl_LocalInvocationID).xy) + index;
|
||||
}
|
||||
|
||||
kernel void main0(constant cb1_struct& cb0_1 [[buffer(0)]], texture2d<float, access::write> u0 [[texture(1)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
kernel void main0(constant cb1_struct& cb0_1 [[buffer(0)]], texture2d<float, access::write> u0 [[texture(0)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
{
|
||||
int2 r0 = int2(int2(u0.get_width(), u0.get_height()) >> int2(uint2(4u)));
|
||||
for (int i = 0; i < r0.y; i++)
|
||||
|
||||
@@ -10,7 +10,7 @@ struct cb1_struct
|
||||
|
||||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(16u, 16u, 1u);
|
||||
|
||||
kernel void main0(constant cb1_struct& cb0_1 [[buffer(0)]], texture2d<float, access::write> u0 [[texture(1)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
kernel void main0(constant cb1_struct& cb0_1 [[buffer(0)]], texture2d<float, access::write> u0 [[texture(0)]], uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]])
|
||||
{
|
||||
int2 r0 = int2(int2(u0.get_width(), u0.get_height()) >> int2(uint2(4u)));
|
||||
for (int i = 0; i < r0.y; i++)
|
||||
|
||||
@@ -13,7 +13,7 @@ struct main0_in
|
||||
float2 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uTex [[texture(1)]], sampler uSampler [[sampler(0)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uTex [[texture(0)]], sampler uSampler [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uTex.sample(uSampler, in.vUV);
|
||||
|
||||
@@ -23,16 +23,8 @@ struct main0_out
|
||||
float4 m_3 [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(constant _6& _20 [[buffer(0)]], constant _7* _8_0 [[buffer(1)]], constant _7* _8_1 [[buffer(2)]], constant _7* _8_2 [[buffer(3)]], constant _7* _8_3 [[buffer(4)]], const device _4* _5_0 [[buffer(5)]], const device _4* _5_1 [[buffer(6)]], const device _4* _5_2 [[buffer(7)]], const device _4* _5_3 [[buffer(8)]])
|
||||
fragment main0_out main0(const device _4* _5_0 [[buffer(0)]], const device _4* _5_1 [[buffer(1)]], const device _4* _5_2 [[buffer(2)]], const device _4* _5_3 [[buffer(3)]], constant _6& _20 [[buffer(4)]], constant _7* _8_0 [[buffer(5)]], constant _7* _8_1 [[buffer(6)]], constant _7* _8_2 [[buffer(7)]], constant _7* _8_3 [[buffer(8)]])
|
||||
{
|
||||
constant _7* _8[] =
|
||||
{
|
||||
_8_0,
|
||||
_8_1,
|
||||
_8_2,
|
||||
_8_3,
|
||||
};
|
||||
|
||||
const device _4* _5[] =
|
||||
{
|
||||
_5_0,
|
||||
@@ -41,6 +33,14 @@ fragment main0_out main0(constant _6& _20 [[buffer(0)]], constant _7* _8_0 [[buf
|
||||
_5_3,
|
||||
};
|
||||
|
||||
constant _7* _8[] =
|
||||
{
|
||||
_8_0,
|
||||
_8_1,
|
||||
_8_2,
|
||||
_8_3,
|
||||
};
|
||||
|
||||
main0_out out = {};
|
||||
out.m_3 = _5[_20._m0]->_m0 + (_8[_20._m0]->_m0 * float4(0.20000000298023223876953125));
|
||||
return out;
|
||||
|
||||
22
3rdparty/spirv-cross/reference/shaders-msl/asm/frag/min-lod.msl22.asm.frag
vendored
Normal file
22
3rdparty/spirv-cross/reference/shaders-msl/asm/frag/min-lod.msl22.asm.frag
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float2 vUV [[user(locn0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> uSampler [[texture(0)]], sampler uSamplerSmplr [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = uSampler.sample(uSamplerSmplr, in.vUV, min_lod_clamp(4.0));
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct main0_out
|
||||
float4 o0 [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(constant push_cb& _19 [[buffer(0)]], texture2d<float> t0 [[texture(2)]], sampler dummy_sampler [[sampler(4)]])
|
||||
fragment main0_out main0(constant push_cb& _19 [[buffer(0)]], texture2d<float> t0 [[texture(0)]], sampler dummy_sampler [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
float4 r0;
|
||||
|
||||
@@ -25,7 +25,7 @@ float sample_separate(thread float3& vUV, thread depth2d<float> uTexture, thread
|
||||
return uTexture.sample_compare(uSampler, vUV.xy, vUV.z);
|
||||
}
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow [[texture(0)]], depth2d<float> uTexture [[texture(1)]], sampler uShadowSmplr [[sampler(0)]], sampler uSampler [[sampler(2)]])
|
||||
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow [[texture(0)]], depth2d<float> uTexture [[texture(1)]], sampler uShadowSmplr [[sampler(0)]], sampler uSampler [[sampler(1)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = sample_combined(in.vUV, uShadow, uShadowSmplr) + sample_separate(in.vUV, uTexture, uSampler);
|
||||
|
||||
@@ -125,7 +125,7 @@ struct main0_out
|
||||
float4 m_5 [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _18& _19 [[buffer(1)]], constant _10& _11 [[buffer(2)]], texture2d<float> _14 [[texture(4)]], texture2d<float> _12 [[texture(13)]], texture2d<float> _8 [[texture(14)]], sampler _15 [[sampler(3)]], sampler _13 [[sampler(5)]], sampler _9 [[sampler(6)]], float4 gl_FragCoord [[position]])
|
||||
fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buffer(1)]], constant _18& _19 [[buffer(2)]], texture2d<float> _8 [[texture(0)]], texture2d<float> _12 [[texture(1)]], texture2d<float> _14 [[texture(2)]], sampler _9 [[sampler(0)]], sampler _13 [[sampler(1)]], sampler _15 [[sampler(2)]], float4 gl_FragCoord [[position]])
|
||||
{
|
||||
main0_out out = {};
|
||||
_28 _77 = _74;
|
||||
|
||||
@@ -33,7 +33,7 @@ struct spvDescriptorSetBuffer1
|
||||
const device SSBO1* ssbo1 [[id(0)]];
|
||||
};
|
||||
|
||||
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], const device SSBO2& ssbo2 [[buffer(5)]], device SSBO3& ssbo3 [[buffer(6)]])
|
||||
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], device SSBO3& ssbo3 [[buffer(2)]], const device SSBO2& ssbo2 [[buffer(3)]])
|
||||
{
|
||||
ssbo3.v = ((*spvDescriptorSet0.ssbo0).v + (*spvDescriptorSet1.ssbo1).v) + ssbo2.v;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ using namespace metal;
|
||||
|
||||
struct spvDescriptorSetBuffer0
|
||||
{
|
||||
texture2d<float, access::write> uImage [[id(1)]];
|
||||
texture2d<float> uImageRead [[id(2)]];
|
||||
texture2d<float, access::write> uImage [[id(0)]];
|
||||
texture2d<float> uImageRead [[id(1)]];
|
||||
};
|
||||
|
||||
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
|
||||
@@ -21,7 +21,7 @@ uint get_size(device SSBO& v_14, constant uint& v_14BufferSize, device SSBO1* (&
|
||||
return uint(int((v_14BufferSize - 16) / 16) + int((ssbosBufferSize[1] - 0) / 4));
|
||||
}
|
||||
|
||||
kernel void main0(constant uint* spvBufferSizeConstants [[buffer(25)]], device SSBO& v_14 [[buffer(1)]], device SSBO1* ssbos_0 [[buffer(2)]], device SSBO1* ssbos_1 [[buffer(3)]])
|
||||
kernel void main0(constant uint* spvBufferSizeConstants [[buffer(25)]], device SSBO& v_14 [[buffer(0)]], device SSBO1* ssbos_0 [[buffer(1)]], device SSBO1* ssbos_1 [[buffer(2)]])
|
||||
{
|
||||
device SSBO1* ssbos[] =
|
||||
{
|
||||
@@ -29,8 +29,8 @@ kernel void main0(constant uint* spvBufferSizeConstants [[buffer(25)]], device S
|
||||
ssbos_1,
|
||||
};
|
||||
|
||||
constant uint& v_14BufferSize = spvBufferSizeConstants[1];
|
||||
constant uint* ssbosBufferSize = &spvBufferSizeConstants[2];
|
||||
constant uint& v_14BufferSize = spvBufferSizeConstants[0];
|
||||
constant uint* ssbosBufferSize = &spvBufferSizeConstants[1];
|
||||
v_14.size = get_size(v_14, v_14BufferSize, ssbos, ssbosBufferSize);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,14 +29,14 @@ struct SSBO3
|
||||
|
||||
struct spvDescriptorSetBuffer0
|
||||
{
|
||||
constant uint* spvBufferSizeConstants [[id(0)]];
|
||||
device SSBO* v_16 [[id(1)]];
|
||||
device SSBO* v_16 [[id(0)]];
|
||||
constant uint* spvBufferSizeConstants [[id(1)]];
|
||||
};
|
||||
|
||||
struct spvDescriptorSetBuffer1
|
||||
{
|
||||
constant uint* spvBufferSizeConstants [[id(1)]];
|
||||
device SSBO1* ssbos [[id(2)]][2];
|
||||
device SSBO1* ssbos [[id(0)]][2];
|
||||
constant uint* spvBufferSizeConstants [[id(2)]];
|
||||
};
|
||||
|
||||
uint get_size(device SSBO& v_16, constant uint& v_16BufferSize, device SSBO1* constant (&ssbos)[2], constant uint* ssbosBufferSize, device SSBO2& v_38, constant uint& v_38BufferSize, device SSBO3* (&ssbos2)[2], constant uint* ssbos2BufferSize)
|
||||
@@ -48,7 +48,7 @@ uint get_size(device SSBO& v_16, constant uint& v_16BufferSize, device SSBO1* co
|
||||
return len;
|
||||
}
|
||||
|
||||
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], constant uint* spvBufferSizeConstants [[buffer(25)]], device SSBO3* ssbos2_0 [[buffer(2)]], device SSBO3* ssbos2_1 [[buffer(3)]], device SSBO2& v_38 [[buffer(5)]])
|
||||
kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], constant uint* spvBufferSizeConstants [[buffer(25)]], device SSBO2& v_38 [[buffer(2)]], device SSBO3* ssbos2_0 [[buffer(3)]], device SSBO3* ssbos2_1 [[buffer(4)]])
|
||||
{
|
||||
device SSBO3* ssbos2[] =
|
||||
{
|
||||
@@ -56,10 +56,10 @@ kernel void main0(constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0
|
||||
ssbos2_1,
|
||||
};
|
||||
|
||||
constant uint& spvDescriptorSet0_v_16BufferSize = spvDescriptorSet0.spvBufferSizeConstants[1];
|
||||
constant uint* spvDescriptorSet1_ssbosBufferSize = &spvDescriptorSet1.spvBufferSizeConstants[2];
|
||||
constant uint& v_38BufferSize = spvBufferSizeConstants[5];
|
||||
constant uint* ssbos2BufferSize = &spvBufferSizeConstants[2];
|
||||
constant uint& spvDescriptorSet0_v_16BufferSize = spvDescriptorSet0.spvBufferSizeConstants[0];
|
||||
constant uint* spvDescriptorSet1_ssbosBufferSize = &spvDescriptorSet1.spvBufferSizeConstants[0];
|
||||
constant uint& v_38BufferSize = spvBufferSizeConstants[2];
|
||||
constant uint* ssbos2BufferSize = &spvBufferSizeConstants[3];
|
||||
(*spvDescriptorSet0.v_16).size = get_size((*spvDescriptorSet0.v_16), spvDescriptorSet0_v_16BufferSize, spvDescriptorSet1.ssbos, spvDescriptorSet1_ssbosBufferSize, v_38, v_38BufferSize, ssbos2, ssbos2BufferSize);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ struct SSBO
|
||||
int i32;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& ssbo [[buffer(2)]])
|
||||
kernel void main0(device SSBO& ssbo [[buffer(0)]])
|
||||
{
|
||||
threadgroup uint shared_u32;
|
||||
threadgroup int shared_i32;
|
||||
|
||||
@@ -18,7 +18,7 @@ struct UBO
|
||||
half4 const0;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO0& _29 [[buffer(0)]], device SSBO1& _21 [[buffer(1)]], constant UBO& _40 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO1& _21 [[buffer(0)]], device SSBO0& _29 [[buffer(1)]], constant UBO& _40 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
uint ident = gl_GlobalInvocationID.x;
|
||||
short2 _47 = as_type<short2>(_29.inputs[ident].x) + as_type<short2>(_40.const0.xy);
|
||||
|
||||
@@ -8,7 +8,7 @@ struct SSBO
|
||||
float4 value;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _10 [[buffer(1)]])
|
||||
kernel void main0(device SSBO& _10 [[buffer(0)]])
|
||||
{
|
||||
_10.value = float4(20.0);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ struct SSBO
|
||||
int4 value;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _10 [[buffer(1)]], texture2d<int> uImage [[texture(3)]])
|
||||
kernel void main0(device SSBO& _10 [[buffer(0)]], texture2d<int> uImage [[texture(0)]])
|
||||
{
|
||||
_10.value = uImage.read(uint2(int2(10)));
|
||||
}
|
||||
|
||||
63
3rdparty/spirv-cross/reference/shaders-msl/comp/int64.invalid.msl22.comp
vendored
Normal file
63
3rdparty/spirv-cross/reference/shaders-msl/comp/int64.invalid.msl22.comp
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct M0
|
||||
{
|
||||
long v;
|
||||
long2 b[2];
|
||||
ulong c;
|
||||
ulong d[5];
|
||||
};
|
||||
|
||||
struct SSBO0_Type
|
||||
{
|
||||
long4 a;
|
||||
M0 m0;
|
||||
};
|
||||
|
||||
struct SSBO1_Type
|
||||
{
|
||||
ulong4 b;
|
||||
M0 m0;
|
||||
};
|
||||
|
||||
struct SSBO2_Type
|
||||
{
|
||||
long a[4];
|
||||
long2 b[4];
|
||||
};
|
||||
|
||||
struct SSBO3_Type
|
||||
{
|
||||
long a[4];
|
||||
long2 b[4];
|
||||
};
|
||||
|
||||
struct SSBO
|
||||
{
|
||||
int s32;
|
||||
uint u32;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _96 [[buffer(0)]])
|
||||
{
|
||||
SSBO0_Type ssbo_0;
|
||||
ssbo_0.a += long4(10l, 20l, 30l, 40l);
|
||||
SSBO1_Type ssbo_1;
|
||||
ssbo_1.b += ulong4(999999999999999999ul, 8888888888888888ul, 77777777777777777ul, 6666666666666666ul);
|
||||
ssbo_0.a += long4(20l);
|
||||
ssbo_0.a = abs(ssbo_0.a + long4(ssbo_1.b));
|
||||
ssbo_0.a += long4(1l);
|
||||
ssbo_1.b += ulong4(long4(1l));
|
||||
ssbo_0.a -= long4(1l);
|
||||
ssbo_1.b -= ulong4(long4(1l));
|
||||
SSBO2_Type ssbo_2;
|
||||
ssbo_2.a[0] += 1l;
|
||||
SSBO3_Type ssbo_3;
|
||||
ssbo_3.a[0] += 2l;
|
||||
_96.s32 = int(uint(((ulong(ssbo_0.a.x) + ssbo_1.b.y) + ulong(ssbo_2.a[1])) + ulong(ssbo_3.a[2])));
|
||||
_96.u32 = uint(((ulong(ssbo_0.a.y) + ssbo_1.b.z) + ulong(ssbo_2.a[0])) + ulong(ssbo_3.a[1]));
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ struct SSBO2
|
||||
float3x3 out_data[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO2& _22 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO2& _22 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
uint ident = gl_GlobalInvocationID.x;
|
||||
_22.out_data[ident] = float3x3(float3(10.0), float3(20.0), float3(40.0));
|
||||
|
||||
@@ -27,7 +27,7 @@ struct Buffer1
|
||||
|
||||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(32u, 1u, 1u);
|
||||
|
||||
kernel void main0(device Buffer0& _15 [[buffer(1)]], device Buffer1& _34 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device Buffer0& _15 [[buffer(0)]], device Buffer1& _34 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
T1 v;
|
||||
v.a = float3(_15.buf0[0].a);
|
||||
|
||||
@@ -21,7 +21,7 @@ struct Buffer1
|
||||
|
||||
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(32u, 1u, 1u);
|
||||
|
||||
kernel void main0(device Buffer0& _14 [[buffer(1)]], device Buffer1& _24 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device Buffer0& _14 [[buffer(0)]], device Buffer1& _24 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
float x = _14.buf0[0].b;
|
||||
_24.buf1[gl_GlobalInvocationID.x] = x;
|
||||
|
||||
@@ -21,7 +21,7 @@ struct SSBO1
|
||||
float4 data3;
|
||||
};
|
||||
|
||||
kernel void main0(const device SSBO0& _15 [[buffer(0)]], device SSBO1& _21 [[buffer(1)]], device SSBO2& _10 [[buffer(2)]])
|
||||
kernel void main0(device SSBO2& _10 [[buffer(0)]], const device SSBO0& _15 [[buffer(1)]], device SSBO1& _21 [[buffer(2)]])
|
||||
{
|
||||
_10.data4 = _15.data0 + _21.data2;
|
||||
_10.data5 = _15.data1 + _21.data3;
|
||||
|
||||
@@ -18,7 +18,7 @@ struct SSBO
|
||||
Foo in_data[1];
|
||||
};
|
||||
|
||||
kernel void main0(const device SSBO& _30 [[buffer(0)]], device SSBO2& _23 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO2& _23 [[buffer(0)]], const device SSBO& _30 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
uint ident = gl_GlobalInvocationID.x;
|
||||
_23.out_data[ident].m = _30.in_data[ident].m * _30.in_data[ident].m;
|
||||
|
||||
@@ -28,7 +28,7 @@ struct dstbuffer
|
||||
s2_1 test[1];
|
||||
};
|
||||
|
||||
kernel void main0(device dstbuffer& _19 [[buffer(1)]])
|
||||
kernel void main0(device dstbuffer& _19 [[buffer(0)]])
|
||||
{
|
||||
s2 testVal;
|
||||
testVal.b.a = 0;
|
||||
|
||||
@@ -116,7 +116,7 @@ struct SSBO0
|
||||
float4 array[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO0& ssbo_140 [[buffer(0)]], device SSBO1& ssbo_430 [[buffer(1)]])
|
||||
kernel void main0(device SSBO1& ssbo_430 [[buffer(0)]], device SSBO0& ssbo_140 [[buffer(1)]])
|
||||
{
|
||||
Content_1 _60 = ssbo_140.content;
|
||||
ssbo_430.content.m0s[0].a[0] = _60.m0s[0].a[0].xy;
|
||||
|
||||
@@ -13,7 +13,7 @@ struct SSBO
|
||||
uint inputs[1];
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _10 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
kernel void main0(device SSBO2& _10 [[buffer(0)]], device SSBO& _23 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]])
|
||||
{
|
||||
_10.outputs[gl_GlobalInvocationID.x] = _23.inputs[gl_GlobalInvocationID.x] / 29u;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
using namespace metal;
|
||||
|
||||
fragment void main0(texture2d<float, access::write> uImage [[texture(0)]], texture2d_array<float, access::read_write> uImageArray [[texture(1)]], texture2d_ms<float> uImageMS [[texture(2)]])
|
||||
fragment void main0(texture2d_ms<float> uImageMS [[texture(0)]], texture2d_array<float, access::read_write> uImageArray [[texture(1)]], texture2d<float, access::write> uImage [[texture(2)]])
|
||||
{
|
||||
float4 a = uImageMS.read(uint2(int2(1, 2)), 2);
|
||||
float4 b = uImageArray.read(uint2(int3(1, 2, 4).xy), uint(int3(1, 2, 4).z));
|
||||
|
||||
@@ -8,7 +8,7 @@ struct main0_out
|
||||
float4 FragColor [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(texture2d_ms<float> uSampler [[texture(0)]], texture2d_ms<float> uImage [[texture(2)]], sampler uSamplerSmplr [[sampler(0)]])
|
||||
fragment main0_out main0(texture2d_ms<float> uSampler [[texture(0)]], texture2d_ms<float> uImage [[texture(1)]], sampler uSamplerSmplr [[sampler(0)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
out.FragColor = float4(float(int(uSampler.get_num_samples()) + int(uImage.get_num_samples())));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user