1 module shaders.blend; 2 import sg = sokol.gfx; 3 import m = handmade.math; 4 extern(C): 5 6 /* 7 #version:1# (machine generated, don't edit!) 8 9 Generated by sokol-shdc (https://github.com/floooh/sokol-tools) 10 11 Cmdline: 12 sokol-shdc -i src/examples/shaders/blend.glsl -o src/examples/shaders/blend.d -l glsl410:metal_macos:hlsl5:glsl300es:wgsl -f sokol_d 13 14 Overview: 15 ========= 16 Shader program: 'bg': 17 Get shader desc: bgShaderDesc(sg.queryBackend()); 18 Vertex Shader: vs_bg 19 Fragment Shader: fs_bg 20 Attributes: 21 ATTR_BG_POSITION => 0 22 Shader program: 'quad': 23 Get shader desc: quadShaderDesc(sg.queryBackend()); 24 Vertex Shader: vs_quad 25 Fragment Shader: fs_quad 26 Attributes: 27 ATTR_QUAD_POSITION => 0 28 ATTR_QUAD_COLOR0 => 1 29 Bindings: 30 Uniform block 'bg_fs_params': 31 D struct: BgFsParams 32 Bind slot: UB_BG_FS_PARAMS => 0 33 Uniform block 'quad_vs_params': 34 D struct: QuadVsParams 35 Bind slot: UB_QUAD_VS_PARAMS => 0 36 */ 37 enum ATTR_BG_POSITION = 0; 38 enum ATTR_QUAD_POSITION = 0; 39 enum ATTR_QUAD_COLOR0 = 1; 40 enum UB_BG_FS_PARAMS = 0; 41 enum UB_QUAD_VS_PARAMS = 0; 42 struct BgFsParams { 43 align(16) float tick = 0; 44 align(1) ubyte[12] _pad_4 = 0; 45 } 46 struct QuadVsParams { 47 align(16) m.Mat4 mvp; 48 } 49 /* 50 #version 410 51 52 layout(location = 0) in vec2 position; 53 54 void main() 55 { 56 gl_Position = vec4(position, 0.5, 1.0); 57 } 58 59 */ 60 __gshared char[116] VS_BG_SOURCE_GLSL410 = [ 61 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x6c,0x61, 62 0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, 63 0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73,0x69,0x74, 64 0x69,0x6f,0x6e,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28, 65 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, 66 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x70,0x6f,0x73,0x69,0x74, 67 0x69,0x6f,0x6e,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a, 68 0x7d,0x0a,0x0a,0x00, 69 ]; 70 /* 71 #version 410 72 73 uniform vec4 bg_fs_params[1]; 74 layout(location = 0) out vec4 frag_color; 75 76 void main() 77 { 78 vec2 _28 = fract((gl_FragCoord.xy - vec2(bg_fs_params[0].x)) * vec2(0.0199999995529651641845703125)); 79 float _39 = _28.x * _28.y; 80 frag_color = vec4(_39, _39, _39, 1.0); 81 } 82 83 */ 84 __gshared char[285] FS_BG_SOURCE_GLSL410 = [ 85 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, 86 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x62,0x67,0x5f,0x66,0x73, 87 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f, 88 0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29, 89 0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, 90 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e, 91 0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x32, 92 0x38,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x28,0x67,0x6c,0x5f,0x46,0x72, 93 0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x20,0x2d,0x20,0x76,0x65,0x63, 94 0x32,0x28,0x62,0x67,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30, 95 0x5d,0x2e,0x78,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x30, 96 0x31,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x35,0x32,0x39,0x36,0x35,0x31,0x36, 97 0x34,0x31,0x38,0x34,0x35,0x37,0x30,0x33,0x31,0x32,0x35,0x29,0x29,0x3b,0x0a,0x20, 98 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20,0x5f, 99 0x32,0x38,0x2e,0x78,0x20,0x2a,0x20,0x5f,0x32,0x38,0x2e,0x79,0x3b,0x0a,0x20,0x20, 100 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76, 101 0x65,0x63,0x34,0x28,0x5f,0x33,0x39,0x2c,0x20,0x5f,0x33,0x39,0x2c,0x20,0x5f,0x33, 102 0x39,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 103 ]; 104 /* 105 #version 410 106 107 uniform vec4 quad_vs_params[4]; 108 layout(location = 0) in vec4 position; 109 layout(location = 0) out vec4 color; 110 layout(location = 1) in vec4 color0; 111 112 void main() 113 { 114 gl_Position = mat4(quad_vs_params[0], quad_vs_params[1], quad_vs_params[2], quad_vs_params[3]) * position; 115 color = color0; 116 } 117 118 */ 119 __gshared char[309] VS_QUAD_SOURCE_GLSL410 = [ 120 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, 121 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x71,0x75,0x61,0x64,0x5f, 122 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x6c,0x61, 123 0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, 124 0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x69,0x74, 125 0x69,0x6f,0x6e,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61, 126 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65, 127 0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, 128 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69, 129 0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x0a, 130 0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20, 131 0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, 132 0x6d,0x61,0x74,0x34,0x28,0x71,0x75,0x61,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72, 133 0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x71,0x75,0x61,0x64,0x5f,0x76,0x73,0x5f, 134 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x71,0x75,0x61,0x64,0x5f, 135 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x71,0x75, 136 0x61,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29, 137 0x20,0x2a,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20, 138 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b, 139 0x0a,0x7d,0x0a,0x0a,0x00, 140 ]; 141 /* 142 #version 410 143 144 layout(location = 0) out vec4 frag_color; 145 layout(location = 0) in vec4 color; 146 147 void main() 148 { 149 frag_color = color; 150 } 151 152 */ 153 __gshared char[135] FS_QUAD_SOURCE_GLSL410 = [ 154 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x6c,0x61, 155 0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, 156 0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67, 157 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, 158 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20, 159 0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69, 160 0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, 161 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, 162 0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 163 ]; 164 /* 165 #version 300 es 166 167 layout(location = 0) in vec2 position; 168 169 void main() 170 { 171 gl_Position = vec4(position, 0.5, 1.0); 172 } 173 174 */ 175 __gshared char[119] VS_BG_SOURCE_GLSL300ES = [ 176 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, 177 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, 178 0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f, 179 0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61, 180 0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f, 181 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x70,0x6f, 182 0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30, 183 0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 184 ]; 185 /* 186 #version 300 es 187 precision mediump float; 188 precision highp int; 189 190 uniform highp vec4 bg_fs_params[1]; 191 layout(location = 0) out highp vec4 frag_color; 192 193 void main() 194 { 195 highp vec2 _28 = fract((gl_FragCoord.xy - vec2(bg_fs_params[0].x)) * vec2(0.0199999995529651641845703125)); 196 highp float _39 = _28.x * _28.y; 197 frag_color = vec4(_39, _39, _39, 1.0); 198 } 199 200 */ 201 __gshared char[358] FS_BG_SOURCE_GLSL300ES = [ 202 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, 203 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, 204 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, 205 0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75, 206 0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, 207 0x34,0x20,0x62,0x67,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31, 208 0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69, 209 0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x68,0x69,0x67,0x68, 210 0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, 211 0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, 212 0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32, 213 0x20,0x5f,0x32,0x38,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x28,0x67,0x6c, 214 0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x20,0x2d,0x20, 215 0x76,0x65,0x63,0x32,0x28,0x62,0x67,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, 216 0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x32,0x28, 217 0x30,0x2e,0x30,0x31,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x35,0x32,0x39,0x36, 218 0x35,0x31,0x36,0x34,0x31,0x38,0x34,0x35,0x37,0x30,0x33,0x31,0x32,0x35,0x29,0x29, 219 0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61, 220 0x74,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20,0x5f,0x32,0x38,0x2e,0x78,0x20,0x2a,0x20, 221 0x5f,0x32,0x38,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, 222 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x33,0x39, 223 0x2c,0x20,0x5f,0x33,0x39,0x2c,0x20,0x5f,0x33,0x39,0x2c,0x20,0x31,0x2e,0x30,0x29, 224 0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 225 ]; 226 /* 227 #version 300 es 228 229 uniform vec4 quad_vs_params[4]; 230 layout(location = 0) in vec4 position; 231 out vec4 color; 232 layout(location = 1) in vec4 color0; 233 234 void main() 235 { 236 gl_Position = mat4(quad_vs_params[0], quad_vs_params[1], quad_vs_params[2], quad_vs_params[3]) * position; 237 color = color0; 238 } 239 240 */ 241 __gshared char[291] VS_QUAD_SOURCE_GLSL300ES = [ 242 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, 243 0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x71,0x75, 244 0x61,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b, 245 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, 246 0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f, 247 0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34, 248 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, 249 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20, 250 0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x0a,0x76,0x6f, 251 0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, 252 0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61, 253 0x74,0x34,0x28,0x71,0x75,0x61,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, 254 0x73,0x5b,0x30,0x5d,0x2c,0x20,0x71,0x75,0x61,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61, 255 0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x71,0x75,0x61,0x64,0x5f,0x76,0x73, 256 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x71,0x75,0x61,0x64, 257 0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a, 258 0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63, 259 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x7d, 260 0x0a,0x0a,0x00, 261 ]; 262 /* 263 #version 300 es 264 precision mediump float; 265 precision highp int; 266 267 layout(location = 0) out highp vec4 frag_color; 268 in highp vec4 color; 269 270 void main() 271 { 272 frag_color = color; 273 } 274 275 */ 276 __gshared char[175] FS_QUAD_SOURCE_GLSL300ES = [ 277 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, 278 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, 279 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, 280 0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x6c, 281 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, 282 0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, 283 0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x69, 284 0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c, 285 0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29, 286 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, 287 0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 288 ]; 289 /* 290 static float4 gl_Position; 291 static float2 position; 292 293 struct SPIRV_Cross_Input 294 { 295 float2 position : TEXCOORD0; 296 }; 297 298 struct SPIRV_Cross_Output 299 { 300 float4 gl_Position : SV_Position; 301 }; 302 303 void vert_main() 304 { 305 gl_Position = float4(position, 0.5f, 1.0f); 306 } 307 308 SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) 309 { 310 position = stage_input.position; 311 vert_main(); 312 SPIRV_Cross_Output stage_output; 313 stage_output.gl_Position = gl_Position; 314 return stage_output; 315 } 316 */ 317 __gshared char[476] VS_BG_SOURCE_HLSL5 = [ 318 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c, 319 0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69, 320 0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, 321 0x6e,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56, 322 0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20, 323 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x69,0x74,0x69, 324 0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a, 325 0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56, 326 0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a, 327 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f, 328 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69, 329 0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x76, 330 0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, 331 0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x66, 332 0x6c,0x6f,0x61,0x74,0x34,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20, 333 0x30,0x2e,0x35,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, 334 0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70, 335 0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72, 336 0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, 337 0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x70,0x6f,0x73, 338 0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e, 339 0x70,0x75,0x74,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20, 340 0x20,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20, 341 0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f, 342 0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70, 343 0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75, 344 0x74,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, 345 0x20,0x3d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a, 346 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65, 347 0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, 348 ]; 349 /* 350 cbuffer bg_fs_params : register(b0) 351 { 352 float _17_tick : packoffset(c0); 353 }; 354 355 356 static float4 gl_FragCoord; 357 static float4 frag_color; 358 359 struct SPIRV_Cross_Input 360 { 361 float4 gl_FragCoord : SV_Position; 362 }; 363 364 struct SPIRV_Cross_Output 365 { 366 float4 frag_color : SV_Target0; 367 }; 368 369 void frag_main() 370 { 371 float2 _28 = frac((gl_FragCoord.xy - _17_tick.xx) * 0.0199999995529651641845703125f.xx); 372 float _39 = _28.x * _28.y; 373 frag_color = float4(_39, _39, _39, 1.0f); 374 } 375 376 SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) 377 { 378 gl_FragCoord = stage_input.gl_FragCoord; 379 gl_FragCoord.w = 1.0 / gl_FragCoord.w; 380 frag_main(); 381 SPIRV_Cross_Output stage_output; 382 stage_output.frag_color = frag_color; 383 return stage_output; 384 } 385 */ 386 __gshared char[734] FS_BG_SOURCE_HLSL5 = [ 387 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x62,0x67,0x5f,0x66,0x73,0x5f,0x70,0x61, 388 0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28, 389 0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, 390 0x5f,0x31,0x37,0x5f,0x74,0x69,0x63,0x6b,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f, 391 0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x0a, 392 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c, 393 0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x73,0x74,0x61,0x74, 394 0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, 395 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50, 396 0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a, 397 0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f, 398 0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50, 399 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72, 400 0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f, 401 0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, 402 0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a, 403 0x20,0x53,0x56,0x5f,0x54,0x61,0x72,0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d,0x3b,0x0a, 404 0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28, 405 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f, 406 0x32,0x38,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x28,0x28,0x67,0x6c,0x5f,0x46,0x72, 407 0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x20,0x2d,0x20,0x5f,0x31,0x37, 408 0x5f,0x74,0x69,0x63,0x6b,0x2e,0x78,0x78,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x31, 409 0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x35,0x32,0x39,0x36,0x35,0x31,0x36,0x34, 410 0x31,0x38,0x34,0x35,0x37,0x30,0x33,0x31,0x32,0x35,0x66,0x2e,0x78,0x78,0x29,0x3b, 411 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x20,0x3d, 412 0x20,0x5f,0x32,0x38,0x2e,0x78,0x20,0x2a,0x20,0x5f,0x32,0x38,0x2e,0x79,0x3b,0x0a, 413 0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, 414 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x33,0x39,0x2c,0x20,0x5f,0x33,0x39, 415 0x2c,0x20,0x5f,0x33,0x39,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x7d,0x0a, 416 0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74, 417 0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43, 418 0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65, 419 0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c, 420 0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x73,0x74,0x61, 421 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67, 422 0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x46,0x72, 423 0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x77,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20, 424 0x2f,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x77, 425 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28, 426 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f, 427 0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, 428 0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67, 429 0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, 430 0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 431 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61, 432 0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, 433 ]; 434 /* 435 cbuffer quad_vs_params : register(b0) 436 { 437 row_major float4x4 _19_mvp : packoffset(c0); 438 }; 439 440 441 static float4 gl_Position; 442 static float4 position; 443 static float4 color; 444 static float4 color0; 445 446 struct SPIRV_Cross_Input 447 { 448 float4 position : TEXCOORD0; 449 float4 color0 : TEXCOORD1; 450 }; 451 452 struct SPIRV_Cross_Output 453 { 454 float4 color : TEXCOORD0; 455 float4 gl_Position : SV_Position; 456 }; 457 458 void vert_main() 459 { 460 gl_Position = mul(position, _19_mvp); 461 color = color0; 462 } 463 464 SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) 465 { 466 position = stage_input.position; 467 color0 = stage_input.color0; 468 vert_main(); 469 SPIRV_Cross_Output stage_output; 470 stage_output.gl_Position = gl_Position; 471 stage_output.color = color; 472 return stage_output; 473 } 474 */ 475 __gshared char[753] VS_QUAD_SOURCE_HLSL5 = [ 476 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x71,0x75,0x61,0x64,0x5f,0x76,0x73,0x5f, 477 0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65, 478 0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f, 479 0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f, 480 0x31,0x39,0x5f,0x6d,0x76,0x70,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66, 481 0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x0a,0x73,0x74, 482 0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50, 483 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, 484 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b, 485 0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63, 486 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f, 487 0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x0a,0x73,0x74,0x72, 488 0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f, 489 0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, 490 0x74,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45, 491 0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, 492 0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3a,0x20,0x54,0x45,0x58, 493 0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75, 494 0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f, 495 0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, 496 0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f, 497 0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, 498 0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53, 499 0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a, 500 0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29, 501 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, 502 0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, 503 0x6e,0x2c,0x20,0x5f,0x31,0x39,0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,0x20,0x20,0x20, 504 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b, 505 0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f, 506 0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52, 507 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74, 508 0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, 509 0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x73,0x74,0x61,0x67, 510 0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, 511 0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3d,0x20,0x73, 512 0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72, 513 0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e, 514 0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72, 515 0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65, 516 0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61, 517 0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73, 518 0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, 519 0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f, 520 0x75,0x74,0x70,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f, 521 0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, 522 0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a, 523 0x00, 524 ]; 525 /* 526 static float4 frag_color; 527 static float4 color; 528 529 struct SPIRV_Cross_Input 530 { 531 float4 color : TEXCOORD0; 532 }; 533 534 struct SPIRV_Cross_Output 535 { 536 float4 frag_color : SV_Target0; 537 }; 538 539 void frag_main() 540 { 541 frag_color = color; 542 } 543 544 SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) 545 { 546 color = stage_input.color; 547 frag_main(); 548 SPIRV_Cross_Output stage_output; 549 stage_output.frag_color = frag_color; 550 return stage_output; 551 } 552 */ 553 __gshared char[435] FS_QUAD_SOURCE_HLSL5 = [ 554 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72, 555 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, 556 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a, 557 0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f, 558 0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, 559 0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45, 560 0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72, 561 0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f, 562 0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, 563 0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a, 564 0x20,0x53,0x56,0x5f,0x54,0x61,0x72,0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d,0x3b,0x0a, 565 0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28, 566 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, 567 0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x53, 568 0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75, 569 0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f, 570 0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, 571 0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f, 572 0x72,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e, 573 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, 574 0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52, 575 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73, 576 0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20, 577 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72, 578 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f, 579 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, 580 0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a, 581 0x7d,0x0a,0x00, 582 ]; 583 /* 584 #include <metal_stdlib> 585 #include <simd/simd.h> 586 587 using namespace metal; 588 589 struct main0_out 590 { 591 float4 gl_Position [[position]]; 592 }; 593 594 struct main0_in 595 { 596 float2 position [[attribute(0)]]; 597 }; 598 599 vertex main0_out main0(main0_in in [[stage_in]]) 600 { 601 main0_out out = {}; 602 out.gl_Position = float4(in.position, 0.5, 1.0); 603 return out; 604 } 605 606 */ 607 __gshared char[340] VS_BG_SOURCE_METAL_MACOS = [ 608 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 609 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 610 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, 611 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, 612 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d, 613 0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, 614 0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, 615 0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a, 616 0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30, 617 0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, 618 0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72, 619 0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a, 620 0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74, 621 0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20, 622 0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x29, 623 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74, 624 0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f, 625 0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d, 626 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74, 627 0x69,0x6f,0x6e,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a, 628 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, 629 0x7d,0x0a,0x0a,0x00, 630 ]; 631 /* 632 #include <metal_stdlib> 633 #include <simd/simd.h> 634 635 using namespace metal; 636 637 struct bg_fs_params 638 { 639 float tick; 640 }; 641 642 struct main0_out 643 { 644 float4 frag_color [[color(0)]]; 645 }; 646 647 fragment main0_out main0(constant bg_fs_params& _17 [[buffer(0)]], float4 gl_FragCoord [[position]]) 648 { 649 main0_out out = {}; 650 float2 _28 = fract((gl_FragCoord.xy - float2(_17.tick)) * float2(0.0199999995529651641845703125)); 651 float _39 = _28.x * _28.y; 652 out.frag_color = float4(_39, _39, _39, 1.0); 653 return out; 654 } 655 656 */ 657 __gshared char[503] FS_BG_SOURCE_METAL_MACOS = [ 658 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 659 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 660 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, 661 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, 662 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x62, 663 0x67,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20, 664 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x74,0x69,0x63,0x6b,0x3b,0x0a,0x7d,0x3b, 665 0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f, 666 0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, 667 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c, 668 0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x66,0x72,0x61, 669 0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20, 670 0x6d,0x61,0x69,0x6e,0x30,0x28,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x62, 671 0x67,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x37, 672 0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20, 673 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f, 674 0x6f,0x72,0x64,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d, 675 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75, 676 0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20, 677 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x32,0x38,0x20,0x3d,0x20,0x66,0x72,0x61, 678 0x63,0x74,0x28,0x28,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64, 679 0x2e,0x78,0x79,0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x5f,0x31,0x37, 680 0x2e,0x74,0x69,0x63,0x6b,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, 681 0x28,0x30,0x2e,0x30,0x31,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x35,0x32,0x39, 682 0x36,0x35,0x31,0x36,0x34,0x31,0x38,0x34,0x35,0x37,0x30,0x33,0x31,0x32,0x35,0x29, 683 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39, 684 0x20,0x3d,0x20,0x5f,0x32,0x38,0x2e,0x78,0x20,0x2a,0x20,0x5f,0x32,0x38,0x2e,0x79, 685 0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63, 686 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x33, 687 0x39,0x2c,0x20,0x5f,0x33,0x39,0x2c,0x20,0x5f,0x33,0x39,0x2c,0x20,0x31,0x2e,0x30, 688 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75, 689 0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 690 ]; 691 /* 692 #include <metal_stdlib> 693 #include <simd/simd.h> 694 695 using namespace metal; 696 697 struct quad_vs_params 698 { 699 float4x4 mvp; 700 }; 701 702 struct main0_out 703 { 704 float4 color [[user(locn0)]]; 705 float4 gl_Position [[position]]; 706 }; 707 708 struct main0_in 709 { 710 float4 position [[attribute(0)]]; 711 float4 color0 [[attribute(1)]]; 712 }; 713 714 vertex main0_out main0(main0_in in [[stage_in]], constant quad_vs_params& _19 [[buffer(0)]]) 715 { 716 main0_out out = {}; 717 out.gl_Position = _19.mvp * in.position; 718 out.color = in.color0; 719 return out; 720 } 721 722 */ 723 __gshared char[519] VS_QUAD_SOURCE_METAL_MACOS = [ 724 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 725 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 726 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, 727 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, 728 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x71, 729 0x75,0x61,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a, 730 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x6d,0x76,0x70, 731 0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69, 732 0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, 733 0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72, 734 0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, 735 0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, 736 0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a, 737 0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30, 738 0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, 739 0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72, 740 0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, 741 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x5b,0x5b, 742 0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b,0x0a, 743 0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30, 744 0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30, 745 0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, 746 0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x71,0x75, 747 0x61,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31, 748 0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29, 749 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74, 750 0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f, 751 0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d, 752 0x20,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x70,0x6f, 753 0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e, 754 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72, 755 0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75, 756 0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 757 ]; 758 /* 759 #include <metal_stdlib> 760 #include <simd/simd.h> 761 762 using namespace metal; 763 764 struct main0_out 765 { 766 float4 frag_color [[color(0)]]; 767 }; 768 769 struct main0_in 770 { 771 float4 color [[user(locn0)]]; 772 }; 773 774 fragment main0_out main0(main0_in in [[stage_in]]) 775 { 776 main0_out out = {}; 777 out.frag_color = in.color; 778 return out; 779 } 780 781 */ 782 __gshared char[315] FS_QUAD_SOURCE_METAL_MACOS = [ 783 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 784 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 785 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, 786 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, 787 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d, 788 0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, 789 0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 790 0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d, 791 0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f, 792 0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, 793 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63, 794 0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d, 795 0x65,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61, 796 0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20, 797 0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x29,0x0a,0x7b,0x0a, 798 0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75, 799 0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e, 800 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x69,0x6e,0x2e, 801 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, 802 0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 803 ]; 804 /* 805 diagnostic(off, derivative_uniformity); 806 807 var<private> position_1 : vec2f; 808 809 var<private> gl_Position : vec4f; 810 811 fn main_1() { 812 let x_19 : vec2f = position_1; 813 gl_Position = vec4f(x_19.x, x_19.y, 0.5f, 1.0f); 814 return; 815 } 816 817 struct main_out { 818 @builtin(position) 819 gl_Position : vec4f, 820 } 821 822 @vertex 823 fn main(@location(0) position_1_param : vec2f) -> main_out { 824 position_1 = position_1_param; 825 main_1(); 826 return main_out(gl_Position); 827 } 828 829 */ 830 __gshared char[436] VS_BG_SOURCE_WGSL = [ 831 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, 832 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, 833 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69, 834 0x76,0x61,0x74,0x65,0x3e,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31, 835 0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70, 836 0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, 837 0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e, 838 0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x6c,0x65, 839 0x74,0x20,0x78,0x5f,0x31,0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d, 840 0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x3b,0x0a,0x20,0x20,0x67, 841 0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63, 842 0x34,0x66,0x28,0x78,0x5f,0x31,0x39,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x39,0x2e, 843 0x79,0x2c,0x20,0x30,0x2e,0x35,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a, 844 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72, 845 0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20, 846 0x20,0x40,0x62,0x75,0x69,0x6c,0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,0x74,0x69, 847 0x6f,0x6e,0x29,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, 848 0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x76, 849 0x65,0x72,0x74,0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c, 850 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x70,0x6f,0x73,0x69,0x74, 851 0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65, 852 0x63,0x32,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74, 853 0x20,0x7b,0x0a,0x20,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x20, 854 0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72, 855 0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a, 856 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75, 857 0x74,0x28,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a, 858 0x7d,0x0a,0x0a,0x00, 859 ]; 860 /* 861 diagnostic(off, derivative_uniformity); 862 863 struct bg_fs_params { 864 /_ @offset(0) _/ 865 tick : f32, 866 } 867 868 var<private> gl_FragCoord : vec4f; 869 870 @group(0) @binding(8) var<uniform> x_17 : bg_fs_params; 871 872 var<private> frag_color : vec4f; 873 874 fn main_1() { 875 var xy : vec2f; 876 let x_13 : vec4f = gl_FragCoord; 877 let x_22 : f32 = x_17.tick; 878 xy = fract(((vec2f(x_13.x, x_13.y) - vec2f(x_22, x_22)) / vec2f(50.0f, 50.0f))); 879 let x_35 : f32 = xy.x; 880 let x_38 : f32 = xy.y; 881 let x_39 : f32 = (x_35 * x_38); 882 let x_41 : vec3f = vec3f(x_39, x_39, x_39); 883 frag_color = vec4f(x_41.x, x_41.y, x_41.z, 1.0f); 884 return; 885 } 886 887 struct main_out { 888 @location(0) 889 frag_color_1 : vec4f, 890 } 891 892 @fragment 893 fn main(@builtin(position) gl_FragCoord_param : vec4f) -> main_out { 894 gl_FragCoord = gl_FragCoord_param; 895 main_1(); 896 return main_out(frag_color); 897 } 898 899 */ 900 __gshared char[824] FS_BG_SOURCE_WGSL = [ 901 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, 902 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, 903 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, 904 0x62,0x67,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x7b,0x0a,0x20, 905 0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a, 906 0x2f,0x0a,0x20,0x20,0x74,0x69,0x63,0x6b,0x20,0x3a,0x20,0x66,0x33,0x32,0x2c,0x0a, 907 0x7d,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20, 908 0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x76, 909 0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29, 910 0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x38,0x29,0x20,0x76,0x61,0x72, 911 0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x31,0x37,0x20,0x3a, 912 0x20,0x62,0x67,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a, 913 0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x72,0x61, 914 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b, 915 0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a, 916 0x20,0x20,0x76,0x61,0x72,0x20,0x78,0x79,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66, 917 0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x33,0x20,0x3a,0x20,0x76, 918 0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f, 919 0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x20, 920 0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x31,0x37,0x2e,0x74,0x69,0x63, 921 0x6b,0x3b,0x0a,0x20,0x20,0x78,0x79,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28, 922 0x28,0x28,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x31,0x33,0x2e,0x78,0x2c,0x20, 923 0x78,0x5f,0x31,0x33,0x2e,0x79,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x66,0x28, 924 0x78,0x5f,0x32,0x32,0x2c,0x20,0x78,0x5f,0x32,0x32,0x29,0x29,0x20,0x2f,0x20,0x76, 925 0x65,0x63,0x32,0x66,0x28,0x35,0x30,0x2e,0x30,0x66,0x2c,0x20,0x35,0x30,0x2e,0x30, 926 0x66,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x35, 927 0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x79,0x2e,0x78,0x3b,0x0a,0x20, 928 0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x38,0x20,0x3a,0x20,0x66,0x33,0x32,0x20, 929 0x3d,0x20,0x78,0x79,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, 930 0x33,0x39,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x28,0x78,0x5f,0x33,0x35, 931 0x20,0x2a,0x20,0x78,0x5f,0x33,0x38,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20, 932 0x78,0x5f,0x34,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76, 933 0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x33,0x39,0x2c,0x20,0x78,0x5f,0x33,0x39,0x2c, 934 0x20,0x78,0x5f,0x33,0x39,0x29,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, 935 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x34, 936 0x31,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x34,0x31,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x34, 937 0x31,0x2e,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65, 938 0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, 939 0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f, 940 0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67, 941 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66, 942 0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66, 943 0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x62,0x75,0x69,0x6c,0x74,0x69,0x6e,0x28, 944 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61, 945 0x67,0x43,0x6f,0x6f,0x72,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76, 946 0x65,0x63,0x34,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75, 947 0x74,0x20,0x7b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f, 948 0x72,0x64,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72, 949 0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f, 950 0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61, 951 0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, 952 0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 953 ]; 954 /* 955 diagnostic(off, derivative_uniformity); 956 957 struct quad_vs_params { 958 /_ @offset(0) _/ 959 mvp : mat4x4f, 960 } 961 962 @group(0) @binding(0) var<uniform> x_19 : quad_vs_params; 963 964 var<private> position_1 : vec4f; 965 966 var<private> color : vec4f; 967 968 var<private> color0 : vec4f; 969 970 var<private> gl_Position : vec4f; 971 972 fn main_1() { 973 let x_22 : mat4x4f = x_19.mvp; 974 let x_25 : vec4f = position_1; 975 gl_Position = (x_22 * x_25); 976 let x_31 : vec4f = color0; 977 color = x_31; 978 return; 979 } 980 981 struct main_out { 982 @builtin(position) 983 gl_Position : vec4f, 984 @location(0) 985 color_1 : vec4f, 986 } 987 988 @vertex 989 fn main(@location(0) position_1_param : vec4f, @location(1) color0_param : vec4f) -> main_out { 990 position_1 = position_1_param; 991 color0 = color0_param; 992 main_1(); 993 return main_out(gl_Position, color); 994 } 995 996 */ 997 __gshared char[776] VS_QUAD_SOURCE_WGSL = [ 998 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, 999 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, 1000 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, 1001 0x71,0x75,0x61,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x7b, 1002 0x0a,0x20,0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29, 1003 0x20,0x2a,0x2f,0x0a,0x20,0x20,0x6d,0x76,0x70,0x20,0x3a,0x20,0x6d,0x61,0x74,0x34, 1004 0x78,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30, 1005 0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x30,0x29,0x20,0x76,0x61, 1006 0x72,0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x31,0x39,0x20, 1007 0x3a,0x20,0x71,0x75,0x61,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, 1008 0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20, 1009 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63, 1010 0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65, 1011 0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b, 1012 0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x63, 1013 0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a, 1014 0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x67,0x6c,0x5f, 1015 0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66, 1016 0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b, 1017 0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x20,0x3a,0x20,0x6d,0x61, 1018 0x74,0x34,0x78,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,0x2e,0x6d,0x76,0x70, 1019 0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x35,0x20,0x3a,0x20,0x76, 1020 0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f, 1021 0x31,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, 1022 0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x32,0x20,0x2a,0x20,0x78,0x5f,0x32,0x35,0x29, 1023 0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x31,0x20,0x3a,0x20,0x76, 1024 0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20, 1025 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x78,0x5f,0x33,0x31,0x3b,0x0a,0x20, 1026 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75, 1027 0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20, 1028 0x40,0x62,0x75,0x69,0x6c,0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, 1029 0x6e,0x29,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, 1030 0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63, 1031 0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72, 1032 0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40, 1033 0x76,0x65,0x72,0x74,0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40, 1034 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x70,0x6f,0x73,0x69, 1035 0x74,0x69,0x6f,0x6e,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76, 1036 0x65,0x63,0x34,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28, 1037 0x31,0x29,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20, 1038 0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e, 1039 0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, 1040 0x6e,0x5f,0x31,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x31, 1041 0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30, 1042 0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b, 1043 0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72, 1044 0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x67, 1045 0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x63,0x6f,0x6c,0x6f, 1046 0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 1047 ]; 1048 /* 1049 diagnostic(off, derivative_uniformity); 1050 1051 var<private> frag_color : vec4f; 1052 1053 var<private> color : vec4f; 1054 1055 fn main_1() { 1056 let x_12 : vec4f = color; 1057 frag_color = x_12; 1058 return; 1059 } 1060 1061 struct main_out { 1062 @location(0) 1063 frag_color_1 : vec4f, 1064 } 1065 1066 @fragment 1067 fn main(@location(0) color_param : vec4f) -> main_out { 1068 color = color_param; 1069 main_1(); 1070 return main_out(frag_color); 1071 } 1072 1073 */ 1074 __gshared char[376] FS_QUAD_SOURCE_WGSL = [ 1075 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, 1076 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, 1077 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69, 1078 0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 1079 0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70, 1080 0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20, 1081 0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f, 1082 0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x32, 1083 0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72, 1084 0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, 1085 0x20,0x78,0x5f,0x31,0x32,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b, 1086 0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f, 1087 0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f, 1088 0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, 1089 0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a, 1090 0x40,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69, 1091 0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x63, 1092 0x6f,0x6c,0x6f,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63, 1093 0x34,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20, 1094 0x7b,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, 1095 0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f, 1096 0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61, 1097 0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, 1098 0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 1099 ]; 1100 sg.ShaderDesc bgShaderDesc(sg.Backend backend) @trusted @nogc nothrow { 1101 sg.ShaderDesc desc; 1102 desc.label = "bg_shader"; 1103 switch (backend) { 1104 case sg.Backend.Glcore: 1105 desc.vertex_func.source = &VS_BG_SOURCE_GLSL410[0]; 1106 desc.vertex_func.entry = "main"; 1107 desc.fragment_func.source = &FS_BG_SOURCE_GLSL410[0]; 1108 desc.fragment_func.entry = "main"; 1109 desc.attrs[0].glsl_name = "position"; 1110 desc.uniform_blocks[0].stage = sg.ShaderStage.Fragment; 1111 desc.uniform_blocks[0].layout = sg.UniformLayout.Std140; 1112 desc.uniform_blocks[0].size = 16; 1113 desc.uniform_blocks[0].glsl_uniforms[0].type = sg.UniformType.Float4; 1114 desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; 1115 desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "bg_fs_params"; 1116 break; 1117 case sg.Backend.Gles3: 1118 desc.vertex_func.source = &VS_BG_SOURCE_GLSL300ES[0]; 1119 desc.vertex_func.entry = "main"; 1120 desc.fragment_func.source = &FS_BG_SOURCE_GLSL300ES[0]; 1121 desc.fragment_func.entry = "main"; 1122 desc.attrs[0].glsl_name = "position"; 1123 desc.uniform_blocks[0].stage = sg.ShaderStage.Fragment; 1124 desc.uniform_blocks[0].layout = sg.UniformLayout.Std140; 1125 desc.uniform_blocks[0].size = 16; 1126 desc.uniform_blocks[0].glsl_uniforms[0].type = sg.UniformType.Float4; 1127 desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; 1128 desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "bg_fs_params"; 1129 break; 1130 case sg.Backend.D3d11: 1131 desc.vertex_func.source = &VS_BG_SOURCE_HLSL5[0]; 1132 desc.vertex_func.d3d11_target = "vs_5_0"; 1133 desc.vertex_func.entry = "main"; 1134 desc.fragment_func.source = &FS_BG_SOURCE_HLSL5[0]; 1135 desc.fragment_func.d3d11_target = "ps_5_0"; 1136 desc.fragment_func.entry = "main"; 1137 desc.attrs[0].hlsl_sem_name = "TEXCOORD"; 1138 desc.attrs[0].hlsl_sem_index = 0; 1139 desc.uniform_blocks[0].stage = sg.ShaderStage.Fragment; 1140 desc.uniform_blocks[0].layout = sg.UniformLayout.Std140; 1141 desc.uniform_blocks[0].size = 16; 1142 desc.uniform_blocks[0].hlsl_register_b_n = 0; 1143 break; 1144 case sg.Backend.Metal_macos: 1145 desc.vertex_func.source = &VS_BG_SOURCE_METAL_MACOS[0]; 1146 desc.vertex_func.entry = "main0"; 1147 desc.fragment_func.source = &FS_BG_SOURCE_METAL_MACOS[0]; 1148 desc.fragment_func.entry = "main0"; 1149 desc.uniform_blocks[0].stage = sg.ShaderStage.Fragment; 1150 desc.uniform_blocks[0].layout = sg.UniformLayout.Std140; 1151 desc.uniform_blocks[0].size = 16; 1152 desc.uniform_blocks[0].msl_buffer_n = 0; 1153 break; 1154 case sg.Backend.Wgpu: 1155 desc.vertex_func.source = &VS_BG_SOURCE_WGSL[0]; 1156 desc.vertex_func.entry = "main"; 1157 desc.fragment_func.source = &FS_BG_SOURCE_WGSL[0]; 1158 desc.fragment_func.entry = "main"; 1159 desc.uniform_blocks[0].stage = sg.ShaderStage.Fragment; 1160 desc.uniform_blocks[0].layout = sg.UniformLayout.Std140; 1161 desc.uniform_blocks[0].size = 16; 1162 desc.uniform_blocks[0].wgsl_group0_binding_n = 8; 1163 break; 1164 default: break; 1165 } 1166 return desc; 1167 } 1168 sg.ShaderDesc quadShaderDesc(sg.Backend backend) @trusted @nogc nothrow { 1169 sg.ShaderDesc desc; 1170 desc.label = "quad_shader"; 1171 switch (backend) { 1172 case sg.Backend.Glcore: 1173 desc.vertex_func.source = &VS_QUAD_SOURCE_GLSL410[0]; 1174 desc.vertex_func.entry = "main"; 1175 desc.fragment_func.source = &FS_QUAD_SOURCE_GLSL410[0]; 1176 desc.fragment_func.entry = "main"; 1177 desc.attrs[0].glsl_name = "position"; 1178 desc.attrs[1].glsl_name = "color0"; 1179 desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex; 1180 desc.uniform_blocks[0].layout = sg.UniformLayout.Std140; 1181 desc.uniform_blocks[0].size = 64; 1182 desc.uniform_blocks[0].glsl_uniforms[0].type = sg.UniformType.Float4; 1183 desc.uniform_blocks[0].glsl_uniforms[0].array_count = 4; 1184 desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "quad_vs_params"; 1185 break; 1186 case sg.Backend.Gles3: 1187 desc.vertex_func.source = &VS_QUAD_SOURCE_GLSL300ES[0]; 1188 desc.vertex_func.entry = "main"; 1189 desc.fragment_func.source = &FS_QUAD_SOURCE_GLSL300ES[0]; 1190 desc.fragment_func.entry = "main"; 1191 desc.attrs[0].glsl_name = "position"; 1192 desc.attrs[1].glsl_name = "color0"; 1193 desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex; 1194 desc.uniform_blocks[0].layout = sg.UniformLayout.Std140; 1195 desc.uniform_blocks[0].size = 64; 1196 desc.uniform_blocks[0].glsl_uniforms[0].type = sg.UniformType.Float4; 1197 desc.uniform_blocks[0].glsl_uniforms[0].array_count = 4; 1198 desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "quad_vs_params"; 1199 break; 1200 case sg.Backend.D3d11: 1201 desc.vertex_func.source = &VS_QUAD_SOURCE_HLSL5[0]; 1202 desc.vertex_func.d3d11_target = "vs_5_0"; 1203 desc.vertex_func.entry = "main"; 1204 desc.fragment_func.source = &FS_QUAD_SOURCE_HLSL5[0]; 1205 desc.fragment_func.d3d11_target = "ps_5_0"; 1206 desc.fragment_func.entry = "main"; 1207 desc.attrs[0].hlsl_sem_name = "TEXCOORD"; 1208 desc.attrs[0].hlsl_sem_index = 0; 1209 desc.attrs[1].hlsl_sem_name = "TEXCOORD"; 1210 desc.attrs[1].hlsl_sem_index = 1; 1211 desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex; 1212 desc.uniform_blocks[0].layout = sg.UniformLayout.Std140; 1213 desc.uniform_blocks[0].size = 64; 1214 desc.uniform_blocks[0].hlsl_register_b_n = 0; 1215 break; 1216 case sg.Backend.Metal_macos: 1217 desc.vertex_func.source = &VS_QUAD_SOURCE_METAL_MACOS[0]; 1218 desc.vertex_func.entry = "main0"; 1219 desc.fragment_func.source = &FS_QUAD_SOURCE_METAL_MACOS[0]; 1220 desc.fragment_func.entry = "main0"; 1221 desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex; 1222 desc.uniform_blocks[0].layout = sg.UniformLayout.Std140; 1223 desc.uniform_blocks[0].size = 64; 1224 desc.uniform_blocks[0].msl_buffer_n = 0; 1225 break; 1226 case sg.Backend.Wgpu: 1227 desc.vertex_func.source = &VS_QUAD_SOURCE_WGSL[0]; 1228 desc.vertex_func.entry = "main"; 1229 desc.fragment_func.source = &FS_QUAD_SOURCE_WGSL[0]; 1230 desc.fragment_func.entry = "main"; 1231 desc.uniform_blocks[0].stage = sg.ShaderStage.Vertex; 1232 desc.uniform_blocks[0].layout = sg.UniformLayout.Std140; 1233 desc.uniform_blocks[0].size = 64; 1234 desc.uniform_blocks[0].wgsl_group0_binding_n = 0; 1235 break; 1236 default: break; 1237 } 1238 return desc; 1239 }