Tess Renderer: compute gradient F in vertex shader. Compute gradient F in vertex shader as discussed on Slack with @csmartdalton Diffs= d4d6067a3 Fix radial gradient interpolation 14026d5dc Compute gradient F in vertex shader.
diff --git a/.rive_head b/.rive_head index 900be39..eba037c 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -19578d2097615090bbda3f214549bc41bbc391f9 +d4d6067a3b7f5c0dd7bb33286f8c49cf7c15159c
diff --git a/tess/src/sokol/generated/shader.h b/tess/src/sokol/generated/shader.h index 18d0f0c..0e8d740 100644 --- a/tess/src/sokol/generated/shader.h +++ b/tess/src/sokol/generated/shader.h
@@ -78,6 +78,9 @@ vs_path_params_t vs_path_params = { .mvp = ...; + .fillType = ...; + .gradientStart = ...; + .gradientEnd = ...; }; sg_apply_uniforms(SG_SHADERSTAGE_[VS|FS], SLOT_vs_path_params, &SG_RANGE(vs_path_params)); @@ -87,8 +90,6 @@ .fillType = ...; .colors = ...; .stops = ...; - .gradientStart = ...; - .gradientEnd = ...; .stopCount = ...; }; sg_apply_uniforms(SG_SHADERSTAGE_[VS|FS], SLOT_fs_path_uniforms, &SG_RANGE(fs_path_uniforms)); @@ -119,6 +120,11 @@ #pragma pack(push,1) SOKOL_SHDC_ALIGN(16) typedef struct vs_path_params_t { rive::Mat4 mvp; + int fillType; + uint8_t _pad_68[4]; + rive::Vec2D gradientStart; + rive::Vec2D gradientEnd; + uint8_t _pad_88[8]; } vs_path_params_t; #pragma pack(pop) #define SLOT_fs_path_uniforms (0) @@ -128,10 +134,8 @@ uint8_t _pad_4[12]; float colors[16][4]; float stops[4][4]; - rive::Vec2D gradientStart; - rive::Vec2D gradientEnd; int stopCount; - uint8_t _pad_356[12]; + uint8_t _pad_340[12]; } fs_path_uniforms_t; #pragma pack(pop) /* @@ -199,35 +203,85 @@ /* #version 330 - uniform vec4 vs_path_params[4]; - out vec2 pos; + struct vs_path_params + { + mat4 mvp; + int fillType; + vec2 gradientStart; + vec2 gradientEnd; + }; + + uniform vs_path_params _22; + layout(location = 0) in vec2 position; + out vec2 gradient_uv; void main() { - pos = position; - gl_Position = mat4(vs_path_params[0], vs_path_params[1], vs_path_params[2], vs_path_params[3]) * vec4(position, 0.0, 1.0); + gl_Position = _22.mvp * vec4(position, 0.0, 1.0); + if (_22.fillType == 1) + { + vec2 _54 = _22.gradientEnd - _22.gradientStart; + float _59 = _54.x; + float _64 = _54.y; + gradient_uv.x = dot(position - _22.gradientStart, _54) / ((_59 * _59) + (_64 * _64)); + } + else + { + if (_22.fillType == 2) + { + gradient_uv = (position - _22.gradientStart) / vec2(distance(_22.gradientStart, _22.gradientEnd)); + } + } } */ -static const char vs_path_source_glsl330[265] = { - 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e, - 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61, - 0x74,0x68,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x6f,0x75, - 0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f, - 0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29, - 0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, - 0x6e,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x70,0x6f,0x73,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69, - 0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73, - 0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f, - 0x70,0x61,0x74,0x68,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20, - 0x76,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31, - 0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x70,0x61,0x72,0x61,0x6d, - 0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x70,0x61, - 0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28, - 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, - 0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +static const char vs_path_source_glsl330[709] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x73,0x74, + 0x72,0x75,0x63,0x74,0x20,0x76,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x74,0x34,0x20,0x6d, + 0x76,0x70,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x66,0x69,0x6c,0x6c, + 0x54,0x79,0x70,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x67, + 0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45, + 0x6e,0x64,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20, + 0x76,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5f, + 0x32,0x32,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61, + 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63, + 0x32,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20, + 0x76,0x65,0x63,0x32,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76, + 0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, + 0x20,0x3d,0x20,0x5f,0x32,0x32,0x2e,0x6d,0x76,0x70,0x20,0x2a,0x20,0x76,0x65,0x63, + 0x34,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x30,0x2e,0x30,0x2c, + 0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, + 0x32,0x32,0x2e,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20,0x31, + 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x32,0x20,0x5f,0x35,0x34,0x20,0x3d,0x20,0x5f,0x32,0x32,0x2e,0x67, + 0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45,0x6e,0x64,0x20,0x2d,0x20,0x5f,0x32,0x32, + 0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35, + 0x39,0x20,0x3d,0x20,0x5f,0x35,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x34,0x20,0x3d,0x20,0x5f, + 0x35,0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x72, + 0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76,0x2e,0x78,0x20,0x3d,0x20,0x64,0x6f, + 0x74,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x2d,0x20,0x5f,0x32,0x32, + 0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x2c,0x20, + 0x5f,0x35,0x34,0x29,0x20,0x2f,0x20,0x28,0x28,0x5f,0x35,0x39,0x20,0x2a,0x20,0x5f, + 0x35,0x39,0x29,0x20,0x2b,0x20,0x28,0x5f,0x36,0x34,0x20,0x2a,0x20,0x5f,0x36,0x34, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c, + 0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x32,0x2e,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70, + 0x65,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x72, + 0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76,0x20,0x3d,0x20,0x28,0x70,0x6f,0x73, + 0x69,0x74,0x69,0x6f,0x6e,0x20,0x2d,0x20,0x5f,0x32,0x32,0x2e,0x67,0x72,0x61,0x64, + 0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x29,0x20,0x2f,0x20,0x76,0x65,0x63, + 0x32,0x28,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x28,0x5f,0x32,0x32,0x2e,0x67, + 0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f,0x32, + 0x32,0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45,0x6e,0x64,0x29,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x7d,0x0a,0x0a,0x00, }; /* #version 330 @@ -237,128 +291,107 @@ int fillType; vec4 colors[16]; vec4 stops[4]; - vec2 gradientStart; - vec2 gradientEnd; int stopCount; }; - uniform fs_path_uniforms _19; + uniform fs_path_uniforms _18; layout(location = 0) out vec4 frag_color; - in vec2 pos; + in vec2 gradient_uv; void main() { - if (_19.fillType == 0) + if (_18.fillType == 0) { - frag_color = _19.colors[0]; + frag_color = _18.colors[0]; } else { - float f; - if (_19.fillType == 1) + float _39; + if (_18.fillType == 1) { - vec2 _49 = _19.gradientEnd - _19.gradientStart; - float _54 = _49.x; - float _60 = _49.y; - f = dot(pos - _19.gradientStart, _49) / ((_54 * _54) + (_60 * _60)); + _39 = gradient_uv.x; } else { - f = distance(_19.gradientStart, pos) / distance(_19.gradientStart, _19.gradientEnd); + _39 = length(gradient_uv); } - vec4 color = mix(_19.colors[0], _19.colors[1], vec4(smoothstep(_19.stops[0].x, _19.stops[0].y, f))); + vec4 color = mix(_18.colors[0], _18.colors[1], vec4(smoothstep(_18.stops[0].x, _18.stops[0].y, _39))); for (int i = 1; i < 15; i++) { - if (i >= (_19.stopCount - 1)) + if (i >= (_18.stopCount - 1)) { break; } - int _124 = i + 1; - color = mix(color, _19.colors[_124], vec4(smoothstep(_19.stops[i / 4][i % 4], _19.stops[_124 / 4][_124 % 4], f))); + int _91 = i + 1; + color = mix(color, _18.colors[_91], vec4(smoothstep(_18.stops[i / 4][i % 4], _18.stops[_91 / 4][_91 % 4], _39))); } frag_color = color; } } */ -static const char fs_path_source_glsl330[1213] = { +static const char fs_path_source_glsl330[949] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x73,0x74, 0x72,0x75,0x63,0x74,0x20,0x66,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x75,0x6e,0x69, 0x66,0x6f,0x72,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20, 0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, 0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x31,0x36,0x5d,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x73,0x74,0x6f,0x70,0x73,0x5b,0x34,0x5d, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x67,0x72,0x61,0x64,0x69, - 0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, - 0x63,0x32,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45,0x6e,0x64,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x73,0x74,0x6f,0x70,0x43,0x6f,0x75,0x6e, - 0x74,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x66, - 0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x73,0x20, - 0x5f,0x31,0x39,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63, - 0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76, - 0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, - 0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73,0x3b,0x0a,0x0a,0x76,0x6f, - 0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x28,0x5f,0x31,0x39,0x2e,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65, - 0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20, - 0x3d,0x20,0x5f,0x31,0x39,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x20,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x28,0x5f,0x31,0x39,0x2e,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20, - 0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32, - 0x20,0x5f,0x34,0x39,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x67,0x72,0x61,0x64,0x69, - 0x65,0x6e,0x74,0x45,0x6e,0x64,0x20,0x2d,0x20,0x5f,0x31,0x39,0x2e,0x67,0x72,0x61, - 0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35, - 0x34,0x20,0x3d,0x20,0x5f,0x34,0x39,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x30, - 0x20,0x3d,0x20,0x5f,0x34,0x39,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x70,0x6f, - 0x73,0x20,0x2d,0x20,0x5f,0x31,0x39,0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74, - 0x53,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f,0x34,0x39,0x29,0x20,0x2f,0x20,0x28,0x28, - 0x5f,0x35,0x34,0x20,0x2a,0x20,0x5f,0x35,0x34,0x29,0x20,0x2b,0x20,0x28,0x5f,0x36, - 0x30,0x20,0x2a,0x20,0x5f,0x36,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x20,0x3d,0x20,0x64,0x69,0x73,0x74, - 0x61,0x6e,0x63,0x65,0x28,0x5f,0x31,0x39,0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e, - 0x74,0x53,0x74,0x61,0x72,0x74,0x2c,0x20,0x70,0x6f,0x73,0x29,0x20,0x2f,0x20,0x64, - 0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x28,0x5f,0x31,0x39,0x2e,0x67,0x72,0x61,0x64, - 0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f,0x31,0x39,0x2e,0x67, - 0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45,0x6e,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28, - 0x5f,0x31,0x39,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x5f, - 0x31,0x39,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x65, - 0x63,0x34,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x31, - 0x39,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x2c,0x20,0x5f,0x31, - 0x39,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x2c,0x20,0x66,0x29, - 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20, - 0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20, - 0x31,0x35,0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x28,0x69,0x20,0x3e,0x3d,0x20,0x28,0x5f,0x31,0x39,0x2e,0x73,0x74,0x6f, - 0x70,0x43,0x6f,0x75,0x6e,0x74,0x20,0x2d,0x20,0x31,0x29,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20, - 0x5f,0x31,0x32,0x34,0x20,0x3d,0x20,0x69,0x20,0x2b,0x20,0x31,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20, - 0x3d,0x20,0x6d,0x69,0x78,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x5f,0x31,0x39, - 0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x5f,0x31,0x32,0x34,0x5d,0x2c,0x20,0x76, - 0x65,0x63,0x34,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f, - 0x31,0x39,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b,0x69,0x20,0x2f,0x20,0x34,0x5d,0x5b, - 0x69,0x20,0x25,0x20,0x34,0x5d,0x2c,0x20,0x5f,0x31,0x39,0x2e,0x73,0x74,0x6f,0x70, - 0x73,0x5b,0x5f,0x31,0x32,0x34,0x20,0x2f,0x20,0x34,0x5d,0x5b,0x5f,0x31,0x32,0x34, - 0x20,0x25,0x20,0x34,0x5d,0x2c,0x20,0x66,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, - 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, - 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x73,0x74,0x6f,0x70,0x43,0x6f, + 0x75,0x6e,0x74,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d, + 0x20,0x66,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d, + 0x73,0x20,0x5f,0x31,0x38,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, + 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74, + 0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x3b,0x0a,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x67,0x72,0x61,0x64,0x69,0x65, + 0x6e,0x74,0x5f,0x75,0x76,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69, + 0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31, + 0x38,0x2e,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20,0x30,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x38,0x2e, + 0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33, + 0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, + 0x31,0x38,0x2e,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20,0x31, + 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20,0x67,0x72, + 0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, + 0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20, + 0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f, + 0x75,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x31,0x38,0x2e,0x63,0x6f,0x6c,0x6f, + 0x72,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x5f,0x31,0x38,0x2e,0x63,0x6f,0x6c,0x6f,0x72, + 0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x65,0x63,0x34,0x28,0x73,0x6d,0x6f,0x6f,0x74, + 0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x31,0x38,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b, + 0x30,0x5d,0x2e,0x78,0x2c,0x20,0x5f,0x31,0x38,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b, + 0x30,0x5d,0x2e,0x79,0x2c,0x20,0x5f,0x33,0x39,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69, + 0x20,0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20,0x31,0x35,0x3b,0x20,0x69,0x2b, + 0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x69,0x20,0x3e, + 0x3d,0x20,0x28,0x5f,0x31,0x38,0x2e,0x73,0x74,0x6f,0x70,0x43,0x6f,0x75,0x6e,0x74, + 0x20,0x2d,0x20,0x31,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x39,0x31,0x20,0x3d,0x20, + 0x69,0x20,0x2b,0x20,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x63, + 0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x5f,0x31,0x38,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73, + 0x5b,0x5f,0x39,0x31,0x5d,0x2c,0x20,0x76,0x65,0x63,0x34,0x28,0x73,0x6d,0x6f,0x6f, + 0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x31,0x38,0x2e,0x73,0x74,0x6f,0x70,0x73, + 0x5b,0x69,0x20,0x2f,0x20,0x34,0x5d,0x5b,0x69,0x20,0x25,0x20,0x34,0x5d,0x2c,0x20, + 0x5f,0x31,0x38,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b,0x5f,0x39,0x31,0x20,0x2f,0x20, + 0x34,0x5d,0x5b,0x5f,0x39,0x31,0x20,0x25,0x20,0x34,0x5d,0x2c,0x20,0x5f,0x33,0x39, + 0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x7d,0x0a,0x0a,0x00, }; /* cbuffer vs_params : register(b0) @@ -538,13 +571,16 @@ /* cbuffer vs_path_params : register(b0) { - row_major float4x4 _27_mvp : packoffset(c0); + row_major float4x4 _22_mvp : packoffset(c0); + int _22_fillType : packoffset(c4); + float2 _22_gradientStart : packoffset(c4.z); + float2 _22_gradientEnd : packoffset(c5); }; static float4 gl_Position; - static float2 pos; static float2 position; + static float2 gradient_uv; struct SPIRV_Cross_Input { @@ -553,17 +589,35 @@ struct SPIRV_Cross_Output { - float2 pos : TEXCOORD0; + float2 gradient_uv : TEXCOORD0; float4 gl_Position : SV_Position; }; - #line 14 "../src/sokol/shader.glsl" + #line 17 "../src/sokol/shader.glsl" void vert_main() { - #line 14 "../src/sokol/shader.glsl" - pos = position; - #line 15 "../src/sokol/shader.glsl" - gl_Position = mul(float4(position, 0.0f, 1.0f), _27_mvp); + #line 17 "../src/sokol/shader.glsl" + gl_Position = mul(float4(position, 0.0f, 1.0f), _22_mvp); + #line 19 "../src/sokol/shader.glsl" + if (_22_fillType == 1) + { + #line 21 "../src/sokol/shader.glsl" + float2 _54 = _22_gradientEnd - _22_gradientStart; + #line 22 "../src/sokol/shader.glsl" + float _59 = _54.x; + float _64 = _54.y; + #line 23 "../src/sokol/shader.glsl" + gradient_uv.x = dot(position - _22_gradientStart, _54) / ((_59 * _59) + (_64 * _64)); + } + else + { + #line 25 "../src/sokol/shader.glsl" + if (_22_fillType == 2) + { + #line 27 "../src/sokol/shader.glsl" + gradient_uv = (position - _22_gradientStart) / distance(_22_gradientStart, _22_gradientEnd).xx; + } + } } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) @@ -572,80 +626,125 @@ vert_main(); SPIRV_Cross_Output stage_output; stage_output.gl_Position = gl_Position; - stage_output.pos = pos; + stage_output.gradient_uv = gradient_uv; return stage_output; } */ -static const char vs_path_source_hlsl5[787] = { +static const char vs_path_source_hlsl5[1537] = { 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x76,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f, 0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65, 0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f, 0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f, - 0x32,0x37,0x5f,0x6d,0x76,0x70,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66, - 0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x0a,0x73,0x74, - 0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50, - 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x3b,0x0a,0x73,0x74,0x61,0x74, - 0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x69,0x74,0x69, - 0x6f,0x6e,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52, - 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b, - 0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52, - 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x20, - 0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, - 0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x34,0x20, - 0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68, - 0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x76,0x6f,0x69,0x64,0x20, - 0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x23,0x6c, - 0x69,0x6e,0x65,0x20,0x31,0x34,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73, - 0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c, - 0x22,0x0a,0x20,0x20,0x20,0x20,0x70,0x6f,0x73,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69, - 0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x35,0x20,0x22, + 0x32,0x32,0x5f,0x6d,0x76,0x70,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66, + 0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74, + 0x20,0x5f,0x32,0x32,0x5f,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3a,0x20, + 0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x34,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x32,0x32,0x5f,0x67, + 0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x20,0x3a,0x20,0x70, + 0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x34,0x2e,0x7a,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x32,0x32,0x5f, + 0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45,0x6e,0x64,0x20,0x3a,0x20,0x70,0x61, + 0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x35,0x29,0x3b,0x0a,0x7d,0x3b, + 0x0a,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74, + 0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x69, + 0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76,0x3b, + 0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43, + 0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, + 0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x7d,0x3b, + 0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43, + 0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e, + 0x74,0x5f,0x75,0x76,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f, + 0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e, + 0x65,0x20,0x31,0x37,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b, + 0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a, + 0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29, + 0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x20,0x22,0x2e,0x2e,0x2f, + 0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72, + 0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x30,0x2e, + 0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x32,0x32,0x5f,0x6d, + 0x76,0x70,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39,0x20,0x22,0x2e, + 0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64, + 0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x5f,0x32,0x32,0x5f,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3d,0x3d, + 0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20, + 0x32,0x31,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c, + 0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x35,0x34, + 0x20,0x3d,0x20,0x5f,0x32,0x32,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45, + 0x6e,0x64,0x20,0x2d,0x20,0x5f,0x32,0x32,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e, + 0x74,0x53,0x74,0x61,0x72,0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x32, + 0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73, + 0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x39,0x20,0x3d,0x20, + 0x5f,0x35,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x34,0x20,0x3d,0x20,0x5f,0x35,0x34,0x2e,0x79, + 0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x33,0x20,0x22,0x2e,0x2e,0x2f,0x73, + 0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e, + 0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x72, + 0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76,0x2e,0x78,0x20,0x3d,0x20,0x64,0x6f, + 0x74,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x2d,0x20,0x5f,0x32,0x32, + 0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x2c,0x20, + 0x5f,0x35,0x34,0x29,0x20,0x2f,0x20,0x28,0x28,0x5f,0x35,0x39,0x20,0x2a,0x20,0x5f, + 0x35,0x39,0x29,0x20,0x2b,0x20,0x28,0x5f,0x36,0x34,0x20,0x2a,0x20,0x5f,0x36,0x34, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c, + 0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32, + 0x35,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f, + 0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x32,0x5f,0x66,0x69,0x6c, + 0x6c,0x54,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x37,0x20,0x22, 0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61, - 0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c, - 0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28, - 0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c, - 0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x32, - 0x37,0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56, - 0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61, - 0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49, - 0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74, - 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, - 0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x70, - 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x72, - 0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50, - 0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74, - 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e, - 0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x67,0x6c, - 0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73, - 0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x70,0x6f,0x73,0x20, - 0x3d,0x20,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a, - 0x7d,0x0a,0x00, + 0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75, + 0x76,0x20,0x3d,0x20,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x2d,0x20, + 0x5f,0x32,0x32,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72, + 0x74,0x29,0x20,0x2f,0x20,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x28,0x5f,0x32, + 0x32,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x2c, + 0x20,0x5f,0x32,0x32,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45,0x6e,0x64, + 0x29,0x2e,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43, + 0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e, + 0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70, + 0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d, + 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x70,0x6f,0x73, + 0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x72,0x74,0x5f, + 0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52, + 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73, + 0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x67,0x6c, + 0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x50, + 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61, + 0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x67,0x72,0x61,0x64,0x69,0x65, + 0x6e,0x74,0x5f,0x75,0x76,0x20,0x3d,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74, + 0x5f,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, + 0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a, + 0x00, }; /* cbuffer fs_path_uniforms : register(b0) { - int _19_fillType : packoffset(c0); - float4 _19_colors[16] : packoffset(c1); - float4 _19_stops[4] : packoffset(c17); - float2 _19_gradientStart : packoffset(c21); - float2 _19_gradientEnd : packoffset(c21.z); - int _19_stopCount : packoffset(c22); + int _18_fillType : packoffset(c0); + float4 _18_colors[16] : packoffset(c1); + float4 _18_stops[4] : packoffset(c17); + int _18_stopCount : packoffset(c21); }; static float4 frag_color; - static float2 pos; + static float2 gradient_uv; struct SPIRV_Cross_Input { - float2 pos : TEXCOORD0; + float2 gradient_uv : TEXCOORD0; }; struct SPIRV_Cross_Output @@ -653,213 +752,178 @@ float4 frag_color : SV_Target0; }; - #line 20 "../src/sokol/shader.glsl" + #line 18 "../src/sokol/shader.glsl" void frag_main() { - #line 20 "../src/sokol/shader.glsl" - if (_19_fillType == 0) + #line 18 "../src/sokol/shader.glsl" + if (_18_fillType == 0) { - #line 22 "../src/sokol/shader.glsl" - frag_color = _19_colors[0]; + #line 20 "../src/sokol/shader.glsl" + frag_color = _18_colors[0]; } else { - #line 26 "../src/sokol/shader.glsl" - float f; - if (_19_fillType == 1) + #line 23 "../src/sokol/shader.glsl" + float _39; + if (_18_fillType == 1) { - #line 28 "../src/sokol/shader.glsl" - float2 _49 = _19_gradientEnd - _19_gradientStart; - #line 29 "../src/sokol/shader.glsl" - float _54 = _49.x; - float _60 = _49.y; - #line 30 "../src/sokol/shader.glsl" - f = dot(pos - _19_gradientStart, _49) / ((_54 * _54) + (_60 * _60)); + _39 = gradient_uv.x; } else { - #line 34 "../src/sokol/shader.glsl" - f = distance(_19_gradientStart, pos) / distance(_19_gradientStart, _19_gradientEnd); + _39 = length(gradient_uv); } - #line 37 "../src/sokol/shader.glsl" - #line 38 "../src/sokol/shader.glsl" - float4 color = lerp(_19_colors[0], _19_colors[1], smoothstep(_19_stops[0].x, _19_stops[0].y, f).xxxx); - #line 39 "../src/sokol/shader.glsl" + #line 24 "../src/sokol/shader.glsl" + #line 25 "../src/sokol/shader.glsl" + float4 color = lerp(_18_colors[0], _18_colors[1], smoothstep(_18_stops[0].x, _18_stops[0].y, _39).xxxx); + #line 26 "../src/sokol/shader.glsl" for (int i = 1; i < 15; i++) { - #line 41 "../src/sokol/shader.glsl" - if (i >= (_19_stopCount - 1)) + #line 28 "../src/sokol/shader.glsl" + if (i >= (_18_stopCount - 1)) { - #line 43 "../src/sokol/shader.glsl" + #line 30 "../src/sokol/shader.glsl" break; } - #line 46 "../src/sokol/shader.glsl" - #line 48 "../src/sokol/shader.glsl" - #line 47 "../src/sokol/shader.glsl" - int _124 = i + 1; - #line 48 "../src/sokol/shader.glsl" - color = lerp(color, _19_colors[_124], smoothstep(_19_stops[i / 4][i % 4], _19_stops[_124 / 4][_124 % 4], f).xxxx); + #line 33 "../src/sokol/shader.glsl" + #line 35 "../src/sokol/shader.glsl" + #line 34 "../src/sokol/shader.glsl" + int _91 = i + 1; + #line 35 "../src/sokol/shader.glsl" + color = lerp(color, _18_colors[_91], smoothstep(_18_stops[i / 4][i % 4], _18_stops[_91 / 4][_91 % 4], _39).xxxx); } - #line 50 "../src/sokol/shader.glsl" + #line 37 "../src/sokol/shader.glsl" frag_color = color; } } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) { - pos = stage_input.pos; + gradient_uv = stage_input.gradient_uv; frag_main(); SPIRV_Cross_Output stage_output; stage_output.frag_color = frag_color; return stage_output; } */ -static const char fs_path_source_hlsl5[2306] = { +static const char fs_path_source_hlsl5[1870] = { 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x66,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f, 0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73, 0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e, - 0x74,0x20,0x5f,0x31,0x39,0x5f,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3a, + 0x74,0x20,0x5f,0x31,0x38,0x5f,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3a, 0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x39,0x5f, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x38,0x5f, 0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x31,0x36,0x5d,0x20,0x3a,0x20,0x70,0x61,0x63, 0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x39,0x5f,0x73,0x74,0x6f,0x70, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x38,0x5f,0x73,0x74,0x6f,0x70, 0x73,0x5b,0x34,0x5d,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65, - 0x74,0x28,0x63,0x31,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x32,0x20,0x5f,0x31,0x39,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53, - 0x74,0x61,0x72,0x74,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65, - 0x74,0x28,0x63,0x32,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x32,0x20,0x5f,0x31,0x39,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45, - 0x6e,0x64,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28, - 0x63,0x32,0x31,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20, - 0x5f,0x31,0x39,0x5f,0x73,0x74,0x6f,0x70,0x43,0x6f,0x75,0x6e,0x74,0x20,0x3a,0x20, - 0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x32,0x32,0x29,0x3b, + 0x74,0x28,0x63,0x31,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20, + 0x5f,0x31,0x38,0x5f,0x73,0x74,0x6f,0x70,0x43,0x6f,0x75,0x6e,0x74,0x20,0x3a,0x20, + 0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x32,0x31,0x29,0x3b, 0x0a,0x7d,0x3b,0x0a,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f, 0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, - 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f, - 0x73,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56, - 0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x20,0x3a,0x20, + 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x67,0x72, + 0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75, + 0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49, + 0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76,0x20,0x3a,0x20, 0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73, 0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73, 0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, 0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 0x20,0x3a,0x20,0x53,0x56,0x5f,0x54,0x61,0x72,0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d, - 0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x20,0x22,0x2e,0x2e,0x2f, + 0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x38,0x20,0x22,0x2e,0x2e,0x2f, 0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72, 0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67, 0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20, - 0x32,0x30,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c, + 0x31,0x38,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c, 0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x39,0x5f,0x66,0x69,0x6c,0x6c,0x54,0x79, + 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x38,0x5f,0x66,0x69,0x6c,0x6c,0x54,0x79, 0x70,0x65,0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23, - 0x6c,0x69,0x6e,0x65,0x20,0x32,0x32,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f, + 0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f, 0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73, 0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, - 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x39,0x5f,0x63,0x6f,0x6c,0x6f, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x38,0x5f,0x63,0x6f,0x6c,0x6f, 0x72,0x73,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, 0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e, - 0x65,0x20,0x32,0x36,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b, + 0x65,0x20,0x32,0x33,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b, 0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x39, - 0x5f,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20, - 0x32,0x38,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c, - 0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, - 0x20,0x5f,0x34,0x39,0x20,0x3d,0x20,0x5f,0x31,0x39,0x5f,0x67,0x72,0x61,0x64,0x69, - 0x65,0x6e,0x74,0x45,0x6e,0x64,0x20,0x2d,0x20,0x5f,0x31,0x39,0x5f,0x67,0x72,0x61, - 0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e, - 0x65,0x20,0x32,0x39,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b, - 0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x20,0x5f,0x35,0x34,0x20,0x3d,0x20,0x5f,0x34,0x39,0x2e,0x78,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x20,0x5f,0x36,0x30,0x20,0x3d,0x20,0x5f,0x34,0x39,0x2e,0x79,0x3b,0x0a,0x23,0x6c, - 0x69,0x6e,0x65,0x20,0x33,0x30,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73, - 0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c, - 0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x20, - 0x3d,0x20,0x64,0x6f,0x74,0x28,0x70,0x6f,0x73,0x20,0x2d,0x20,0x5f,0x31,0x39,0x5f, - 0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f, - 0x34,0x39,0x29,0x20,0x2f,0x20,0x28,0x28,0x5f,0x35,0x34,0x20,0x2a,0x20,0x5f,0x35, - 0x34,0x29,0x20,0x2b,0x20,0x28,0x5f,0x36,0x30,0x20,0x2a,0x20,0x5f,0x36,0x30,0x29, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x34,0x20,0x22,0x2e,0x2e, - 0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65, - 0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x66,0x20,0x3d,0x20,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65, - 0x28,0x5f,0x31,0x39,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61, - 0x72,0x74,0x2c,0x20,0x70,0x6f,0x73,0x29,0x20,0x2f,0x20,0x64,0x69,0x73,0x74,0x61, - 0x6e,0x63,0x65,0x28,0x5f,0x31,0x39,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74, - 0x53,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f,0x31,0x39,0x5f,0x67,0x72,0x61,0x64,0x69, - 0x65,0x6e,0x74,0x45,0x6e,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x7d,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x37,0x20,0x22,0x2e,0x2e,0x2f, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33, + 0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, + 0x31,0x38,0x5f,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20,0x31, + 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20,0x67,0x72, + 0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, + 0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20, + 0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f, + 0x75,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x23, + 0x6c,0x69,0x6e,0x65,0x20,0x32,0x34,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f, + 0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73, + 0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x35,0x20,0x22,0x2e,0x2e,0x2f, 0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72, - 0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x38,0x20, + 0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6c,0x65, + 0x72,0x70,0x28,0x5f,0x31,0x38,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d, + 0x2c,0x20,0x5f,0x31,0x38,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x31,0x5d,0x2c, + 0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x31,0x38,0x5f, + 0x73,0x74,0x6f,0x70,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x2c,0x20,0x5f,0x31,0x38,0x5f, + 0x73,0x74,0x6f,0x70,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x2c,0x20,0x5f,0x33,0x39,0x29, + 0x2e,0x78,0x78,0x78,0x78,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x36, + 0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73, + 0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d, + 0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20,0x31,0x35,0x3b,0x20,0x69,0x2b,0x2b,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65, + 0x20,0x32,0x38,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f, + 0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x69, + 0x20,0x3e,0x3d,0x20,0x28,0x5f,0x31,0x38,0x5f,0x73,0x74,0x6f,0x70,0x43,0x6f,0x75, + 0x6e,0x74,0x20,0x2d,0x20,0x31,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x30,0x20, 0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68, 0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20, - 0x3d,0x20,0x6c,0x65,0x72,0x70,0x28,0x5f,0x31,0x39,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x73,0x5b,0x30,0x5d,0x2c,0x20,0x5f,0x31,0x39,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73, - 0x5b,0x31,0x5d,0x2c,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28, - 0x5f,0x31,0x39,0x5f,0x73,0x74,0x6f,0x70,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x2c,0x20, - 0x5f,0x31,0x39,0x5f,0x73,0x74,0x6f,0x70,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x2c,0x20, - 0x66,0x29,0x2e,0x78,0x78,0x78,0x78,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20, - 0x33,0x39,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c, - 0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69, - 0x20,0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20,0x31,0x35,0x3b,0x20,0x69,0x2b, - 0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69, - 0x6e,0x65,0x20,0x34,0x31,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f, - 0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x28,0x69,0x20,0x3e,0x3d,0x20,0x28,0x5f,0x31,0x39,0x5f,0x73,0x74,0x6f,0x70,0x43, - 0x6f,0x75,0x6e,0x74,0x20,0x2d,0x20,0x31,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x34, - 0x33,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x33,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63, + 0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c, + 0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x35,0x20,0x22,0x2e,0x2e, + 0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65, + 0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x34, + 0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73, + 0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x39,0x31,0x20, + 0x3d,0x20,0x69,0x20,0x2b,0x20,0x31,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33, + 0x35,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f, 0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65, - 0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x34,0x36,0x20,0x22,0x2e,0x2e,0x2f,0x73, - 0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e, - 0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x34,0x38,0x20,0x22, - 0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61, - 0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20, - 0x34,0x37,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c, - 0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31, - 0x32,0x34,0x20,0x3d,0x20,0x69,0x20,0x2b,0x20,0x31,0x3b,0x0a,0x23,0x6c,0x69,0x6e, - 0x65,0x20,0x34,0x38,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b, - 0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f, - 0x72,0x20,0x3d,0x20,0x6c,0x65,0x72,0x70,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2c,0x20, - 0x5f,0x31,0x39,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x5f,0x31,0x32,0x34,0x5d, - 0x2c,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x31,0x39, - 0x5f,0x73,0x74,0x6f,0x70,0x73,0x5b,0x69,0x20,0x2f,0x20,0x34,0x5d,0x5b,0x69,0x20, - 0x25,0x20,0x34,0x5d,0x2c,0x20,0x5f,0x31,0x39,0x5f,0x73,0x74,0x6f,0x70,0x73,0x5b, - 0x5f,0x31,0x32,0x34,0x20,0x2f,0x20,0x34,0x5d,0x5b,0x5f,0x31,0x32,0x34,0x20,0x25, - 0x20,0x34,0x5d,0x2c,0x20,0x66,0x29,0x2e,0x78,0x78,0x78,0x78,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x35, - 0x30,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f, - 0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20, - 0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d, - 0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75, - 0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f, - 0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67, - 0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x70, - 0x6f,0x73,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74, - 0x2e,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d, - 0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56, - 0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74, - 0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d, - 0x0a,0x00, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, + 0x20,0x6c,0x65,0x72,0x70,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x5f,0x31,0x38, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x5f,0x39,0x31,0x5d,0x2c,0x20,0x73,0x6d, + 0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x31,0x38,0x5f,0x73,0x74,0x6f, + 0x70,0x73,0x5b,0x69,0x20,0x2f,0x20,0x34,0x5d,0x5b,0x69,0x20,0x25,0x20,0x34,0x5d, + 0x2c,0x20,0x5f,0x31,0x38,0x5f,0x73,0x74,0x6f,0x70,0x73,0x5b,0x5f,0x39,0x31,0x20, + 0x2f,0x20,0x34,0x5d,0x5b,0x5f,0x39,0x31,0x20,0x25,0x20,0x34,0x5d,0x2c,0x20,0x5f, + 0x33,0x39,0x29,0x2e,0x78,0x78,0x78,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x37,0x20,0x22,0x2e, + 0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64, + 0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f, + 0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x53,0x50, + 0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74, + 0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73, + 0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e, + 0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x72,0x61,0x64,0x69, + 0x65,0x6e,0x74,0x5f,0x75,0x76,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, + 0x6e,0x70,0x75,0x74,0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f, + 0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, + 0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67, + 0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61, + 0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, }; /* #include <metal_stdlib> @@ -1006,11 +1070,14 @@ struct vs_path_params { float4x4 mvp; + int fillType; + float2 gradientStart; + float2 gradientEnd; }; struct main0_out { - float2 pos [[user(locn0)]]; + float2 gradient_uv [[user(locn0)]]; float4 gl_Position [[position]]; }; @@ -1019,19 +1086,37 @@ float2 position [[attribute(0)]]; }; - #line 14 "../src/sokol/shader.glsl" - vertex main0_out main0(main0_in in [[stage_in]], constant vs_path_params& _27 [[buffer(0)]]) + #line 17 "../src/sokol/shader.glsl" + vertex main0_out main0(main0_in in [[stage_in]], constant vs_path_params& _22 [[buffer(0)]]) { main0_out out = {}; - #line 14 "../src/sokol/shader.glsl" - out.pos = in.position; - #line 15 "../src/sokol/shader.glsl" - out.gl_Position = _27.mvp * float4(in.position, 0.0, 1.0); + #line 17 "../src/sokol/shader.glsl" + out.gl_Position = _22.mvp * float4(in.position, 0.0, 1.0); + #line 19 "../src/sokol/shader.glsl" + if (_22.fillType == 1) + { + #line 21 "../src/sokol/shader.glsl" + float2 _54 = _22.gradientEnd - _22.gradientStart; + #line 22 "../src/sokol/shader.glsl" + float _59 = _54.x; + float _64 = _54.y; + #line 23 "../src/sokol/shader.glsl" + out.gradient_uv.x = dot(in.position - _22.gradientStart, _54) / ((_59 * _59) + (_64 * _64)); + } + else + { + #line 25 "../src/sokol/shader.glsl" + if (_22.fillType == 2) + { + #line 27 "../src/sokol/shader.glsl" + out.gradient_uv = (in.position - _22.gradientStart) / float2(distance(_22.gradientStart, _22.gradientEnd)); + } + } return out; } */ -static const char vs_path_source_metal_macos[607] = { +static const char vs_path_source_metal_macos[1280] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -1039,37 +1124,80 @@ 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x76, 0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a, 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x6d,0x76,0x70, - 0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69, - 0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c, - 0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20, - 0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b, - 0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69, - 0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70, - 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62, - 0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c, - 0x69,0x6e,0x65,0x20,0x31,0x34,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73, - 0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c, - 0x22,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f, - 0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69, - 0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d, - 0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,0x70, - 0x61,0x74,0x68,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x32,0x37,0x20, - 0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f, - 0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31, - 0x34,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f, - 0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20, - 0x20,0x6f,0x75,0x74,0x2e,0x70,0x6f,0x73,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x6f, - 0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x35, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x66,0x69,0x6c,0x6c,0x54,0x79, + 0x70,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x67, + 0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e, + 0x74,0x45,0x6e,0x64,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74, + 0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74, + 0x5f,0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30, + 0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74, + 0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28, + 0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20, + 0x31,0x37,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c, + 0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x76,0x65, + 0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d, + 0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e, + 0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x63, + 0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x76,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x32,0x32,0x20,0x5b,0x5b,0x62,0x75, + 0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d, + 0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x37,0x20,0x22,0x2e, + 0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64, + 0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f, + 0x32,0x32,0x2e,0x6d,0x76,0x70,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28, + 0x69,0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x30,0x2e,0x30, + 0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x39, 0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73, 0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20, - 0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20, - 0x3d,0x20,0x5f,0x32,0x37,0x2e,0x6d,0x76,0x70,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x34,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20, - 0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x69,0x66,0x20,0x28,0x5f,0x32,0x32,0x2e,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65, + 0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69, + 0x6e,0x65,0x20,0x32,0x31,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f, + 0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20, + 0x5f,0x35,0x34,0x20,0x3d,0x20,0x5f,0x32,0x32,0x2e,0x67,0x72,0x61,0x64,0x69,0x65, + 0x6e,0x74,0x45,0x6e,0x64,0x20,0x2d,0x20,0x5f,0x32,0x32,0x2e,0x67,0x72,0x61,0x64, + 0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65, + 0x20,0x32,0x32,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f, + 0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x39, + 0x20,0x3d,0x20,0x5f,0x35,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x34,0x20,0x3d,0x20,0x5f,0x35, + 0x34,0x2e,0x79,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x33,0x20,0x22,0x2e, + 0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64, + 0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x6f,0x75,0x74,0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76, + 0x2e,0x78,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x69, + 0x74,0x69,0x6f,0x6e,0x20,0x2d,0x20,0x5f,0x32,0x32,0x2e,0x67,0x72,0x61,0x64,0x69, + 0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f,0x35,0x34,0x29,0x20,0x2f, + 0x20,0x28,0x28,0x5f,0x35,0x39,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29,0x20,0x2b,0x20, + 0x28,0x5f,0x36,0x34,0x20,0x2a,0x20,0x5f,0x36,0x34,0x29,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, + 0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x35,0x20,0x22,0x2e,0x2e,0x2f, + 0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72, + 0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x5f,0x32,0x32,0x2e,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20, + 0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x37,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63, + 0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c, + 0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x6f,0x75,0x74,0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76,0x20, + 0x3d,0x20,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x2d, + 0x20,0x5f,0x32,0x32,0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61, + 0x72,0x74,0x29,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x64,0x69,0x73, + 0x74,0x61,0x6e,0x63,0x65,0x28,0x5f,0x32,0x32,0x2e,0x67,0x72,0x61,0x64,0x69,0x65, + 0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f,0x32,0x32,0x2e,0x67,0x72,0x61, + 0x64,0x69,0x65,0x6e,0x74,0x45,0x6e,0x64,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + }; /* #include <metal_stdlib> @@ -1082,8 +1210,6 @@ int fillType; float4 colors[16]; float4 stops[4]; - float2 gradientStart; - float2 gradientEnd; int stopCount; }; @@ -1094,65 +1220,58 @@ struct main0_in { - float2 pos [[user(locn0)]]; + float2 gradient_uv [[user(locn0)]]; }; - #line 20 "../src/sokol/shader.glsl" - fragment main0_out main0(main0_in in [[stage_in]], constant fs_path_uniforms& _19 [[buffer(0)]]) + #line 18 "../src/sokol/shader.glsl" + fragment main0_out main0(main0_in in [[stage_in]], constant fs_path_uniforms& _18 [[buffer(0)]]) { main0_out out = {}; - #line 20 "../src/sokol/shader.glsl" - if (_19.fillType == 0) + #line 18 "../src/sokol/shader.glsl" + if (_18.fillType == 0) { - #line 22 "../src/sokol/shader.glsl" - out.frag_color = _19.colors[0]; + #line 20 "../src/sokol/shader.glsl" + out.frag_color = _18.colors[0]; } else { - #line 26 "../src/sokol/shader.glsl" - float f; - if (_19.fillType == 1) + #line 23 "../src/sokol/shader.glsl" + float _39; + if (_18.fillType == 1) { - #line 28 "../src/sokol/shader.glsl" - float2 _49 = _19.gradientEnd - _19.gradientStart; - #line 29 "../src/sokol/shader.glsl" - float _54 = _49.x; - float _60 = _49.y; - #line 30 "../src/sokol/shader.glsl" - f = dot(in.pos - _19.gradientStart, _49) / ((_54 * _54) + (_60 * _60)); + _39 = in.gradient_uv.x; } else { - #line 34 "../src/sokol/shader.glsl" - f = distance(_19.gradientStart, in.pos) / distance(_19.gradientStart, _19.gradientEnd); + _39 = length(in.gradient_uv); } - #line 37 "../src/sokol/shader.glsl" - #line 38 "../src/sokol/shader.glsl" - float4 color = mix(_19.colors[0], _19.colors[1], float4(smoothstep(_19.stops[0].x, _19.stops[0].y, f))); - #line 39 "../src/sokol/shader.glsl" + #line 24 "../src/sokol/shader.glsl" + #line 25 "../src/sokol/shader.glsl" + float4 color = mix(_18.colors[0], _18.colors[1], float4(smoothstep(_18.stops[0].x, _18.stops[0].y, _39))); + #line 26 "../src/sokol/shader.glsl" for (int i = 1; i < 15; i++) { - #line 41 "../src/sokol/shader.glsl" - if (i >= (_19.stopCount - 1)) + #line 28 "../src/sokol/shader.glsl" + if (i >= (_18.stopCount - 1)) { - #line 43 "../src/sokol/shader.glsl" + #line 30 "../src/sokol/shader.glsl" break; } - #line 46 "../src/sokol/shader.glsl" - #line 48 "../src/sokol/shader.glsl" - #line 47 "../src/sokol/shader.glsl" - int _124 = i + 1; - #line 48 "../src/sokol/shader.glsl" - color = mix(color, _19.colors[_124], float4(smoothstep(_19.stops[i / 4][i % 4], _19.stops[_124 / 4][_124 % 4], f))); + #line 33 "../src/sokol/shader.glsl" + #line 35 "../src/sokol/shader.glsl" + #line 34 "../src/sokol/shader.glsl" + int _91 = i + 1; + #line 35 "../src/sokol/shader.glsl" + color = mix(color, _18.colors[_91], float4(smoothstep(_18.stops[i / 4][i % 4], _18.stops[_91 / 4][_91 % 4], _39))); } - #line 50 "../src/sokol/shader.glsl" + #line 37 "../src/sokol/shader.glsl" out.frag_color = color; } return out; } */ -static const char fs_path_source_metal_macos[2100] = { +static const char fs_path_source_metal_macos[1686] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -1163,128 +1282,102 @@ 0x70,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63, 0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x31,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, 0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x73,0x5b,0x34,0x5d,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x67,0x72,0x61,0x64,0x69, - 0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x32,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45,0x6e,0x64, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x73,0x74,0x6f,0x70,0x43,0x6f, - 0x75,0x6e,0x74,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, - 0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a, - 0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30, - 0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, - 0x20,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e, - 0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20, - 0x32,0x30,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c, - 0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x66,0x72, - 0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74, - 0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20, - 0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c, - 0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x73,0x5f,0x70,0x61,0x74, - 0x68,0x5f,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x73,0x26,0x20,0x5f,0x31,0x39,0x20, - 0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f, - 0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32, - 0x30,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f, - 0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x39,0x2e,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70, - 0x65,0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c, - 0x69,0x6e,0x65,0x20,0x32,0x32,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73, - 0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c, - 0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72, - 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x63, - 0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23, - 0x6c,0x69,0x6e,0x65,0x20,0x32,0x36,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f, - 0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73, - 0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x20,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, - 0x5f,0x31,0x39,0x2e,0x66,0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20, - 0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69, - 0x6e,0x65,0x20,0x32,0x38,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f, - 0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x32,0x20,0x5f,0x34,0x39,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x67,0x72, - 0x61,0x64,0x69,0x65,0x6e,0x74,0x45,0x6e,0x64,0x20,0x2d,0x20,0x5f,0x31,0x39,0x2e, - 0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x3b,0x0a,0x23, - 0x6c,0x69,0x6e,0x65,0x20,0x32,0x39,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f, - 0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73, - 0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x34,0x20,0x3d,0x20,0x5f,0x34,0x39,0x2e,0x78, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x20,0x5f,0x36,0x30,0x20,0x3d,0x20,0x5f,0x34,0x39,0x2e,0x79,0x3b, - 0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x30,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72, - 0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67, - 0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x66,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x20, - 0x2d,0x20,0x5f,0x31,0x39,0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74, - 0x61,0x72,0x74,0x2c,0x20,0x5f,0x34,0x39,0x29,0x20,0x2f,0x20,0x28,0x28,0x5f,0x35, - 0x34,0x20,0x2a,0x20,0x5f,0x35,0x34,0x29,0x20,0x2b,0x20,0x28,0x5f,0x36,0x30,0x20, - 0x2a,0x20,0x5f,0x36,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20, - 0x33,0x34,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c, - 0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x20,0x3d,0x20,0x64,0x69, - 0x73,0x74,0x61,0x6e,0x63,0x65,0x28,0x5f,0x31,0x39,0x2e,0x67,0x72,0x61,0x64,0x69, - 0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x2c,0x20,0x69,0x6e,0x2e,0x70,0x6f,0x73, - 0x29,0x20,0x2f,0x20,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x28,0x5f,0x31,0x39, - 0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x53,0x74,0x61,0x72,0x74,0x2c,0x20, - 0x5f,0x31,0x39,0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x45,0x6e,0x64,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69,0x6e, - 0x65,0x20,0x33,0x37,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b, - 0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a, - 0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x38,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63, + 0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x73,0x74,0x6f,0x70,0x43,0x6f,0x75,0x6e, + 0x74,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61, + 0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20, + 0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b, + 0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69, + 0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x67, + 0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65, + 0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a, + 0x23,0x6c,0x69,0x6e,0x65,0x20,0x31,0x38,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63, 0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c, - 0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f, - 0x31,0x39,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x5f,0x31, - 0x39,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x34,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f, - 0x31,0x39,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x2c,0x20,0x5f, - 0x31,0x39,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x2c,0x20,0x66, - 0x29,0x29,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x39,0x20,0x22,0x2e, - 0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64, - 0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x31,0x3b, - 0x20,0x69,0x20,0x3c,0x20,0x31,0x35,0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x34,0x31, - 0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73, - 0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x69,0x20,0x3e,0x3d, - 0x20,0x28,0x5f,0x31,0x39,0x2e,0x73,0x74,0x6f,0x70,0x43,0x6f,0x75,0x6e,0x74,0x20, - 0x2d,0x20,0x31,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x34,0x33,0x20,0x22,0x2e,0x2e, + 0x73,0x6c,0x22,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,0x61,0x69, + 0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69, + 0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65, + 0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20, + 0x66,0x73,0x5f,0x70,0x61,0x74,0x68,0x5f,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x73, + 0x26,0x20,0x5f,0x31,0x38,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30, + 0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30, + 0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x23, + 0x6c,0x69,0x6e,0x65,0x20,0x31,0x38,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f, + 0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73, + 0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x38,0x2e,0x66, + 0x69,0x6c,0x6c,0x54,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x30,0x20,0x22,0x2e,0x2e, 0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65, 0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69, - 0x6e,0x65,0x20,0x34,0x36,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f, - 0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22, - 0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x34,0x38,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72, - 0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67, - 0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x34,0x37,0x20,0x22,0x2e, + 0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, + 0x20,0x5f,0x31,0x38,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x33,0x20,0x22,0x2e, 0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64, 0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x32,0x34,0x20,0x3d,0x20, - 0x69,0x20,0x2b,0x20,0x31,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x34,0x38,0x20, - 0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68, - 0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6d, - 0x69,0x78,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x5f,0x31,0x39,0x2e,0x63,0x6f, - 0x6c,0x6f,0x72,0x73,0x5b,0x5f,0x31,0x32,0x34,0x5d,0x2c,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x34,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x31, - 0x39,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b,0x69,0x20,0x2f,0x20,0x34,0x5d,0x5b,0x69, - 0x20,0x25,0x20,0x34,0x5d,0x2c,0x20,0x5f,0x31,0x39,0x2e,0x73,0x74,0x6f,0x70,0x73, - 0x5b,0x5f,0x31,0x32,0x34,0x20,0x2f,0x20,0x34,0x5d,0x5b,0x5f,0x31,0x32,0x34,0x20, - 0x25,0x20,0x34,0x5d,0x2c,0x20,0x66,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x35,0x30,0x20,0x22, - 0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61, - 0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, - 0x7d,0x0a,0x0a,0x00, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x38,0x2e,0x66,0x69,0x6c,0x6c, + 0x54,0x79,0x70,0x65,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x5f,0x33,0x39,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x67,0x72,0x61,0x64,0x69,0x65, + 0x6e,0x74,0x5f,0x75,0x76,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67, + 0x74,0x68,0x28,0x69,0x6e,0x2e,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x75, + 0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c, + 0x69,0x6e,0x65,0x20,0x32,0x34,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73, + 0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c, + 0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32,0x35,0x20,0x22,0x2e,0x2e,0x2f,0x73, + 0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e, + 0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6d,0x69,0x78, + 0x28,0x5f,0x31,0x38,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x2c,0x20, + 0x5f,0x31,0x38,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70, + 0x28,0x5f,0x31,0x38,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x2c, + 0x20,0x5f,0x31,0x38,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x2c, + 0x20,0x5f,0x33,0x39,0x29,0x29,0x29,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x32, + 0x36,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f, + 0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20, + 0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20,0x31,0x35,0x3b,0x20,0x69,0x2b,0x2b, + 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e, + 0x65,0x20,0x32,0x38,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b, + 0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x69,0x20,0x3e,0x3d,0x20,0x28,0x5f,0x31,0x38,0x2e,0x73,0x74,0x6f,0x70,0x43,0x6f, + 0x75,0x6e,0x74,0x20,0x2d,0x20,0x31,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x30, + 0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73, + 0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61, + 0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x33,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72, + 0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67, + 0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x35,0x20,0x22,0x2e, + 0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73,0x68,0x61,0x64, + 0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33, + 0x34,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f, + 0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x39,0x31, + 0x20,0x3d,0x20,0x69,0x20,0x2b,0x20,0x31,0x3b,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20, + 0x33,0x35,0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c, + 0x2f,0x73,0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20, + 0x3d,0x20,0x6d,0x69,0x78,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x5f,0x31,0x38, + 0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x5f,0x39,0x31,0x5d,0x2c,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28, + 0x5f,0x31,0x38,0x2e,0x73,0x74,0x6f,0x70,0x73,0x5b,0x69,0x20,0x2f,0x20,0x34,0x5d, + 0x5b,0x69,0x20,0x25,0x20,0x34,0x5d,0x2c,0x20,0x5f,0x31,0x38,0x2e,0x73,0x74,0x6f, + 0x70,0x73,0x5b,0x5f,0x39,0x31,0x20,0x2f,0x20,0x34,0x5d,0x5b,0x5f,0x39,0x31,0x20, + 0x25,0x20,0x34,0x5d,0x2c,0x20,0x5f,0x33,0x39,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x23,0x6c,0x69,0x6e,0x65,0x20,0x33,0x37, + 0x20,0x22,0x2e,0x2e,0x2f,0x73,0x72,0x63,0x2f,0x73,0x6f,0x6b,0x6f,0x6c,0x2f,0x73, + 0x68,0x61,0x64,0x65,0x72,0x2e,0x67,0x6c,0x73,0x6c,0x22,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; #if !defined(SOKOL_GFX_INCLUDED) #error "Please include sokol_gfx.h before shader.h" @@ -1366,33 +1459,36 @@ desc.attrs[0].name = "position"; desc.vs.source = vs_path_source_glsl330; desc.vs.entry = "main"; - desc.vs.uniform_blocks[0].size = 64; + desc.vs.uniform_blocks[0].size = 96; desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.vs.uniform_blocks[0].uniforms[0].name = "vs_path_params"; - desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; - desc.vs.uniform_blocks[0].uniforms[0].array_count = 4; + desc.vs.uniform_blocks[0].uniforms[0].name = "_22.mvp"; + desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_MAT4; + desc.vs.uniform_blocks[0].uniforms[0].array_count = 1; + desc.vs.uniform_blocks[0].uniforms[1].name = "_22.fillType"; + desc.vs.uniform_blocks[0].uniforms[1].type = SG_UNIFORMTYPE_INT; + desc.vs.uniform_blocks[0].uniforms[1].array_count = 1; + desc.vs.uniform_blocks[0].uniforms[2].name = "_22.gradientStart"; + desc.vs.uniform_blocks[0].uniforms[2].type = SG_UNIFORMTYPE_FLOAT2; + desc.vs.uniform_blocks[0].uniforms[2].array_count = 1; + desc.vs.uniform_blocks[0].uniforms[3].name = "_22.gradientEnd"; + desc.vs.uniform_blocks[0].uniforms[3].type = SG_UNIFORMTYPE_FLOAT2; + desc.vs.uniform_blocks[0].uniforms[3].array_count = 1; desc.fs.source = fs_path_source_glsl330; desc.fs.entry = "main"; - desc.fs.uniform_blocks[0].size = 368; + desc.fs.uniform_blocks[0].size = 352; desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.uniform_blocks[0].uniforms[0].name = "_19.fillType"; + desc.fs.uniform_blocks[0].uniforms[0].name = "_18.fillType"; desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_INT; desc.fs.uniform_blocks[0].uniforms[0].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[1].name = "_19.colors"; + desc.fs.uniform_blocks[0].uniforms[1].name = "_18.colors"; desc.fs.uniform_blocks[0].uniforms[1].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[1].array_count = 16; - desc.fs.uniform_blocks[0].uniforms[2].name = "_19.stops"; + desc.fs.uniform_blocks[0].uniforms[2].name = "_18.stops"; desc.fs.uniform_blocks[0].uniforms[2].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[2].array_count = 4; - desc.fs.uniform_blocks[0].uniforms[3].name = "_19.gradientStart"; - desc.fs.uniform_blocks[0].uniforms[3].type = SG_UNIFORMTYPE_FLOAT2; + desc.fs.uniform_blocks[0].uniforms[3].name = "_18.stopCount"; + desc.fs.uniform_blocks[0].uniforms[3].type = SG_UNIFORMTYPE_INT; desc.fs.uniform_blocks[0].uniforms[3].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[4].name = "_19.gradientEnd"; - desc.fs.uniform_blocks[0].uniforms[4].type = SG_UNIFORMTYPE_FLOAT2; - desc.fs.uniform_blocks[0].uniforms[4].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[5].name = "_19.stopCount"; - desc.fs.uniform_blocks[0].uniforms[5].type = SG_UNIFORMTYPE_INT; - desc.fs.uniform_blocks[0].uniforms[5].array_count = 1; desc.label = "rive_tess_path_shader"; } return &desc; @@ -1407,12 +1503,12 @@ desc.vs.source = vs_path_source_hlsl5; desc.vs.d3d11_target = "vs_5_0"; desc.vs.entry = "main"; - desc.vs.uniform_blocks[0].size = 64; + desc.vs.uniform_blocks[0].size = 96; desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; desc.fs.source = fs_path_source_hlsl5; desc.fs.d3d11_target = "ps_5_0"; desc.fs.entry = "main"; - desc.fs.uniform_blocks[0].size = 368; + desc.fs.uniform_blocks[0].size = 352; desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; desc.label = "rive_tess_path_shader"; } @@ -1425,11 +1521,11 @@ valid = true; desc.vs.source = vs_path_source_metal_macos; desc.vs.entry = "main0"; - desc.vs.uniform_blocks[0].size = 64; + desc.vs.uniform_blocks[0].size = 96; desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; desc.fs.source = fs_path_source_metal_macos; desc.fs.entry = "main0"; - desc.fs.uniform_blocks[0].size = 368; + desc.fs.uniform_blocks[0].size = 352; desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; desc.label = "rive_tess_path_shader"; }
diff --git a/tess/src/sokol/shader.glsl b/tess/src/sokol/shader.glsl index 575cc24..b52c05d 100644 --- a/tess/src/sokol/shader.glsl +++ b/tess/src/sokol/shader.glsl
@@ -34,14 +34,27 @@ @vs vs_path uniform vs_path_params { mat4 mvp; + int fillType; + vec2 gradientStart; + vec2 gradientEnd; }; in vec2 position; -out vec2 pos; +out vec2 gradient_uv; void main() { - pos = position; gl_Position = mvp * vec4(position, 0.0, 1.0); + + if(fillType == 1) { + // Linear gradient. + vec2 toEnd = gradientEnd - gradientStart; + float lengthSquared = toEnd.x * toEnd.x + toEnd.y * toEnd.y; + gradient_uv.x = dot(position - gradientStart, toEnd) / lengthSquared; + } + else if(fillType == 2) { + // fillType == 2 (Radial gradient) + gradient_uv = (position - gradientStart) / distance(gradientStart, gradientEnd); + } } @end @@ -51,12 +64,10 @@ int fillType; vec4 colors[16]; vec4 stops[4]; - vec2 gradientStart; - vec2 gradientEnd; int stopCount; }; -in vec2 pos; +in vec2 gradient_uv; out vec4 frag_color; void main() { @@ -65,18 +76,7 @@ frag_color = colors[0]; } else { - float f; - if(fillType == 1) { - // Linear gradient. - vec2 toEnd = gradientEnd - gradientStart; - float lengthSquared = toEnd.x * toEnd.x + toEnd.y * toEnd.y; - f = dot(pos - gradientStart, toEnd) / lengthSquared; - } - else { - // fillType == 2 (Radial gradient) - f = distance(gradientStart, pos) / distance(gradientStart, gradientEnd); - } - + float f = fillType == 1 ? gradient_uv.x : length(gradient_uv); vec4 color = mix(colors[0], colors[1], smoothstep(stops[0][0], stops[0][1], f)); for (int i = 1; i < 15; ++i)
diff --git a/tess/src/sokol/sokol_tess_renderer.cpp b/tess/src/sokol/sokol_tess_renderer.cpp index a77a86a..acd0113 100644 --- a/tess/src/sokol/sokol_tess_renderer.cpp +++ b/tess/src/sokol/sokol_tess_renderer.cpp
@@ -636,18 +636,18 @@ m_end = Vec2D(cx + radius, cy); } - void bind(fs_path_uniforms_t& uniforms) { + void bind(vs_path_params_t& vertexUniforms, fs_path_uniforms_t& fragmentUniforms) { auto stopCount = m_stops.size(); - uniforms.fillType = m_type; - uniforms.stopCount = stopCount; - uniforms.gradientStart = m_start; - uniforms.gradientEnd = m_end; + vertexUniforms.fillType = fragmentUniforms.fillType = m_type; + vertexUniforms.gradientStart = m_start; + vertexUniforms.gradientEnd = m_end; + fragmentUniforms.stopCount = stopCount; for (int i = 0; i < stopCount; i++) { auto colorBufferIndex = i * 4; for (int j = 0; j < 4; j++) { - uniforms.colors[i][j] = m_colors[colorBufferIndex + j]; + fragmentUniforms.colors[i][j] = m_colors[colorBufferIndex + j]; } - uniforms.stops[i / 4][i % 4] = m_stops[i]; + fragmentUniforms.stops[i / 4][i % 4] = m_stops[i]; } } }; @@ -737,10 +737,11 @@ void shader(rcp<RenderShader> shader) override { m_shader = shader; } - void draw(SokolRenderPath* path) { + void draw(vs_path_params_t& vertexUniforms, SokolRenderPath* path) { if (m_shader) { - static_cast<SokolGradient*>(m_shader.get())->bind(m_uniforms); + static_cast<SokolGradient*>(m_shader.get())->bind(vertexUniforms, m_uniforms); } + sg_apply_uniforms(SG_SHADERSTAGE_VS, SLOT_vs_params, SG_RANGE_REF(vertexUniforms)); sg_apply_uniforms(SG_SHADERSTAGE_FS, SLOT_fs_path_uniforms, SG_RANGE_REF(m_uniforms)); if (m_stroke != nullptr) { if (m_strokeDirty) { @@ -943,9 +944,8 @@ case BlendMode::multiply: setPipeline(m_pathMultiplyPipeline[m_clipCount]); break; default: setPipeline(m_pathScreenPipeline[m_clipCount]); break; } - sg_apply_uniforms(SG_SHADERSTAGE_VS, SLOT_vs_params, SG_RANGE_REF(vs_params)); - static_cast<SokolRenderPaint*>(paint)->draw(static_cast<SokolRenderPath*>(path)); + static_cast<SokolRenderPaint*>(paint)->draw(vs_params, static_cast<SokolRenderPath*>(path)); } SokolRenderImage::SokolRenderImage(const uint8_t* bytes, uint32_t width, uint32_t height) :