|
1 |
| -#version 420 |
2 |
| -#extension GL_ARB_texture_gather : enable |
3 |
| -#extension GL_ARB_separate_shader_objects : enable |
4 |
| -#ifdef VULKAN |
5 |
| -#define ATTR_LAYOUT(__vkSet, __location) layout(set = __vkSet, location = __location) |
6 |
| -#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation, std140) |
7 |
| -#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation) |
8 |
| -#define SET_POSITION(_v) gl_Position = _v; gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0 |
9 |
| -#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale.xy,gl_FragCoord.zw) |
10 |
| -#define gl_VertexID gl_VertexIndex |
11 |
| -#define gl_InstanceID gl_InstanceIndex |
12 |
| -#else |
13 |
| -#define ATTR_LAYOUT(__vkSet, __location) layout(location = __location) |
14 |
| -#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) |
15 |
| -#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation) |
16 |
| -#define SET_POSITION(_v) gl_Position = _v |
17 |
| -#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw) |
18 |
| -#endif |
19 |
| -// This shader was automatically converted to be cross-compatible with Vulkan and OpenGL. |
20 |
| - |
21 |
| -// shader 49865bd2e62efda1 |
22 |
| -//dark world bloom |
23 |
| - |
24 |
| -const float bloom = $bloom; |
25 |
| -#ifdef VULKAN |
26 |
| -layout(set = 1, binding = 1) uniform ufBlock |
27 |
| -{ |
28 |
| -uniform ivec4 uf_remappedPS[1]; |
29 |
| -uniform vec4 uf_fragCoordScale; |
30 |
| -}; |
31 |
| -#else |
32 |
| -uniform ivec4 uf_remappedPS[1]; |
33 |
| -uniform vec2 uf_fragCoordScale; |
34 |
| -#endif |
35 |
| -TEXTURE_LAYOUT(0, 1, 0) uniform sampler2D textureUnitPS0; |
36 |
| -layout(location = 0) in vec4 passParameterSem0; |
37 |
| -layout(location = 0) out vec4 passPixelColor0; |
38 |
| -// uf_fragCoordScale was moved to the ufBlock |
39 |
| -int clampFI32(int v) |
40 |
| -{ |
41 |
| -if( v == 0x7FFFFFFF ) |
42 |
| - return floatBitsToInt(1.0); |
43 |
| -else if( v == 0xFFFFFFFF ) |
44 |
| - return floatBitsToInt(0.0); |
45 |
| -return floatBitsToInt(clamp(intBitsToFloat(v), 0.0, 1.0)); |
46 |
| -} |
47 |
| -float mul_nonIEEE(float a, float b){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; } |
48 |
| -void main() |
49 |
| -{ |
50 |
| -vec4 R0f = vec4(0.0); |
51 |
| -float backupReg0f, backupReg1f, backupReg2f, backupReg3f, backupReg4f; |
52 |
| -vec4 PV0f = vec4(0.0), PV1f = vec4(0.0); |
53 |
| -float PS0f = 0.0, PS1f = 0.0; |
54 |
| -vec4 tempf = vec4(0.0); |
55 |
| -float tempResultf; |
56 |
| -int tempResulti; |
57 |
| -ivec4 ARi = ivec4(0); |
58 |
| -bool predResult = true; |
59 |
| -vec3 cubeMapSTM; |
60 |
| -int cubeMapFaceId; |
61 |
| -R0f = passParameterSem0; |
62 |
| -R0f.xyz = (textureLod(textureUnitPS0, R0f.xy,0.0).xyz)*bloom; |
63 |
| -// 0 |
64 |
| -backupReg0f = R0f.y; |
65 |
| -backupReg1f = R0f.x; |
66 |
| -PV0f.x = mul_nonIEEE(R0f.z, intBitsToFloat(uf_remappedPS[0].z)); |
67 |
| -PV0f.y = mul_nonIEEE(backupReg0f, intBitsToFloat(uf_remappedPS[0].y)); |
68 |
| -PV0f.z = mul_nonIEEE(backupReg1f, intBitsToFloat(uf_remappedPS[0].x)); |
69 |
| -PV0f.w = intBitsToFloat(uf_remappedPS[0].w); |
70 |
| -// 1 |
71 |
| -PV1f.x = max(PV0f.w, 0.0); |
72 |
| -PV1f.y = max(PV0f.x, 0.0); |
73 |
| -PV1f.z = max(PV0f.y, 0.0); |
74 |
| -PV1f.w = max(PV0f.z, 0.0); |
75 |
| -// 2 |
76 |
| -R0f.x = min(PV1f.w, 1.0); |
77 |
| -R0f.y = min(PV1f.z, 1.0); |
78 |
| -R0f.z = min(PV1f.y, 1.0); |
79 |
| -R0f.w = min(PV1f.x, 1.0); |
80 |
| -// export |
81 |
| -passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); |
82 |
| -} |
| 1 | +#version 420 |
| 2 | +#extension GL_ARB_texture_gather : enable |
| 3 | +#extension GL_ARB_separate_shader_objects : enable |
| 4 | +#ifdef VULKAN |
| 5 | +#define ATTR_LAYOUT(__vkSet, __location) layout(set = __vkSet, location = __location) |
| 6 | +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation, std140) |
| 7 | +#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation) |
| 8 | +#define SET_POSITION(_v) gl_Position = _v; gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0 |
| 9 | +#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale.xy,gl_FragCoord.zw) |
| 10 | +#define gl_VertexID gl_VertexIndex |
| 11 | +#define gl_InstanceID gl_InstanceIndex |
| 12 | +#else |
| 13 | +#define ATTR_LAYOUT(__vkSet, __location) layout(location = __location) |
| 14 | +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) |
| 15 | +#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation) |
| 16 | +#define SET_POSITION(_v) gl_Position = _v |
| 17 | +#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw) |
| 18 | +#endif |
| 19 | +// This shader was automatically converted to be cross-compatible with Vulkan and OpenGL. |
| 20 | +
|
| 21 | +// shader 49865bd2e62efda1 |
| 22 | +//dark world bloom |
| 23 | +
|
| 24 | +const float bloom = $bloom; |
| 25 | +#ifdef VULKAN |
| 26 | +layout(set = 1, binding = 1) uniform ufBlock |
| 27 | +{ |
| 28 | +uniform ivec4 uf_remappedPS[1]; |
| 29 | +uniform vec4 uf_fragCoordScale; |
| 30 | +}; |
| 31 | +#else |
| 32 | +uniform ivec4 uf_remappedPS[1]; |
| 33 | +uniform vec2 uf_fragCoordScale; |
| 34 | +#endif |
| 35 | +TEXTURE_LAYOUT(0, 1, 0) uniform sampler2D textureUnitPS0; |
| 36 | +layout(location = 0) in vec4 passParameterSem0; |
| 37 | +layout(location = 0) out vec4 passPixelColor0; |
| 38 | +// uf_fragCoordScale was moved to the ufBlock |
| 39 | +int clampFI32(int v) |
| 40 | +{ |
| 41 | +if( v == 0x7FFFFFFF ) |
| 42 | + return floatBitsToInt(1.0); |
| 43 | +else if( v == 0xFFFFFFFF ) |
| 44 | + return floatBitsToInt(0.0); |
| 45 | +return floatBitsToInt(clamp(intBitsToFloat(v), 0.0, 1.0)); |
| 46 | +} |
| 47 | +float mul_nonIEEE(float a, float b){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; } |
| 48 | +void main() |
| 49 | +{ |
| 50 | +vec4 R0f = vec4(0.0); |
| 51 | +float backupReg0f, backupReg1f, backupReg2f, backupReg3f, backupReg4f; |
| 52 | +vec4 PV0f = vec4(0.0), PV1f = vec4(0.0); |
| 53 | +float PS0f = 0.0, PS1f = 0.0; |
| 54 | +vec4 tempf = vec4(0.0); |
| 55 | +float tempResultf; |
| 56 | +int tempResulti; |
| 57 | +ivec4 ARi = ivec4(0); |
| 58 | +bool predResult = true; |
| 59 | +vec3 cubeMapSTM; |
| 60 | +int cubeMapFaceId; |
| 61 | +R0f = passParameterSem0; |
| 62 | +R0f.xyz = (textureLod(textureUnitPS0, R0f.xy,0.0).xyz)*bloom; |
| 63 | +// 0 |
| 64 | +backupReg0f = R0f.y; |
| 65 | +backupReg1f = R0f.x; |
| 66 | +PV0f.x = mul_nonIEEE(R0f.z, intBitsToFloat(uf_remappedPS[0].z)); |
| 67 | +PV0f.y = mul_nonIEEE(backupReg0f, intBitsToFloat(uf_remappedPS[0].y)); |
| 68 | +PV0f.z = mul_nonIEEE(backupReg1f, intBitsToFloat(uf_remappedPS[0].x)); |
| 69 | +PV0f.w = intBitsToFloat(uf_remappedPS[0].w); |
| 70 | +// 1 |
| 71 | +PV1f.x = max(PV0f.w, 0.0); |
| 72 | +PV1f.y = max(PV0f.x, 0.0); |
| 73 | +PV1f.z = max(PV0f.y, 0.0); |
| 74 | +PV1f.w = max(PV0f.z, 0.0); |
| 75 | +// 2 |
| 76 | +R0f.x = min(PV1f.w, 1.0); |
| 77 | +R0f.y = min(PV1f.z, 1.0); |
| 78 | +R0f.z = min(PV1f.y, 1.0); |
| 79 | +R0f.w = min(PV1f.x, 1.0); |
| 80 | +// export |
| 81 | +passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); |
| 82 | +} |
0 commit comments