diff --git a/checkout_glslang_spirv_tools.sh b/checkout_glslang_spirv_tools.sh index 2205e720..2a856d89 100755 --- a/checkout_glslang_spirv_tools.sh +++ b/checkout_glslang_spirv_tools.sh @@ -1,8 +1,8 @@ #!/bin/bash -GLSLANG_REV=2e0f0a0517e4251ac8e0d6fd46e92af33fcb800d0 -SPIRV_TOOLS_REV=95df4c9643cd440187d652c24d463c1c7dd99a91 -SPIRV_HEADERS_REV=c0df742ec0b8178ad58c68cff3437ad4b6a06e26 +GLSLANG_REV=2cf9621d6d6f3b5e38f471709f45d35720a7ffee +SPIRV_TOOLS_REV=b0264b87ffb5e50159dafe897d8e50cbd308affc +SPIRV_HEADERS_REV=ac638f1815425403e946d0ab78bac71d2bdbf3be if [ -z $PROTOCOL ]; then PROTOCOL=git diff --git a/reference/opt/shaders-hlsl/asm/comp/control-flow-hints.asm.comp b/reference/opt/shaders-hlsl/asm/comp/control-flow-hints.asm.comp index ea79d002..70df6baf 100644 --- a/reference/opt/shaders-hlsl/asm/comp/control-flow-hints.asm.comp +++ b/reference/opt/shaders-hlsl/asm/comp/control-flow-hints.asm.comp @@ -3,13 +3,22 @@ RWByteAddressBuffer foo : register(u1); void comp_main() { - [unroll] - for (int _136 = 0; _136 < 16; ) - { - bar.Store4(_136 * 16 + 0, asuint(asfloat(foo.Load4(_136 * 16 + 0)))); - _136++; - continue; - } + bar.Store4(0, asuint(asfloat(foo.Load4(0)))); + bar.Store4(16, asuint(asfloat(foo.Load4(16)))); + bar.Store4(32, asuint(asfloat(foo.Load4(32)))); + bar.Store4(48, asuint(asfloat(foo.Load4(48)))); + bar.Store4(64, asuint(asfloat(foo.Load4(64)))); + bar.Store4(80, asuint(asfloat(foo.Load4(80)))); + bar.Store4(96, asuint(asfloat(foo.Load4(96)))); + bar.Store4(112, asuint(asfloat(foo.Load4(112)))); + bar.Store4(128, asuint(asfloat(foo.Load4(128)))); + bar.Store4(144, asuint(asfloat(foo.Load4(144)))); + bar.Store4(160, asuint(asfloat(foo.Load4(160)))); + bar.Store4(176, asuint(asfloat(foo.Load4(176)))); + bar.Store4(192, asuint(asfloat(foo.Load4(192)))); + bar.Store4(208, asuint(asfloat(foo.Load4(208)))); + bar.Store4(224, asuint(asfloat(foo.Load4(224)))); + bar.Store4(240, asuint(asfloat(foo.Load4(240)))); [loop] for (int _137 = 0; _137 < 16; ) { diff --git a/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag b/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag index f749ad53..c10e3915 100644 --- a/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag +++ b/reference/opt/shaders-ue4/asm/frag/global-constant-arrays.asm.frag @@ -621,12 +621,12 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa float3 _2477 = _2403; _2477.z = pow(10.0, _2475); float3 _2479 = (_2477 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)); - float _2612 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[0], _476[1], _476[2])).z); - float _2684 = pow(10.0, dot(float3(0.4444443881511688232421875, 0.66666662693023681640625, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[1], _476[2], _476[3]))); + float _2612 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875)).z); + float _2684 = pow(10.0, dot(float3(0.4444443881511688232421875, 0.66666662693023681640625, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(2.0810306072235107421875, 3.66812419891357421875, 4.0))); float _2685 = _2479.x; float _2688 = log((_2685 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2685); float _2689 = _2688 * 0.4342944622039794921875; - float _2690 = log(pow(10.0, dot(float3(0.3600003719329833984375, 0.600000321865081787109375, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[0], _475[1], _475[2])))); + float _2690 = log(pow(10.0, dot(float3(0.3600003719329833984375, 0.600000321865081787109375, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-4.0, -4.0, -3.1573765277862548828125)))); float _2691 = _2690 * 0.4342944622039794921875; float _2768; if (_2689 <= _2691) @@ -983,12 +983,12 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa float3 _1640 = _1566; _1640.z = pow(10.0, _1638); float3 _1642 = (_1640 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)); - float _1775 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[0], _476[1], _476[2])).z); - float _1847 = pow(10.0, dot(float3(0.69444429874420166015625, 0.8333332538604736328125, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_476[1], _476[2], _476[3]))); + float _1775 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875)).z); + float _1847 = pow(10.0, dot(float3(0.69444429874420166015625, 0.8333332538604736328125, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(2.0810306072235107421875, 3.66812419891357421875, 4.0))); float _1848 = _1642.x; float _1851 = log((_1848 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1848); float _1852 = _1851 * 0.4342944622039794921875; - float _1854 = log(pow(10.0, dot(float3(0.3600003719329833984375, 0.600000321865081787109375, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_475[0], _475[1], _475[2])))) * 0.4342944622039794921875; + float _1854 = log(pow(10.0, dot(float3(0.3600003719329833984375, 0.600000321865081787109375, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-4.0, -4.0, -3.1573765277862548828125)))) * 0.4342944622039794921875; float _1926; if (_1852 <= _1854) { diff --git a/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag b/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag index 7e2f5b6b..2926c322 100644 --- a/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag +++ b/reference/opt/shaders-ue4/asm/frag/padded-float-array-member-defef.asm.frag @@ -102,7 +102,7 @@ constant spvUnsafeArray _506 = spvUnsafeArray({ -2.3010299 constant spvUnsafeArray _507 = spvUnsafeArray({ 0.801995217800140380859375, 1.19800484180450439453125, 1.5943000316619873046875, 1.99730002880096435546875, 2.3782999515533447265625, 2.7683999538421630859375, 3.0515000820159912109375, 3.2746293544769287109375, 3.32743072509765625, 3.32743072509765625 }); constant float3 _523 = {}; -constant float3 _3219 = {}; +constant float3 _3265 = {}; struct main0_out { @@ -326,7 +326,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa float3 _1215; if (_Globals.ColorShadow_Tint2.w == 0.0) { - float3 _1157 = _3219; + float3 _1157 = _3265; _1157.x = dot(_932, _Globals.ColorMatrixR_ColorCurveCd1.xyz); float3 _1162 = _1157; _1162.y = dot(_932, _Globals.ColorMatrixG_ColorCurveCd3Cm3.xyz); @@ -670,12 +670,12 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa float3 _2581 = _2507; _2581.z = pow(10.0, _2579); float3 _2583 = (_2581 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)); - float _2714 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[0], _500[1], _500[2])).z); - float _2786 = pow(10.0, dot(float3(0.4444443881511688232421875, 0.66666662693023681640625, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[1], _500[2], _500[3]))); + float _2714 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875)).z); + float _2786 = pow(10.0, dot(float3(0.4444443881511688232421875, 0.66666662693023681640625, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(2.0810306072235107421875, 3.66812419891357421875, 4.0))); float _2787 = _2583.x; float _2790 = log((_2787 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _2787); float _2791 = _2790 * 0.4342944622039794921875; - float _2792 = log(pow(10.0, dot(float3(0.3600003719329833984375, 0.600000321865081787109375, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[0], _499[1], _499[2])))); + float _2792 = log(pow(10.0, dot(float3(0.3600003719329833984375, 0.600000321865081787109375, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-4.0, -4.0, -3.1573765277862548828125)))); float _2793 = _2792 * 0.4342944622039794921875; float _2870; if (_2791 <= _2793) @@ -1032,12 +1032,12 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Globals& _Globa float3 _1746 = _1672; _1746.z = pow(10.0, _1744); float3 _1748 = (_1746 * float3x3(float3(0.695452213287353515625, 0.140678703784942626953125, 0.16386906802654266357421875), float3(0.0447945632040500640869140625, 0.859671115875244140625, 0.095534317195415496826171875), float3(-0.0055258828215301036834716796875, 0.0040252101607620716094970703125, 1.00150072574615478515625))) * float3x3(float3(1.45143926143646240234375, -0.236510753631591796875, -0.214928567409515380859375), float3(-0.07655377686023712158203125, 1.1762297153472900390625, -0.0996759235858917236328125), float3(0.0083161480724811553955078125, -0.0060324496589601039886474609375, 0.99771630764007568359375)); - float _1879 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[0], _500[1], _500[2])).z); - float _1951 = pow(10.0, dot(float3(0.69444429874420166015625, 0.8333332538604736328125, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_500[1], _500[2], _500[3]))); + float _1879 = pow(10.0, (float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-0.718548238277435302734375, 2.0810306072235107421875, 3.66812419891357421875)).z); + float _1951 = pow(10.0, dot(float3(0.69444429874420166015625, 0.8333332538604736328125, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(2.0810306072235107421875, 3.66812419891357421875, 4.0))); float _1952 = _1748.x; float _1955 = log((_1952 <= 0.0) ? 9.9999997473787516355514526367188e-05 : _1952); float _1956 = _1955 * 0.4342944622039794921875; - float _1958 = log(pow(10.0, dot(float3(0.3600003719329833984375, 0.600000321865081787109375, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(_499[0], _499[1], _499[2])))) * 0.4342944622039794921875; + float _1958 = log(pow(10.0, dot(float3(0.3600003719329833984375, 0.600000321865081787109375, 1.0), float3x3(float3(0.5, -1.0, 0.5), float3(-1.0, 1.0, 0.5), float3(0.5, 0.0, 0.0)) * float3(-4.0, -4.0, -3.1573765277862548828125)))) * 0.4342944622039794921875; float _2030; if (_1956 <= _1958) { diff --git a/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag b/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag index 98cdda44..d5ce54c0 100644 --- a/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag +++ b/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.frag @@ -1,5 +1,3 @@ -#pragma clang diagnostic ignored "-Wmissing-prototypes" -#pragma clang diagnostic ignored "-Wmissing-braces" #pragma clang diagnostic ignored "-Wunused-variable" #include @@ -8,44 +6,6 @@ using namespace metal; -template -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 type_StructuredBuffer_v4float { float4 _m0[1]; @@ -84,33 +44,28 @@ fragment main0_out main0(main0_in in [[stage_in]], const device type_StructuredB uint _107 = _103 + 1u; if (all(CulledObjectBoxBounds._m0[_107].xy > _96.xy) && all(CulledObjectBoxBounds._m0[_103].xyz < _102)) { + float3 _121 = float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz); float _122 = _96.x; float _123 = _96.y; - spvUnsafeArray _73; - _73[0] = float3(_122, _123, -1000.0); float _126 = _100.x; - _73[1] = float3(_126, _123, -1000.0); float _129 = _100.y; - _73[2] = float3(_122, _129, -1000.0); - _73[3] = float3(_126, _129, -1000.0); - _73[4] = float3(_122, _123, 1.0); - _73[5] = float3(_126, _123, 1.0); - _73[6] = float3(_122, _129, 1.0); - _73[7] = float3(_126, _129, 1.0); - float3 _155; - float3 _158; - _155 = float3(-500000.0); - _158 = float3(500000.0); - for (int _160 = 0; _160 < 8; ) - { - float3 _166 = _73[_160] - (float3(0.5) * (CulledObjectBoxBounds._m0[_103].xyz + CulledObjectBoxBounds._m0[_107].xyz)); - float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 4u].xyz)); - _155 = fast::max(_155, _170); - _158 = fast::min(_158, _170); - _160++; - continue; - } - if (all(_158 < float3(1.0)) && all(_155 > float3(-1.0))) + float3 _166 = float3(_122, _123, -1000.0) - _121; + float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_166, CulledObjectBoxBounds._m0[_103 + 4u].xyz)); + float3 _189 = float3(_126, _123, -1000.0) - _121; + float3 _193 = float3(dot(_189, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_189, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_189, CulledObjectBoxBounds._m0[_103 + 4u].xyz)); + float3 _205 = float3(_122, _129, -1000.0) - _121; + float3 _209 = float3(dot(_205, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_205, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_205, CulledObjectBoxBounds._m0[_103 + 4u].xyz)); + float3 _221 = float3(_126, _129, -1000.0) - _121; + float3 _225 = float3(dot(_221, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_221, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_221, CulledObjectBoxBounds._m0[_103 + 4u].xyz)); + float3 _237 = float3(_122, _123, 1.0) - _121; + float3 _241 = float3(dot(_237, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_237, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_237, CulledObjectBoxBounds._m0[_103 + 4u].xyz)); + float3 _253 = float3(_126, _123, 1.0) - _121; + float3 _257 = float3(dot(_253, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_253, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_253, CulledObjectBoxBounds._m0[_103 + 4u].xyz)); + float3 _269 = float3(_122, _129, 1.0) - _121; + float3 _273 = float3(dot(_269, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_269, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_269, CulledObjectBoxBounds._m0[_103 + 4u].xyz)); + float3 _285 = float3(_126, _129, 1.0) - _121; + float3 _289 = float3(dot(_285, CulledObjectBoxBounds._m0[_103 + 2u].xyz), dot(_285, CulledObjectBoxBounds._m0[_103 + 3u].xyz), dot(_285, CulledObjectBoxBounds._m0[_103 + 4u].xyz)); + if (all(fast::min(fast::min(fast::min(fast::min(fast::min(fast::min(fast::min(fast::min(float3(500000.0), _170), _193), _209), _225), _241), _257), _273), _289) < float3(1.0)) && all(fast::max(fast::max(fast::max(fast::max(fast::max(fast::max(fast::max(fast::max(float3(-500000.0), _170), _193), _209), _225), _241), _257), _273), _289) > float3(-1.0))) { uint _179 = atomic_fetch_add_explicit((device atomic_uint*)&RWShadowTileNumCulledObjects_atomic[(_78 * _Globals.ShadowTileListGroupSize.x) + _83], 1u, memory_order_relaxed); } diff --git a/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag b/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag index aa36f6cc..a7bb0ff2 100644 --- a/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag +++ b/reference/opt/shaders-ue4/asm/frag/texture-atomics.asm.graphics-robust-access.frag @@ -1,5 +1,3 @@ -#pragma clang diagnostic ignored "-Wmissing-prototypes" -#pragma clang diagnostic ignored "-Wmissing-braces" #pragma clang diagnostic ignored "-Wunused-variable" #include @@ -8,44 +6,6 @@ using namespace metal; -template -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 type_StructuredBuffer_v4float { float4 _m0[1]; @@ -82,36 +42,31 @@ fragment main0_out main0(main0_in in [[stage_in]], constant uint* spvBufferSizeC float3 _102 = float3(_100.x, _100.y, _70.z); _102.z = 1.0; uint _103 = in.in_var_TEXCOORD0 * 5u; - uint _189 = uint(clamp(int(_103 + 1u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u)))); - if (all(CulledObjectBoxBounds._m0[_189].xy > _96.xy) && all(CulledObjectBoxBounds._m0[uint(clamp(int(_103), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz < _102)) + uint _310 = uint(clamp(int(_103 + 1u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u)))); + if (all(CulledObjectBoxBounds._m0[_310].xy > _96.xy) && all(CulledObjectBoxBounds._m0[uint(clamp(int(_103), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz < _102)) { + float3 _121 = float3(0.5) * (CulledObjectBoxBounds._m0[uint(clamp(int(_103), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz + CulledObjectBoxBounds._m0[_310].xyz); float _122 = _96.x; float _123 = _96.y; - spvUnsafeArray _73; - _73[0] = float3(_122, _123, -1000.0); float _126 = _100.x; - _73[1] = float3(_126, _123, -1000.0); float _129 = _100.y; - _73[2] = float3(_122, _129, -1000.0); - _73[3] = float3(_126, _129, -1000.0); - _73[4] = float3(_122, _123, 1.0); - _73[5] = float3(_126, _123, 1.0); - _73[6] = float3(_122, _129, 1.0); - _73[7] = float3(_126, _129, 1.0); - float3 _155; - float3 _158; - _155 = float3(-500000.0); - _158 = float3(500000.0); - for (int _160 = 0; _160 < 8; ) - { - float3 _166 = _73[clamp(_160, 0, 7)] - (float3(0.5) * (CulledObjectBoxBounds._m0[uint(clamp(int(_103), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz + CulledObjectBoxBounds._m0[_189].xyz)); - float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 2u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_166, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 3u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_166, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 4u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz)); - _155 = fast::max(_155, _170); - _158 = fast::min(_158, _170); - _160++; - continue; - } - if (all(_158 < float3(1.0)) && all(_155 > float3(-1.0))) + float3 _166 = float3(_122, _123, -1000.0) - _121; + float3 _170 = float3(dot(_166, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 2u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_166, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 3u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_166, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 4u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz)); + float3 _189 = float3(_126, _123, -1000.0) - _121; + float3 _193 = float3(dot(_189, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 2u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_189, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 3u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_189, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 4u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz)); + float3 _205 = float3(_122, _129, -1000.0) - _121; + float3 _209 = float3(dot(_205, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 2u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_205, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 3u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_205, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 4u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz)); + float3 _221 = float3(_126, _129, -1000.0) - _121; + float3 _225 = float3(dot(_221, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 2u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_221, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 3u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_221, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 4u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz)); + float3 _237 = float3(_122, _123, 1.0) - _121; + float3 _241 = float3(dot(_237, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 2u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_237, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 3u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_237, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 4u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz)); + float3 _253 = float3(_126, _123, 1.0) - _121; + float3 _257 = float3(dot(_253, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 2u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_253, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 3u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_253, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 4u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz)); + float3 _269 = float3(_122, _129, 1.0) - _121; + float3 _273 = float3(dot(_269, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 2u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_269, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 3u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_269, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 4u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz)); + float3 _285 = float3(_126, _129, 1.0) - _121; + float3 _289 = float3(dot(_285, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 2u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_285, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 3u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz), dot(_285, CulledObjectBoxBounds._m0[uint(clamp(int(_103 + 4u), int(0u), int(min((((CulledObjectBoxBoundsBufferSize - 0) / 16) - 1u), 2147483647u))))].xyz)); + if (all(fast::min(fast::min(fast::min(fast::min(fast::min(fast::min(fast::min(fast::min(float3(500000.0), _170), _193), _209), _225), _241), _257), _273), _289) < float3(1.0)) && all(fast::max(fast::max(fast::max(fast::max(fast::max(fast::max(fast::max(fast::max(float3(-500000.0), _170), _193), _209), _225), _241), _257), _273), _289) > float3(-1.0))) { uint _179 = atomic_fetch_add_explicit((device atomic_uint*)&RWShadowTileNumCulledObjects_atomic[(_78 * _Globals.ShadowTileListGroupSize.x) + _83], 1u, memory_order_relaxed); } diff --git a/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert b/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert index cb5f5fd1..520b58e7 100644 --- a/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert +++ b/reference/opt/shaders-ue4/asm/vert/array-missing-copies.asm.vert @@ -323,13 +323,6 @@ vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buff spvUnsafeArray in_var_ATTRIBUTE1 = {}; in_var_ATTRIBUTE1[0] = in.in_var_ATTRIBUTE1_0; in_var_ATTRIBUTE1[1] = in.in_var_ATTRIBUTE1_1; - spvUnsafeArray _97; - for (int _107 = 0; _107 < 1; ) - { - _97[_107] = float4(0.0); - _107++; - continue; - } float4 _115 = in.in_var_ATTRIBUTE0 * float4(255.0); float2 _116 = _115.zw; float2 _119 = fract(_116 * float2(0.5)) * float2(2.0); @@ -450,13 +443,13 @@ vertex main0_out main0(main0_in in [[stage_in]], constant type_View& View [[buff } bool _468 = (MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.w > 0.0) && (_347 > MobileBasePass.MobileBasePass_Fog_ExponentialFogParameters3.w); float _471 = _468 ? 1.0 : fast::max(fast::clamp(exp2(-(_428 * _393)), 0.0, 1.0), MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.w); - _97[0] = float4((MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.xyz * float3(1.0 - _471)) + select(_459, float3(0.0), bool3(_468)), _471); + float4 _479 = float4((MobileBasePass.MobileBasePass_Fog_ExponentialFogColorParameter.xyz * float3(1.0 - _471)) + select(_459, float3(0.0), bool3(_468)), _471); float4 _482 = _338; _482.w = _339.w; out.out_var_TEXCOORD0 = ((_323 + LandscapeParameters.LandscapeParameters_SubsectionSizeVertsLayerUVPan.zw) + _292).xy; out.out_var_TEXCOORD1 = ((_323 * LandscapeParameters.LandscapeParameters_WeightmapUVScaleBias.xy) + LandscapeParameters.LandscapeParameters_WeightmapUVScaleBias.zw) + (_288 * LandscapeParameters.LandscapeParameters_SubsectionOffsetParams.zz); - out.out_var_TEXCOORD2 = float4(float4(0.0).x, float4(0.0).y, _97[0].x, _97[0].y); - out.out_var_TEXCOORD3 = float4(float4(0.0).x, float4(0.0).y, _97[0].z, _97[0].w); + out.out_var_TEXCOORD2 = float4(float4(0.0).x, float4(0.0).y, _479.x, _479.y); + out.out_var_TEXCOORD3 = float4(float4(0.0).x, float4(0.0).y, _479.z, _479.w); out.out_var_TEXCOORD8 = _482; out.gl_Position = _339; return out;