twinaphex 420b7913d4 Squashed 'deps/SPIRV-Cross/' changes from 8aa6731925..2820ab0b51
2820ab0b51 Merge pull request #1076 from KhronosGroup/bitcast-pre-330-glsl
63bcbd511e GLSL: Need extension to use bitcast on GLSL < 330.
9f3bebe3d0 Merge pull request #1075 from lifpan/master
b11c20fc1d Remove unreasonable assertion for OpTypeImage Sampled parameter.
1a592b7c0f Merge pull request #1067 from cdavis5e/msl-scalar-block-layout
28454facbb MSL: Handle packed matrices.
ea5c0ed82f MSL: Fix alignment of packed types.
44f688bf0b Merge pull request #1070 from KhronosGroup/fix-1066
25c74b324e Forget loop variable enables after emitting block chain.
6b010e0cbc Merge pull request #1069 from KhronosGroup/fix-1053
f6f849397e MSL: Re-roll array expressions in initializers.
e5fa7edfd6 MSL: Support scalar block layout.

git-subtree-dir: deps/SPIRV-Cross
git-subtree-split: 2820ab0b51bf5e4187435d904b34e762b988f48b
2019-07-11 20:37:45 +02:00

57 lines
1.5 KiB
Plaintext

#version 310 es
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0, std430) readonly buffer Distribution
{
vec2 distribution[];
} _137;
layout(binding = 2, std140) uniform UBO
{
vec4 uModTime;
} _166;
layout(binding = 1, std430) writeonly buffer HeightmapFFT
{
uint heights[];
} _225;
void main()
{
uvec2 _264 = uvec2(64u, 1u) * gl_NumWorkGroups.xy;
uvec2 _269 = _264 - gl_GlobalInvocationID.xy;
bvec2 _271 = equal(gl_GlobalInvocationID.xy, uvec2(0u));
uint _454;
if (_271.x)
{
_454 = 0u;
}
else
{
_454 = _269.x;
}
uint _455;
if (_271.y)
{
_455 = 0u;
}
else
{
_455 = _269.y;
}
uint _276 = _264.x;
uint _280 = (gl_GlobalInvocationID.y * _276) + gl_GlobalInvocationID.x;
uint _290 = (_455 * _276) + _454;
vec2 _297 = vec2(gl_GlobalInvocationID.xy);
vec2 _299 = vec2(_264);
float _309 = sqrt(9.81000041961669921875 * length(_166.uModTime.xy * mix(_297, _297 - _299, greaterThan(_297, _299 * 0.5)))) * _166.uModTime.z;
vec2 _316 = vec2(cos(_309), sin(_309));
vec2 _387 = _316.xx;
vec2 _392 = _316.yy;
vec2 _395 = _392 * _137.distribution[_280].yx;
vec2 _421 = _392 * _137.distribution[_290].yx;
vec2 _429 = (_137.distribution[_290] * _387) + vec2(-_421.x, _421.y);
_225.heights[_280] = packHalf2x16(((_137.distribution[_280] * _387) + vec2(-_395.x, _395.y)) + vec2(_429.x, -_429.y));
}