From 7a057fabc26407a2f66f2fb767076a7ad7023a0d Mon Sep 17 00:00:00 2001 From: GGRei Date: Sun, 5 Jul 2026 13:22:31 +0200 Subject: [PATCH] windows: add opt-in D3D11 shader support --- .github/workflows/ci.yml | 10 + .github/workflows/windows-native-smoke.yml | 73 + _shaders_test.v | 206 + _sokol_formats_test.v | 24 + _windows_readback_codegen_test.v | 76 + docs/SHADERS.md | 38 +- docs/WINDOWS.md | 39 + print_raster.v | 31 +- render_gradient.v | 2 +- shader.v | 4 +- shaders.v | 1905 ++--- shaders/README.md | 21 + shaders/gui_builtin.glsl | 512 ++ shaders/gui_builtin.h | 7550 ++++++++++++++++++++ shaders_generated.c.v | 15 + shaders_glsl.v | 459 +- shaders_metal.v | 528 +- sokol_formats.v | 17 + 18 files changed, 9042 insertions(+), 2468 deletions(-) create mode 100644 _sokol_formats_test.v create mode 100644 _windows_readback_codegen_test.v create mode 100644 shaders/README.md create mode 100644 shaders/gui_builtin.glsl create mode 100644 shaders/gui_builtin.h create mode 100644 shaders_generated.c.v create mode 100644 sokol_formats.v diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb5bda2..dd7950a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,12 @@ on: - "**.vsh" - "**.c" - "**.h" + - "**.glsl" + - "**.hlsl" - "**.m" - "**.md" + - "**.metal" + - "**.wgsl" - "**/ci.yml" - ".github/workflows/*.yml" pull_request: @@ -17,8 +21,12 @@ on: - "**.vsh" - "**.c" - "**.h" + - "**.glsl" + - "**.hlsl" - "**.m" - "**.md" + - "**.metal" + - "**.wgsl" - "**/ci.yml" - ".github/workflows/*.yml" @@ -117,6 +125,7 @@ jobs: fetch-depth: 0 - name: Run tests env: + GUI_CHECK_GENERATED_SHADERS: "1" VFLAGS: -no-parallel -cc clang run: | test_manifest="${RUNNER_TEMP}/gui-test-files" @@ -394,6 +403,7 @@ jobs: run: v -cc msvc run gui/_windows_preflight.vsh - name: Run tests env: + GUI_CHECK_GENERATED_SHADERS: "1" VFLAGS: -no-parallel -cc msvc VJOBS: 1 VTEST_ONLY_FN: test_* diff --git a/.github/workflows/windows-native-smoke.yml b/.github/workflows/windows-native-smoke.yml index 93225ad..016c3c3 100644 --- a/.github/workflows/windows-native-smoke.yml +++ b/.github/workflows/windows-native-smoke.yml @@ -15,6 +15,10 @@ on: description: "Also run exploratory MinGW/MSYS2 smoke" type: boolean default: false + run_d3d11: + description: "Also compile D3D11 probes; requires a V build with -d sokol_d3d11 support" + type: boolean + default: false concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} @@ -280,6 +284,29 @@ jobs: v -no-parallel -cc msvc -W -o dialogs_smoke.exe gui/examples/dialogs.v v -no-parallel -cc msvc -W -o printing_smoke.exe gui/examples/printing.v v -no-parallel -cc msvc -W -o notification_smoke.exe gui/examples/native_notification.v + if ('${{ inputs.run_d3d11 }}' -eq 'true') { + $d3dExamples = @( + @{ Name = 'printing'; Path = 'gui/examples/printing.v'; Warn = $true }, + @{ Name = 'gradient_demo'; Path = 'gui/examples/gradient_demo.v'; Warn = $true }, + @{ Name = 'shadow_demo'; Path = 'gui/examples/shadow_demo.v'; Warn = $true }, + @{ Name = 'blur_demo'; Path = 'gui/examples/blur_demo.v'; Warn = $true }, + @{ Name = 'image_clip'; Path = 'gui/examples/image_clip.v'; Warn = $true }, + @{ Name = 'svg_demo'; Path = 'gui/examples/svg_demo.v'; Warn = $true }, + @{ Name = 'custom_shader'; Path = 'gui/examples/custom_shader.v'; Warn = $true }, + @{ Name = 'showcase'; Path = 'gui/examples/showcase.v'; Warn = $false } + ) + foreach ($example in $d3dExamples) { + $args = @('-no-parallel', '-cc', 'msvc', '-d', 'sokol_d3d11') + if ($example.Warn) { + $args += '-W' + } + $args += @('-o', "$($example.Name)_d3d11_smoke.exe", $example.Path) + v @args + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + } + } clang: name: Clang native smoke (exploratory) @@ -348,6 +375,29 @@ jobs: v -no-parallel -cc clang -W -o dialogs_smoke.exe gui/examples/dialogs.v v -no-parallel -cc clang -W -o printing_smoke.exe gui/examples/printing.v v -no-parallel -cc clang -W -o notification_smoke.exe gui/examples/native_notification.v + if ('${{ inputs.run_d3d11 }}' -eq 'true') { + $d3dExamples = @( + @{ Name = 'printing'; Path = 'gui/examples/printing.v'; Warn = $true }, + @{ Name = 'gradient_demo'; Path = 'gui/examples/gradient_demo.v'; Warn = $true }, + @{ Name = 'shadow_demo'; Path = 'gui/examples/shadow_demo.v'; Warn = $true }, + @{ Name = 'blur_demo'; Path = 'gui/examples/blur_demo.v'; Warn = $true }, + @{ Name = 'image_clip'; Path = 'gui/examples/image_clip.v'; Warn = $true }, + @{ Name = 'svg_demo'; Path = 'gui/examples/svg_demo.v'; Warn = $true }, + @{ Name = 'custom_shader'; Path = 'gui/examples/custom_shader.v'; Warn = $true }, + @{ Name = 'showcase'; Path = 'gui/examples/showcase.v'; Warn = $false } + ) + foreach ($example in $d3dExamples) { + $args = @('-no-parallel', '-cc', 'clang', '-d', 'sokol_d3d11') + if ($example.Warn) { + $args += '-W' + } + $args += @('-o', "$($example.Name)_d3d11_smoke.exe", $example.Path) + v @args + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + } + } mingw: name: MinGW native smoke (exploratory) @@ -424,3 +474,26 @@ jobs: v -no-parallel -cc gcc -W -o dialogs_smoke.exe gui/examples/dialogs.v v -no-parallel -cc gcc -W -o printing_smoke.exe gui/examples/printing.v v -no-parallel -cc gcc -W -o notification_smoke.exe gui/examples/native_notification.v + if [ '${{ inputs.run_d3d11 }}' = 'true' ]; then + for item in \ + 'printing:gui/examples/printing.v:-W' \ + 'gradient_demo:gui/examples/gradient_demo.v:-W' \ + 'shadow_demo:gui/examples/shadow_demo.v:-W' \ + 'blur_demo:gui/examples/blur_demo.v:-W' \ + 'image_clip:gui/examples/image_clip.v:-W' \ + 'svg_demo:gui/examples/svg_demo.v:-W' \ + 'custom_shader:gui/examples/custom_shader.v:-W' \ + 'showcase:gui/examples/showcase.v:' + do + IFS=':' read -r name path warn_flag <<< "$item" + args=(-no-parallel -cc gcc -d sokol_d3d11) + if [ -n "$warn_flag" ]; then + args+=("$warn_flag") + fi + args+=(-o "${name}_d3d11_smoke.exe" "$path") + v "${args[@]}" + if [ "$?" -ne 0 ]; then + exit 1 + fi + done + fi diff --git a/_shaders_test.v b/_shaders_test.v index fa7663b..d14dd5b 100644 --- a/_shaders_test.v +++ b/_shaders_test.v @@ -1,6 +1,212 @@ module gui import math +import os + +fn generated_shader_source_path() string { + return os.join_path(os.dir(@FILE), 'shaders', 'gui_builtin.glsl') +} + +fn generated_shader_header_path() string { + return os.join_path(os.dir(@FILE), 'shaders', 'gui_builtin.h') +} + +fn generated_shader_cmdline() string { + return 'sokol-shdc --input shaders/gui_builtin.glsl --output shaders/gui_builtin.h --slang glsl410:hlsl4:metal_macos' +} + +fn generated_shader_programs() []string { + return [ + 'gui_blur', + 'gui_filter_blur_h', + 'gui_filter_blur_v', + 'gui_filter_color', + 'gui_filter_texture', + 'gui_gradient', + 'gui_image_clip', + 'gui_rounded_rect', + 'gui_shadow', + ] +} + +fn generated_shader_sgl_vertex_stages() []string { + return [ + 'gui_rect_vs', + 'gui_shadow_vs', + 'gui_gradient_vs', + 'gui_filter_sgl_vs', + ] +} + +fn generated_shader_raw_vertex_stages() []string { + return [ + 'gui_filter_vs', + ] +} + +fn read_generated_shader_header() string { + return os.read_file(generated_shader_header_path()) or { panic(err) } +} + +fn read_gui_source(name string) string { + return os.read_file(os.join_path(os.dir(@FILE), name)) or { panic(err) } +} + +fn count_occurrences(haystack string, needle string) int { + mut count := 0 + mut offset := 0 + for { + index := haystack.index_after(needle, offset) or { break } + count++ + offset = index + needle.len + } + return count +} + +fn normalize_whitespace(src string) string { + return src.fields().join(' ') +} + +fn sanitize_generated_shader_header(src string) string { + mut lines := []string{} + for line in src.split_into_lines() { + if line.contains('sokol-shdc --input') { + lines << ' ${generated_shader_cmdline()}' + continue + } + lines << line + } + return lines.join('\n') +} + +fn test_generated_builtin_shader_files_are_committed() { + assert os.exists(generated_shader_source_path()) + assert os.exists(generated_shader_header_path()) + header := read_generated_shader_header() + assert header.contains("#version:1# (machine generated, don't edit!)") + assert header.contains('Generated by sokol-shdc') +} + +fn test_generated_builtin_shader_header_cmdline_is_sanitized() { + header := read_generated_shader_header() + assert header.contains(generated_shader_cmdline()) + assert !header.contains(os.dir(@FILE)) + assert !header.contains('--input /') + assert !header.contains('--output /') +} + +fn test_generated_builtin_shader_header_has_all_program_descriptors() { + header := read_generated_shader_header() + for program in generated_shader_programs() { + assert header.contains('static inline const sg_shader_desc* ${program}_shader_desc(sg_backend backend)') + } +} + +fn test_generated_builtin_shader_header_has_d3d11_descriptor_coverage() { + header := read_generated_shader_header() + program_count := generated_shader_programs().len + assert header.contains('SG_BACKEND_GLCORE') + assert header.contains('SG_BACKEND_METAL_MACOS') + assert count_occurrences(header, 'if (backend == SG_BACKEND_D3D11)') == program_count + assert count_occurrences(header, 'desc.vs.d3d11_target = "vs_4_0";') == program_count + assert count_occurrences(header, 'desc.fs.d3d11_target = "ps_4_0";') == program_count + assert header.contains('gui_rect_vs_source_hlsl4') + assert header.contains('gui_shadow_vs_source_hlsl4') + assert header.contains('gui_gradient_vs_source_hlsl4') + assert header.contains('gui_filter_vs_source_hlsl4') + assert header.contains('gui_filter_sgl_vs_source_hlsl4') + assert header.contains('gui_filter_texture_fs_source_hlsl4') +} + +fn test_generated_builtin_shader_header_uses_current_glcore_target() { + header := read_generated_shader_header() + generated_docs := read_gui_source('shaders/README.md') + shader_docs := read_gui_source('docs/SHADERS.md') + normalized_generated_docs := normalize_whitespace(generated_docs) + normalized_shader_docs := normalize_whitespace(shader_docs) + + assert header.contains('sokol-shdc --input shaders/gui_builtin.glsl --output shaders/gui_builtin.h --slang glsl410:hlsl4:metal_macos') + assert header.contains('#version 410') + assert header.contains('gui_rect_vs_source_glsl410') + assert header.contains('gui_rounded_rect_fs_source_glsl410') + assert !header.contains('glsl330') + assert !header.contains('#version 330') + + assert generated_docs.contains('`glsl410` target is intentional') + assert normalized_generated_docs.contains('Do not rewrite the generated header to `glsl330`') + assert normalized_generated_docs.contains('runtime custom `Shader.glsl` body format') + + assert shader_docs.contains('Generated built-in shaders are separate from this runtime `Shader` API') + assert shader_docs.contains('`glsl410` for desktop `SG_BACKEND_GLCORE`') + assert normalized_shader_docs.contains('GLSL 3.3 contract below applies only to runtime custom `Shader.glsl` bodies') +} + +fn test_generated_builtin_shader_header_keeps_sgl_binding_contracts() { + header := read_generated_shader_header() + for stage in generated_shader_sgl_vertex_stages() { + assert header.contains('#define ATTR_${stage}_position (0)') + assert header.contains('#define ATTR_${stage}_texcoord0 (1)') + assert header.contains('#define ATTR_${stage}_color0 (2)') + assert header.contains('#define ATTR_${stage}_psize (3)') + assert header.contains('#define SLOT_${stage}_params (0)') + } + assert count_occurrences(header, 'desc.attrs[3].name = "psize";') == 6 + assert count_occurrences(header, 'desc.attrs[3].sem_name = "TEXCOORD";') == 6 + assert count_occurrences(header, 'desc.attrs[3].sem_index = 3;') == 6 + assert header.contains('desc.vs.source = (const char*)gui_filter_sgl_vs_source_hlsl4;') + assert header.contains('#define SLOT_tex (0)') + assert header.contains('#define SLOT_smp (0)') +} + +fn test_generated_builtin_shader_header_keeps_raw_filter_binding_contract() { + header := read_generated_shader_header() + for stage in generated_shader_raw_vertex_stages() { + assert header.contains('#define ATTR_${stage}_position (0)') + assert header.contains('#define ATTR_${stage}_texcoord0 (1)') + assert header.contains('#define ATTR_${stage}_color0 (2)') + assert !header.contains('#define ATTR_${stage}_psize (3)') + assert header.contains('#define SLOT_${stage}_params (0)') + } +} + +fn test_d3d11_custom_shader_guard_returns_before_runtime_source_pipeline() { + source := read_gui_source('shaders.v') + guard_index := source.index('custom GLSL/Metal shaders are not supported with -d sokol_d3d11') or { + panic(err) + } + glsl_build_index := source.index('fs_source := build_glsl_fragment(shader.glsl)') or { + panic(err) + } + make_shader_index := source.index('shader: gfx.make_shader(&shader_desc)') or { panic(err) } + guard_return_index := source.index_after('return pip', guard_index) or { panic(err) } + assert guard_index < glsl_build_index + assert guard_index < make_shader_index + assert guard_return_index < glsl_build_index + assert guard_return_index < make_shader_index +} + +fn test_generated_builtin_shader_header_is_fresh_when_requested() { + if os.getenv('GUI_CHECK_GENERATED_SHADERS') != '1' { + return + } + + tmp_dir := os.join_path(os.temp_dir(), 'gui_builtin_shader_fresh_${os.getpid()}') + tmp_shader_dir := os.join_path(tmp_dir, 'shaders') + os.rmdir_all(tmp_dir) or {} + os.mkdir_all(tmp_shader_dir) or { panic(err) } + tmp_source := os.join_path(tmp_shader_dir, 'gui_builtin.glsl') + tmp_header := os.join_path(tmp_shader_dir, 'gui_builtin.h') + os.cp(generated_shader_source_path(), tmp_source) or { panic(err) } + + cmd := '${os.quoted_path(@VEXE)} shader -l glsl410 -l hlsl4 -l metal_macos ${os.quoted_path(tmp_source)}' + res := os.execute(cmd) + assert res.exit_code == 0, res.output + + checked_in := sanitize_generated_shader_header(read_generated_shader_header()) + regenerated := sanitize_generated_shader_header(os.read_file(tmp_header) or { panic(err) }) + assert checked_in == regenerated, 'generated shader header is stale; run `v shader -l glsl410 -l hlsl4 -l metal_macos shaders/gui_builtin.glsl`' + os.rmdir_all(tmp_dir) or {} +} fn test_pack_shader_params() { // 10.0 px radius -> 40 fixed-point units. diff --git a/_sokol_formats_test.v b/_sokol_formats_test.v new file mode 100644 index 0000000..2e477a2 --- /dev/null +++ b/_sokol_formats_test.v @@ -0,0 +1,24 @@ +module gui + +import os + +fn gui_module_source(name string) string { + path := os.join_path(os.dir(@FILE), name) + return os.read_file(path) or { panic(err) } +} + +fn test_render_target_formats_use_sapp_glue_defaults() { + helper := gui_module_source('sokol_formats.v') + assert helper.contains('sapp.glue_environment().defaults') + assert !helper.contains('PixelFormat.from(sapp.color_format())') + assert !helper.contains('PixelFormat.from(sapp.depth_format())') +} + +fn test_raster_and_filter_targets_share_render_target_format_helper() { + for source_name in ['print_raster.v', 'shaders.v'] { + source := gui_module_source(source_name) + assert source.contains('gui_render_target_formats()'), source_name + assert !source.contains('PixelFormat.from(sapp.color_format())'), source_name + assert !source.contains('PixelFormat.from(sapp.depth_format())'), source_name + } +} diff --git a/_windows_readback_codegen_test.v b/_windows_readback_codegen_test.v new file mode 100644 index 0000000..4ab8d00 --- /dev/null +++ b/_windows_readback_codegen_test.v @@ -0,0 +1,76 @@ +module gui + +import os +import time + +const windows_readback_codegen_prefix = 'gui_windows_readback_codegen_' + +fn windows_readback_codegen_temp_dir() !string { + base := os.temp_dir() + name := '${windows_readback_codegen_prefix}${os.getpid()}_${time.now().unix_micro()}' + path := os.join_path(base, name) + os.mkdir_all(path)! + return path +} + +fn windows_readback_codegen_compile_printing(tmp_dir string, output_name string, extra_flags []string) !string { + example_path := os.join_path(os.dir(@FILE), 'examples', 'printing.v') + output_path := os.join_path(tmp_dir, output_name) + mut args := [ + os.quoted_path(@VEXE), + '-keepc', + '-no-parallel', + '-cc', + 'msvc', + ] + args << extra_flags + args << [ + '-o', + os.quoted_path(output_path), + os.quoted_path(example_path), + ] + result := os.execute(args.join(' ')) + if result.exit_code != 0 { + return error(result.output) + } + c_path := os.join_path(tmp_dir, 'vtmp', '${output_name}.tmp.c') + return os.read_file(c_path)! +} + +fn test_windows_printing_export_codegen_routes_readback_by_backend() { + $if !windows { + return + } + tmp_dir := windows_readback_codegen_temp_dir() or { + assert false, err.msg() + return + } + old_vtmp := os.getenv('VTMP') + os.setenv('VTMP', os.join_path(tmp_dir, 'vtmp'), true) + defer { + if old_vtmp == '' { + os.unsetenv('VTMP') + } else { + os.setenv('VTMP', old_vtmp, true) + } + os.rmdir_all(tmp_dir) or {} + } + + default_c := windows_readback_codegen_compile_printing(tmp_dir, 'printing_default.exe', []) or { + assert false, err.msg() + return + } + assert default_c.contains('raster PDF export is not supported on Windows OpenGL yet') + assert !default_c.contains('sg_d3d11_query_image_info') + + d3d11_c := windows_readback_codegen_compile_printing(tmp_dir, 'printing_d3d11.exe', [ + '-d', + 'sokol_d3d11', + ]) or { + assert false, err.msg() + return + } + assert d3d11_c.contains('sg_d3d11_query_image_info') + assert d3d11_c.contains('readback_d3d11_texture') + assert !d3d11_c.contains('raster PDF export is not supported on Windows OpenGL yet') +} diff --git a/docs/SHADERS.md b/docs/SHADERS.md index ae40760..3418810 100644 --- a/docs/SHADERS.md +++ b/docs/SHADERS.md @@ -4,6 +4,34 @@ v-gui supports custom fragment shaders on containers and rectangles. Write only the color computation body — the framework handles struct definitions, SDF round-rect clipping, and pipeline caching. +## Backend Support + +The `Shader` API is a runtime source-string API for Metal and OpenGL: + +- macOS Metal uses the `metal` body. +- OpenGL backends use the `glsl` body. +- Windows D3D11 does not consume `glsl` bodies. D3D11 requires HLSL + source or bytecode plus vertex semantics, so custom `Shader` bodies + are not a supported D3D11 path yet. + +Generated built-in shaders are separate from this runtime `Shader` API. The +checked-in built-in descriptors are produced with current `sokol-shdc` targets: +`glsl410` for desktop `SG_BACKEND_GLCORE`, `hlsl4` for D3D11, and +`metal_macos` for macOS Metal. The GLSL 3.3 contract below applies only to +runtime custom `Shader.glsl` bodies. + +When compiled with `-d sokol_d3d11`, runtime custom shaders currently +degrade to the normal rounded-rectangle fill and emit a warning instead +of creating a GLSL pipeline. A successful `examples/custom_shader.v` +compile on D3D11 only proves the fallback path compiles; it is not full +custom shader support. + +For D3D11-specific rendering, use the generated sokol shader route in +lower-level sokol code: generate shader descriptors with D3D11/HLSL +support, keep the generated output fresh with the source shader, and +compile with the opt-in Windows D3D11 backend. Do not treat a stale +GLSL-only descriptor as D3D11-compatible. + ## API Reference ### Shader @@ -134,9 +162,10 @@ gui.column( ### Pipeline Caching Each unique shader source compiles to a GPU pipeline once. The -framework hashes the active platform's source (Metal on macOS, -GLSL elsewhere) and caches the pipeline in `Window.shader_pipelines`. -Multiple views sharing the same shader source reuse one pipeline. +framework hashes the active platform's supported source (Metal on +macOS, GLSL on OpenGL backends) and caches the pipeline in +`Window.shader_pipelines`. Multiple views sharing the same shader +source reuse one pipeline. ### Rendering Priority @@ -176,6 +205,9 @@ The 16-float `params` array maps to the `tm` uniform matrix: - Maximum 16 float parameters - Only available on `column`, `row`, `canvas`, `circle`, and `rectangle` views +- Not supported on Windows D3D11 through this runtime `Shader` API. + Use generated sokol shaders with D3D11/HLSL output for D3D11-specific + custom rendering until a dedicated v-gui HLSL path exists. ## Demo diff --git a/docs/WINDOWS.md b/docs/WINDOWS.md index 56ad713..06d0e14 100644 --- a/docs/WINDOWS.md +++ b/docs/WINDOWS.md @@ -63,6 +63,45 @@ v -no-parallel -cc msvc -W -o notification_smoke.exe examples/native_notificatio The manual UI matrix lives in [`WINDOWS_MANUAL_SMOKE.md`](WINDOWS_MANUAL_SMOKE.md). +## D3D11 Opt-In + +Windows still uses the upstream/default sokol OpenGL backend unless the +selected V/sokol toolchain implements and receives the explicit D3D11 flag: + +```powershell +v -no-parallel -cc msvc -d sokol_d3d11 -W -o printing_d3d11_smoke.exe examples/printing.v +``` + +Use this only with a V build that contains the sokol D3D11 backend work. The +flag is not a v-gui public API and does not change the default Windows backend. + +### Readback And Raster Export + +`export_print_job` keeps the same public API on every backend. When sokol is +initialized it uses GPU raster export; in non-GPU test paths it still falls back +to the vector PDF renderer. + +Backend support during Windows validation: + +- Windows D3D11 with `-d sokol_d3d11`: raster export uses the D3D11 readback + bridge. +- Windows default OpenGL: raster export does not route through D3D11. It returns + a structured unsupported-render error until a Windows OpenGL readback path is + implemented and validated. +- Non-Windows OpenGL and Metal keep their existing readback paths. + +The D3D11 bridge is deliberately narrow: it reads single-sample BGRA8 render +targets through a staging texture and copies rows with the D3D11 `RowPitch`. +Unsupported formats, MSAA render targets, invalid dimensions or missing native +handles fail instead of returning fabricated pixels. + +### Shader Boundary + +v-gui runtime custom shaders are currently Metal/OpenGL source bodies only. The +`glsl` body is not a D3D11 shader source. D3D11-specific custom rendering should +use generated sokol shader descriptors with D3D11/HLSL output, and generated +shader files must be refreshed together with their source shader changes. + ## Dependency Preflight Most Windows setup failures happen before native dialog or print callbacks can diff --git a/print_raster.v b/print_raster.v index 45ffe3a..428d043 100644 --- a/print_raster.v +++ b/print_raster.v @@ -25,15 +25,17 @@ struct C.sg_gl_attachments_info { fn C.sg_gl_query_attachments_info(gfx.Attachments) C.sg_gl_attachments_info -@[typedef] -struct C.sg_d3d11_image_info { - tex2d voidptr - tex3d voidptr - res voidptr - srv voidptr -} +$if windows && sokol_d3d11 ? { + @[typedef] + struct C.sg_d3d11_image_info { + tex2d voidptr + tex3d voidptr + res voidptr + srv voidptr + } -fn C.sg_d3d11_query_image_info(img gfx.Image) C.sg_d3d11_image_info + fn C.sg_d3d11_query_image_info(img gfx.Image) C.sg_d3d11_image_info +} struct PrintPageRaster { tex gfx.Image @@ -47,20 +49,19 @@ fn create_print_page_raster(w int, h int) !PrintPageRaster { if w <= 0 || h <= 0 || w > 8192 || h > 8192 { return error('invalid raster dimensions ${w}x${h}') } - color_fmt := gfx.PixelFormat.from(sapp.color_format()) or { gfx.PixelFormat.bgra8 } - depth_fmt := gfx.PixelFormat.from(sapp.depth_format()) or { gfx.PixelFormat.depth_stencil } + formats := gui_render_target_formats() tex := gfx.make_image(&gfx.ImageDesc{ render_target: true width: w height: h - pixel_format: color_fmt + pixel_format: formats.color label: c'print_page_tex' }) depth := gfx.make_image(&gfx.ImageDesc{ render_target: true width: w height: h - pixel_format: depth_fmt + pixel_format: formats.depth label: c'print_page_depth' }) mut att_colors := [4]gfx.AttachmentDesc{} @@ -146,11 +147,13 @@ fn render_page_to_pixels(mut window Window, raster PrintPageRaster, source_width } $else $if linux { info := C.sg_gl_query_attachments_info(raster.att) return nativebridge.readback_gl_framebuffer(info.framebuffer, raster.w, raster.h) - } $else $if windows { + } $else $if windows && sokol_d3d11 ? { info := C.sg_d3d11_query_image_info(raster.tex) env := sapp.glue_environment() return nativebridge.readback_d3d11_texture(info.tex2d, env.d3d11.device, env.d3d11.device_context, raster.w, raster.h) + } $else $if windows { + return error('raster PDF export is not supported on Windows OpenGL yet; build with -d sokol_d3d11 for the validated D3D11 readback path') } $else { return error('raster PDF export not yet supported on this platform') } @@ -311,7 +314,7 @@ fn pdf_render_document_raster(mut window Window, source_width f32, source_height offset_y) or { return error('page ${idx + 1} render failed: ${err}') } is_bgra := $if macos { true - } $else $if windows { + } $else $if windows && sokol_d3d11 ? { true } $else { false diff --git a/render_gradient.v b/render_gradient.v index 314b7fa..7e17149 100644 --- a/render_gradient.v +++ b/render_gradient.v @@ -376,7 +376,7 @@ fn draw_gradient_border(x f32, y f32, w f32, h f32, radius f32, thickness f32, g // rounded rect pipeline but with a hack: // We use `draw_quad_gradient` logic but applied to the `rounded_rect` pipeline? // NO, `rounded_rect_pip` expects a single color in `color0` attribute for the whole quad usually? - // Wait, `vs_glsl` takes `color0` attribute per vertex. + // The generated built-in vertex layout still carries `color0` per vertex. // So we CAN pass different colors per vertex to `rounded_rect_pip`! scale := window.ui.scale diff --git a/shader.v b/shader.v index 976465e..ce3e7b9 100644 --- a/shader.v +++ b/shader.v @@ -106,7 +106,9 @@ fn build_glsl_fragment(body string) string { // shader_hash computes a cache key from the shader source. fn shader_hash(shader &Shader) u64 { - $if macos { + $if windows && sokol_d3d11 ? { + return hash_string('d3d11-custom-unsupported:' + shader.glsl) + } $else $if macos { return hash_string(shader.metal) } $else { return hash_string(shader.glsl) diff --git a/shaders.v b/shaders.v index ae6c188..616108f 100644 --- a/shaders.v +++ b/shaders.v @@ -18,7 +18,6 @@ module gui // a complex shadow, just by changing the SDF math in the shader. import gg import log -import sokol.sapp import sokol.sgl import sokol.gfx import math @@ -93,17 +92,7 @@ fn filter_max_image_size() int { return fallback_max_filter_image_size } -fn init_rounded_rect_pipeline(mut window Window) bool { - if window.pip.rounded_rect.id != 0 { - return true - } - // Why a custom pipeline? - // A specific shader program (Vertex & Fragment) is required to implement the SDF logic. - // Standard immediate-mode rendering (sgl) generally uses a generic shader for coloured triangles. - // This pipeline configures the GPU to interpret vertex data specifically for SDF rendering - // and executes the corresponding fragment shader. - - // Vertex layout +fn gui_builtin_vertex_layout() gfx.VertexLayoutState { mut attrs := [16]gfx.VertexAttrDesc{} attrs[0] = gfx.VertexAttrDesc{ format: .float3 @@ -120,1358 +109,388 @@ fn init_rounded_rect_pipeline(mut window Window) bool { offset: 20 buffer_index: 0 } - mut buffers := [8]gfx.VertexBufferLayoutState{} buffers[0] = gfx.VertexBufferLayoutState{ stride: 24 } - - // Shader attributes - // These map the vertex attribute buffers to the specific inputs defined in the shader code. - mut shader_attrs := [16]gfx.ShaderAttrDesc{} - // Map vertex buffer 'position' to shader input 'position' (semantic POSITION, index 0) - shader_attrs[0] = gfx.ShaderAttrDesc{ - name: c'position' - sem_name: c'POSITION' - sem_index: 0 - } - // Map vertex buffer 'texcoord0' to shader input 'texcoord0' (semantic TEXCOORD, index 0) - shader_attrs[1] = gfx.ShaderAttrDesc{ - name: c'texcoord0' - sem_name: c'TEXCOORD' - sem_index: 0 - } - // Map vertex buffer 'color0' to shader input 'color0' (semantic COLOR, index 0) - shader_attrs[2] = gfx.ShaderAttrDesc{ - name: c'color0' - sem_name: c'COLOR' - sem_index: 0 - } - - // Uniform Definitions - // Define the layout of uniform blocks (constant data) passed to the shader. - mut ub_uniforms := [16]gfx.ShaderUniformDesc{} - // mvp: Model-View-Projection matrix (4x4 float matrix). - // usage: Transforms vertices from model space to clip space. - ub_uniforms[0] = gfx.ShaderUniformDesc{ - name: c'mvp' - @type: .mat4 - array_count: 1 - } - // tm: Texture Matrix or auxiliary matrix. - // usage: In this pipeline, it is reserved for compatibility or future texture transforms. - ub_uniforms[1] = gfx.ShaderUniformDesc{ - name: c'tm' - @type: .mat4 - array_count: 1 - } - - // Uniform Block - // Groups uniforms into a single bindable block. - mut ub := [4]gfx.ShaderUniformBlockDesc{} - ub[0] = gfx.ShaderUniformBlockDesc{ - size: 128 // Size: 64 bytes (mvp) + 64 bytes (tm) = 128 bytes. - uniforms: ub_uniforms + return gfx.VertexLayoutState{ + attrs: attrs + buffers: buffers } +} - // Color Targets & Blending - // Configures how the pixel shader output is written to the framebuffer. +fn gui_builtin_alpha_colors() [4]gfx.ColorTargetState { mut colors := [4]gfx.ColorTargetState{} colors[0] = gfx.ColorTargetState{ blend: gfx.BlendState{ - enabled: true - // Src Alpha: Use the fragment's calculated alpha (from SDF). - src_factor_rgb: .src_alpha - // One Minus Src Alpha: Standard alpha blending (background * (1-alpha)). + enabled: true + src_factor_rgb: .src_alpha dst_factor_rgb: .one_minus_src_alpha src_factor_alpha: .one dst_factor_alpha: .one_minus_src_alpha } - write_mask: .rgba // Enable writing to Red, Green, Blue, and Alpha channels. - } - - // Texture Images - // Defines expected texture inputs. sgl generic pipelines expect a texture. - mut shader_images := [12]gfx.ShaderImageDesc{} - shader_images[0] = gfx.ShaderImageDesc{ - used: true - image_type: ._2d - sample_type: .float - } - - // Texture Samplers - // Defines how textures are sampled (filtering, wrapping). - mut shader_samplers := [8]gfx.ShaderSamplerDesc{} - shader_samplers[0] = gfx.ShaderSamplerDesc{ - used: true - sampler_type: .filtering // Linear filtering. + write_mask: .rgba } + return colors +} - // Image-Sampler Pairs - // Maps images to samplers for the shader. - mut shader_image_sampler_pairs := [12]gfx.ShaderImageSamplerPairDesc{} - shader_image_sampler_pairs[0] = gfx.ShaderImageSamplerPairDesc{ - used: true - image_slot: 0 - sampler_slot: 0 - glsl_name: c'tex' // Name of the sampler2D in GLSL code. +fn make_gui_builtin_sgl_pipeline(label &char, shader gfx.Shader) sgl.Pipeline { + desc := gfx.PipelineDesc{ + label: unsafe { label } + colors: gui_builtin_alpha_colors() + layout: gui_builtin_vertex_layout() + shader: shader } + return sgl.make_pipeline(&desc) +} - // Shader Description - // Compiles the shader stages (Vertex & Fragment) into a shader program (backend specific). - mut shader_desc := gfx.ShaderDesc{ - attrs: shader_attrs +fn make_gui_builtin_sgl_context_pipeline(ctx sgl.Context, label &char, shader gfx.Shader) sgl.Pipeline { + desc := gfx.PipelineDesc{ + label: unsafe { label } + colors: gui_builtin_alpha_colors() + layout: gui_builtin_vertex_layout() + shader: shader } + return sgl.context_make_pipeline(ctx, &desc) +} - $if macos { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_metal.str // Use .str for &char - entry: c'vs_main' - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_metal.str - entry: c'fs_main' - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } $else { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_glsl.str - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_glsl.str - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } +fn make_gui_builtin_gfx_pipeline(label &char, shader gfx.Shader) gfx.Pipeline { + return gfx.make_pipeline(&gfx.PipelineDesc{ + label: unsafe { label } + colors: gui_builtin_alpha_colors() + layout: gui_builtin_vertex_layout() + shader: shader + }) +} - // Pipeline Description - // Final assembly of the render pipeline state object (PSO). - // Combines shader, layout, and render state into an immutable object. - desc := gfx.PipelineDesc{ - label: c'rounded_rect_pip' - colors: colors - layout: gfx.VertexLayoutState{ - attrs: attrs - buffers: buffers - } - shader: gfx.make_shader(&shader_desc) +fn init_rounded_rect_pipeline(mut window Window) bool { + if window.pip.rounded_rect.id != 0 { + return true } - - window.pip.rounded_rect = sgl.make_pipeline(&desc) + window.pip.rounded_rect = make_gui_builtin_sgl_pipeline(c'rounded_rect_pip', + gfx.make_shader(voidptr(C.gui_rounded_rect_shader_desc(gfx.query_backend())))) return window.pip.rounded_rect.id != 0 } -// Metal Shader Source (MSL) for Shadows - -// init_shadow_pipeline initializes the sgl pipeline specifically for rendering drop shadows. -// It uses a custom shader (vs_shadow/fs_shadow) that implements a Gaussian-like blur approximation -// using Signed Distance Fields (SDF). +// init_shadow_pipeline initializes the generated built-in pipeline for rendering drop shadows. +// The shader implements a Gaussian-like blur approximation using Signed Distance Fields (SDF). fn init_shadow_pipeline(mut window Window) { if window.pip.shadow.id != 0 { return } + window.pip.shadow = make_gui_builtin_sgl_pipeline(c'shadow_pip', + gfx.make_shader(voidptr(C.gui_shadow_shader_desc(gfx.query_backend())))) +} - mut attrs := [16]gfx.VertexAttrDesc{} - // Attribute 0: Position (x, y, z) - // - x, y: Screen coordinates of the vertex. - // - z: Packed parameters (radius, blur/thickness). See pack_shader_params(). - // Format .float3 means 3 x 32-bit floats. - attrs[0] = gfx.VertexAttrDesc{ - format: .float3 - offset: 0 - buffer_index: 0 - } - // Attribute 1: Texture Coordinates (u, v) - // - u, v: Normalized coordinates (-1.0 to 1.0) used for SDF calculation. - // Format .float2 means 2 x 32-bit floats. - attrs[1] = gfx.VertexAttrDesc{ - format: .float2 - offset: 12 - buffer_index: 0 - } - // Attribute 2: Color (r, g, b, a) - // - Standard RGBA color for the vertex. - // Format .ubyte4n means 4 unsigned bytes, normalized to 0.0-1.0 range. - attrs[2] = gfx.VertexAttrDesc{ - format: .ubyte4n - offset: 20 - buffer_index: 0 +// init_blur_pipeline initializes the pipeline for a standalone Gaussian blur effect. +// It shares the same vertex attributes as the shadow pipeline but uses a specific +// fragment shader intended for blurring content without the complexities of the drop-shadow offset logic. +fn init_blur_pipeline(mut window Window) { + if window.pip.blur.id != 0 { + return } + window.pip.blur = make_gui_builtin_sgl_pipeline(c'blur_pip', + gfx.make_shader(voidptr(C.gui_blur_shader_desc(gfx.query_backend())))) +} - mut buffers := [8]gfx.VertexBufferLayoutState{} - buffers[0] = gfx.VertexBufferLayoutState{ - stride: 24 +// init_gradient_pipeline initializes the generated built-in pipeline for multi-stop gradient rendering. +// Gradient stop data is packed into the tm uniform matrix. +fn init_gradient_pipeline(mut window Window) { + if window.pip.gradient.id != 0 { + return } + window.pip.gradient = make_gui_builtin_sgl_pipeline(c'gradient_pip', + gfx.make_shader(voidptr(C.gui_gradient_shader_desc(gfx.query_backend())))) +} - mut shader_attrs := [16]gfx.ShaderAttrDesc{} - // Shadow Mapping: - // Matches vertex attributes to the shadow shader inputs. - shader_attrs[0] = gfx.ShaderAttrDesc{ - name: c'position' - sem_name: c'POSITION' - sem_index: 0 - } - shader_attrs[1] = gfx.ShaderAttrDesc{ - name: c'texcoord0' - sem_name: c'TEXCOORD' - sem_index: 0 - } - shader_attrs[2] = gfx.ShaderAttrDesc{ - name: c'color0' - sem_name: c'COLOR' - sem_index: 0 +// draw_shadow_rect draws a rounded rectangle drop shadow. +// x, y, w, h specifies the bounding box of the *casting element* (not the shadow itself). +// The shadow geometry is automatically expanded based on the blur radius. +// The shadow is rendered as a "hollow" rim shadow (fading out from the edge in both directions), +// ensuring correct appearance for both filled and transparent containers. +// radius: The corner radius of the casting element. +// blur: The blur radius (standard deviation approximation). +// +// Shadow Logic: +// The shader computes the transparency based on the distance from the rounded rectangle edge. +// It combines a Gaussian-like falloff (for the blur) with a hard clip against the +// casting element's shape (passed via direct offset calculation) to specificy where the shadow starts. +pub fn draw_shadow_rect(x f32, y f32, w f32, h f32, radius f32, blur f32, c gg.Color, offset_x f32, offset_y f32, mut window Window) { + if c.a == 0 { + return } - // Uniform Definitions (Shadow) - // Same layout as standard pipeline: MVP + Texture Matrix. - mut ub_uniforms := [16]gfx.ShaderUniformDesc{} - ub_uniforms[0] = gfx.ShaderUniformDesc{ - name: c'mvp' - @type: .mat4 - array_count: 1 - } - ub_uniforms[1] = gfx.ShaderUniformDesc{ - name: c'tm' - @type: .mat4 - array_count: 1 - } + scale := window.ui.scale + // We draw a larger quad to accommodate the blur + // Padding = blur radius * 1.5 to be safe + blur_pad := blur * 1.5 - // Uniform Block (Shadow) - mut ub := [4]gfx.ShaderUniformBlockDesc{} - ub[0] = gfx.ShaderUniformBlockDesc{ - size: 128 - uniforms: ub_uniforms - } + sx := (x - blur_pad) * scale + sy := (y - blur_pad) * scale + sw := (w + blur_pad * 2) * scale + sh := (h + blur_pad * 2) * scale - // Color Targets (Shadow) - // Same blending as rounded rect: Src Alpha / One Minus Src Alpha. - mut colors := [4]gfx.ColorTargetState{} - colors[0] = gfx.ColorTargetState{ - blend: gfx.BlendState{ - enabled: true - src_factor_rgb: .src_alpha - dst_factor_rgb: .one_minus_src_alpha - src_factor_alpha: .one - dst_factor_alpha: .one_minus_src_alpha - } - write_mask: .rgba - } + r := radius * scale + b := blur * scale - // Images/Samplers setup (standard sgl requirement) - // Texture Images (Shadow) - // Even though our shadow is procedural, sgl requires a texture slot definition. - mut shader_images := [12]gfx.ShaderImageDesc{} - shader_images[0] = gfx.ShaderImageDesc{ - used: true - image_type: ._2d - sample_type: .float - } - // Texture Samplers (Shadow) - mut shader_samplers := [8]gfx.ShaderSamplerDesc{} - shader_samplers[0] = gfx.ShaderSamplerDesc{ - used: true - sampler_type: .filtering - } - // Image-Sampler Pairs (Shadow) - mut shader_image_sampler_pairs := [12]gfx.ShaderImageSamplerPairDesc{} - shader_image_sampler_pairs[0] = gfx.ShaderImageSamplerPairDesc{ - used: true - image_slot: 0 - sampler_slot: 0 - glsl_name: c'tex' - } + ox := offset_x * scale + oy := offset_y * scale - // Shader Description (Shadow) - mut shader_desc := gfx.ShaderDesc{ - attrs: shader_attrs - } + init_shadow_pipeline(mut window) - $if macos { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_shadow_metal.str - entry: c'vs_main' - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_shadow_metal.str - entry: c'fs_main' + // Pass offset via Texture Matrix + sgl.matrix_mode_texture() + sgl.push_matrix() + sgl.load_identity() + // Translate by the NEGATIVE offset because the "clip box" needs to be shifted + // relative to the shadow. + // The shadow is drawn at (x,y) which INCLUDES the offset. + // The casting box is at (x - offset_x, y - offset_y). + // So the coordinate system must be shifted so that (0,0) aligns correctly. + // sgl doesn't have a generic "set uniform" for custom uniforms easily accessible here without breaking abstraction. + // The Translation part of the matrix is used to pass this data. - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } $else { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_shadow_glsl.str - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_shadow_glsl.str - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } - - // Pipeline Description (Shadow) - // Assembles the shadow rendering pipeline. - desc := gfx.PipelineDesc{ - label: c'shadow_pip' - colors: colors - layout: gfx.VertexLayoutState{ - attrs: attrs - buffers: buffers - } - shader: gfx.make_shader(&shader_desc) - } - - window.pip.shadow = sgl.make_pipeline(&desc) -} - -// init_blur_pipeline initializes the pipeline for a standalone Gaussian blur effect. -// It shares the same vertex attributes as the shadow pipeline but uses a specific -// fragment shader intended for blurring content without the complexities of the drop-shadow offset logic. -fn init_blur_pipeline(mut window Window) { - if window.pip.blur.id != 0 { - return - } - - mut attrs := [16]gfx.VertexAttrDesc{} - // Attribute 0: Position & Packed Params - // The Z component carries the blur radius and corner radius data to the shader. - attrs[0] = gfx.VertexAttrDesc{ - format: .float3 - offset: 0 - buffer_index: 0 - } - // Attribute 1: Texture Coordinates - // Used to compute the distance from the center of the shape (SDF). - attrs[1] = gfx.VertexAttrDesc{ - format: .float2 - offset: 12 - buffer_index: 0 - } - // Attribute 2: Vertex Color - // Base color of the shape, multiplied by the calculated alpha from the SDF. - attrs[2] = gfx.VertexAttrDesc{ - format: .ubyte4n - offset: 20 - buffer_index: 0 - } - - mut buffers := [8]gfx.VertexBufferLayoutState{} - buffers[0] = gfx.VertexBufferLayoutState{ - stride: 24 - } - - mut shader_attrs := [16]gfx.ShaderAttrDesc{} - // Blur Mapping: - // Identical mapping for the blur shader. - shader_attrs[0] = gfx.ShaderAttrDesc{ - name: c'position' - sem_name: c'POSITION' - sem_index: 0 - } - shader_attrs[1] = gfx.ShaderAttrDesc{ - name: c'texcoord0' - sem_name: c'TEXCOORD' - sem_index: 0 - } - shader_attrs[2] = gfx.ShaderAttrDesc{ - name: c'color0' - sem_name: c'COLOR' - sem_index: 0 - } - - // Uniform Definitions (Blur) - // Same layout as standard pipeline: MVP + Texture Matrix. - mut ub_uniforms := [16]gfx.ShaderUniformDesc{} - ub_uniforms[0] = gfx.ShaderUniformDesc{ - name: c'mvp' - @type: .mat4 - array_count: 1 - } - ub_uniforms[1] = gfx.ShaderUniformDesc{ - name: c'tm' - @type: .mat4 - array_count: 1 - } - - // Uniform Block (Blur) - mut ub := [4]gfx.ShaderUniformBlockDesc{} - ub[0] = gfx.ShaderUniformBlockDesc{ - size: 128 - uniforms: ub_uniforms - } - - // Color Targets (Blur) - // Same blending as rounded rect: Src Alpha / One Minus Src Alpha. - mut colors := [4]gfx.ColorTargetState{} - colors[0] = gfx.ColorTargetState{ - blend: gfx.BlendState{ - enabled: true - src_factor_rgb: .src_alpha - dst_factor_rgb: .one_minus_src_alpha - src_factor_alpha: .one - dst_factor_alpha: .one_minus_src_alpha - } - write_mask: .rgba - } - - // Texture Images (Blur) - mut shader_images := [12]gfx.ShaderImageDesc{} - shader_images[0] = gfx.ShaderImageDesc{ - used: true - image_type: ._2d - sample_type: .float - } - // Texture Samplers (Blur) - mut shader_samplers := [8]gfx.ShaderSamplerDesc{} - shader_samplers[0] = gfx.ShaderSamplerDesc{ - used: true - sampler_type: .filtering // Linear filtering. - } - // Image-Sampler Pairs (Blur) - mut shader_image_sampler_pairs := [12]gfx.ShaderImageSamplerPairDesc{} - shader_image_sampler_pairs[0] = gfx.ShaderImageSamplerPairDesc{ - used: true - image_slot: 0 - sampler_slot: 0 - glsl_name: c'tex' - } - - // Shader Description (Blur) - mut shader_desc := gfx.ShaderDesc{ - attrs: shader_attrs - } - - $if macos { - shader_desc.vs = gfx.ShaderStageDesc{ - // Reusing shadow vertex shader as it has params/offset - source: vs_shadow_metal.str - entry: c'vs_main' - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_blur_metal.str - entry: c'fs_main' - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } $else { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_shadow_glsl.str - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_blur_glsl.str - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } - - // Pipeline Description (Blur) - // Assembles the blur rendering pipeline. - desc := gfx.PipelineDesc{ - label: c'blur_pip' - colors: colors - layout: gfx.VertexLayoutState{ - attrs: attrs - buffers: buffers - } - shader: gfx.make_shader(&shader_desc) - } - - window.pip.blur = sgl.make_pipeline(&desc) -} - -// init_gradient_pipeline initializes the pipeline for multi-stop gradient rendering. -// It uses custom shaders (vs_gradient/fs_gradient) that implement CSS-style gradients -// with 3 color stops packed into the tm uniform matrix. -fn init_gradient_pipeline(mut window Window) { - if window.pip.gradient.id != 0 { - return - } - - mut attrs := [16]gfx.VertexAttrDesc{} - // Attribute 0: Position (x, y, z) - attrs[0] = gfx.VertexAttrDesc{ - format: .float3 - offset: 0 - buffer_index: 0 - } - // Attribute 1: Texture Coordinates (u, v) - attrs[1] = gfx.VertexAttrDesc{ - format: .float2 - offset: 12 - buffer_index: 0 - } - // Attribute 2: Color (r, g, b, a) - attrs[2] = gfx.VertexAttrDesc{ - format: .ubyte4n - offset: 20 - buffer_index: 0 - } - - mut buffers := [8]gfx.VertexBufferLayoutState{} - buffers[0] = gfx.VertexBufferLayoutState{ - stride: 24 - } - - mut shader_attrs := [16]gfx.ShaderAttrDesc{} - shader_attrs[0] = gfx.ShaderAttrDesc{ - name: c'position' - sem_name: c'POSITION' - sem_index: 0 - } - shader_attrs[1] = gfx.ShaderAttrDesc{ - name: c'texcoord0' - sem_name: c'TEXCOORD' - sem_index: 0 - } - shader_attrs[2] = gfx.ShaderAttrDesc{ - name: c'color0' - sem_name: c'COLOR' - sem_index: 0 - } - - // Uniform Definitions (Gradient) - // tm matrix carries gradient stop data: tm[0..2] as vec4(r,g,b,pos) - mut ub_uniforms := [16]gfx.ShaderUniformDesc{} - ub_uniforms[0] = gfx.ShaderUniformDesc{ - name: c'mvp' - @type: .mat4 - array_count: 1 - } - ub_uniforms[1] = gfx.ShaderUniformDesc{ - name: c'tm' - @type: .mat4 - array_count: 1 - } - - // Uniform Block (Gradient) - mut ub := [4]gfx.ShaderUniformBlockDesc{} - ub[0] = gfx.ShaderUniformBlockDesc{ - size: 128 - uniforms: ub_uniforms - } - - // Color Targets (Gradient) - // Alpha blending for gradient transparency - mut colors := [4]gfx.ColorTargetState{} - colors[0] = gfx.ColorTargetState{ - blend: gfx.BlendState{ - enabled: true - src_factor_rgb: .src_alpha - dst_factor_rgb: .one_minus_src_alpha - src_factor_alpha: .one - dst_factor_alpha: .one_minus_src_alpha - } - write_mask: .rgba - } - - // Texture Images (Gradient) - mut shader_images := [12]gfx.ShaderImageDesc{} - shader_images[0] = gfx.ShaderImageDesc{ - used: true - image_type: ._2d - sample_type: .float - } - // Texture Samplers (Gradient) - mut shader_samplers := [8]gfx.ShaderSamplerDesc{} - shader_samplers[0] = gfx.ShaderSamplerDesc{ - used: true - sampler_type: .filtering - } - // Image-Sampler Pairs (Gradient) - mut shader_image_sampler_pairs := [12]gfx.ShaderImageSamplerPairDesc{} - shader_image_sampler_pairs[0] = gfx.ShaderImageSamplerPairDesc{ - used: true - image_slot: 0 - sampler_slot: 0 - glsl_name: c'tex' - } - - // Shader Description (Gradient) - mut shader_desc := gfx.ShaderDesc{ - attrs: shader_attrs - } - - $if macos { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_gradient_metal.str - entry: c'vs_main' - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_gradient_metal.str - entry: c'fs_main' - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } $else { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_gradient_glsl.str - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_gradient_glsl.str - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } - - // Pipeline Description (Gradient) - desc := gfx.PipelineDesc{ - label: c'gradient_pip' - colors: colors - layout: gfx.VertexLayoutState{ - attrs: attrs - buffers: buffers - } - shader: gfx.make_shader(&shader_desc) - } - - window.pip.gradient = sgl.make_pipeline(&desc) -} - -// draw_shadow_rect draws a rounded rectangle drop shadow. -// x, y, w, h specifies the bounding box of the *casting element* (not the shadow itself). -// The shadow geometry is automatically expanded based on the blur radius. -// The shadow is rendered as a "hollow" rim shadow (fading out from the edge in both directions), -// ensuring correct appearance for both filled and transparent containers. -// radius: The corner radius of the casting element. -// blur: The blur radius (standard deviation approximation). -// -// Shadow Logic: -// The shader computes the transparency based on the distance from the rounded rectangle edge. -// It combines a Gaussian-like falloff (for the blur) with a hard clip against the -// casting element's shape (passed via direct offset calculation) to specificy where the shadow starts. -pub fn draw_shadow_rect(x f32, y f32, w f32, h f32, radius f32, blur f32, c gg.Color, offset_x f32, offset_y f32, mut window Window) { - if c.a == 0 { - return - } - - scale := window.ui.scale - // We draw a larger quad to accommodate the blur - // Padding = blur radius * 1.5 to be safe - blur_pad := blur * 1.5 - - sx := (x - blur_pad) * scale - sy := (y - blur_pad) * scale - sw := (w + blur_pad * 2) * scale - sh := (h + blur_pad * 2) * scale - - r := radius * scale - b := blur * scale - - ox := offset_x * scale - oy := offset_y * scale - - init_shadow_pipeline(mut window) - - // Pass offset via Texture Matrix - sgl.matrix_mode_texture() - sgl.push_matrix() - sgl.load_identity() - // Translate by the NEGATIVE offset because the "clip box" needs to be shifted - // relative to the shadow. - // The shadow is drawn at (x,y) which INCLUDES the offset. - // The casting box is at (x - offset_x, y - offset_y). - // So the coordinate system must be shifted so that (0,0) aligns correctly. - // sgl doesn't have a generic "set uniform" for custom uniforms easily accessible here without breaking abstraction. - // The Translation part of the matrix is used to pass this data. - - sgl.translate(ox, oy, 0.0) - - sgl.load_pipeline(window.pip.shadow) - sgl.c4b(c.r, c.g, c.b, c.a) - - // Pack radius and blur using the fixed-point packer. - z_val := pack_shader_params(r, b) - - draw_quad(sx, sy, sw, sh, z_val) - sgl.load_default_pipeline() - sgl.c4b(255, 255, 255, 255) // Reset color state - - sgl.pop_matrix() - sgl.matrix_mode_modelview() -} - -// draw_rounded_rect_filled draws a solid rounded rectangle using SDF shading. -// The shape is mathematically defined in the fragment shader, allowing for infinite resolution -// and perfect anti-aliasing. -pub fn draw_rounded_rect_filled(x f32, y f32, w f32, h f32, radius f32, c gg.Color, mut window Window) { - if w <= 0 || h <= 0 { - return - } - - scale := window.ui.scale - sx := x * scale - sy := y * scale - sw := w * scale - sh := h * scale - mut r := radius * scale - - // Clamp radius - min_dim := if sw < sh { sw } else { sh } - if r > min_dim / 2.0 { - r = min_dim / 2.0 - } - if r < 0 { - r = 0 - } - - if !init_rounded_rect_pipeline(mut window) { - return - } - - sgl.load_pipeline(window.pip.rounded_rect) - sgl.c4b(c.r, c.g, c.b, c.a) - - z_val := pack_shader_params(r, 0) - - draw_quad(sx, sy, sw, sh, z_val) - sgl.load_default_pipeline() -} - -// draw_rounded_rect_empty draws a bordered (stroked) rounded rectangle. -// It uses the same SDF logic as the filled rect but subtracts an inner shape -// based on the thickness parameter to create the border. -pub fn draw_rounded_rect_empty(x f32, y f32, w f32, h f32, radius f32, thickness f32, c gg.Color, mut window Window) { - if w <= 0 || h <= 0 { - return - } - - scale := window.ui.scale - sx := x * scale - sy := y * scale - sw := w * scale - sh := h * scale - mut r := radius * scale - - min_dim := if sw < sh { sw } else { sh } - if r > min_dim / 2.0 { - r = min_dim / 2.0 - } - if r < 0 { - r = 0 - } - - if !init_rounded_rect_pipeline(mut window) { - return - } - - sgl.load_pipeline(window.pip.rounded_rect) - sgl.c4b(c.r, c.g, c.b, c.a) - - // Pack radius and stroke thickness. - z_val := pack_shader_params(r, thickness * scale) - - draw_quad(sx, sy, sw, sh, z_val) - sgl.load_default_pipeline() -} - -// init_stencil_pipelines creates two sgl pipelines for clipPath -// stencil clipping: -// stencil_write_pip: writes 1 to stencil, no color output -// stencil_test_pip: draws only where stencil == 1 -fn init_stencil_pipelines(mut window Window) { - if window.pip.stencil_write.id == 0 { - // Stencil write: always pass, replace with ref=1, - // disable color writes. - mut colors_w := [4]gfx.ColorTargetState{} - colors_w[0] = gfx.ColorTargetState{ - write_mask: .none - } - desc_w := gfx.PipelineDesc{ - label: c'stencil_write_pip' - colors: colors_w - stencil: gfx.StencilState{ - enabled: true - front: gfx.StencilFaceState{ - compare: .always - pass_op: .replace - fail_op: .keep - depth_fail_op: .keep - } - back: gfx.StencilFaceState{ - compare: .always - pass_op: .replace - fail_op: .keep - depth_fail_op: .keep - } - read_mask: 0xFF - write_mask: 0xFF - ref: 1 - } - } - window.pip.stencil_write = sgl.make_pipeline(&desc_w) - } - - if window.pip.stencil_test.id == 0 { - // Stencil test: draw only where stencil == ref(1), - // normal alpha blending. - mut colors_t := [4]gfx.ColorTargetState{} - colors_t[0] = gfx.ColorTargetState{ - blend: gfx.BlendState{ - enabled: true - src_factor_rgb: .src_alpha - dst_factor_rgb: .one_minus_src_alpha - src_factor_alpha: .one - dst_factor_alpha: .one_minus_src_alpha - } - write_mask: .rgba - } - desc_t := gfx.PipelineDesc{ - label: c'stencil_test_pip' - colors: colors_t - stencil: gfx.StencilState{ - enabled: true - front: gfx.StencilFaceState{ - compare: .equal - pass_op: .keep - fail_op: .keep - depth_fail_op: .keep - } - back: gfx.StencilFaceState{ - compare: .equal - pass_op: .keep - fail_op: .keep - depth_fail_op: .keep - } - read_mask: 0xFF - write_mask: 0x00 - ref: 1 - } - } - window.pip.stencil_test = sgl.make_pipeline(&desc_t) - } - - if window.pip.stencil_clear.id == 0 { - // Stencil clear: write ref=0 to reset stencil bits, - // no color output. - mut colors_c := [4]gfx.ColorTargetState{} - colors_c[0] = gfx.ColorTargetState{ - write_mask: .none - } - desc_c := gfx.PipelineDesc{ - label: c'stencil_clear_pip' - colors: colors_c - stencil: gfx.StencilState{ - enabled: true - front: gfx.StencilFaceState{ - compare: .always - pass_op: .replace - fail_op: .keep - depth_fail_op: .keep - } - back: gfx.StencilFaceState{ - compare: .always - pass_op: .replace - fail_op: .keep - depth_fail_op: .keep - } - read_mask: 0xFF - write_mask: 0xFF - ref: 0 - } - } - window.pip.stencil_clear = sgl.make_pipeline(&desc_c) - } -} - -// init_custom_pipeline creates and caches a pipeline for a custom -// fragment shader. Pipelines are keyed by source hash so identical -// shader bodies share a single compiled pipeline. -fn init_custom_pipeline(shader &Shader, mut window Window) sgl.Pipeline { - key := shader_hash(shader) - if pip := window.pip.custom[key] { - return pip - } - - mut attrs := [16]gfx.VertexAttrDesc{} - attrs[0] = gfx.VertexAttrDesc{ - format: .float3 - offset: 0 - buffer_index: 0 - } - attrs[1] = gfx.VertexAttrDesc{ - format: .float2 - offset: 12 - buffer_index: 0 - } - attrs[2] = gfx.VertexAttrDesc{ - format: .ubyte4n - offset: 20 - buffer_index: 0 - } - - mut buffers := [8]gfx.VertexBufferLayoutState{} - buffers[0] = gfx.VertexBufferLayoutState{ - stride: 24 - } - - mut shader_attrs := [16]gfx.ShaderAttrDesc{} - shader_attrs[0] = gfx.ShaderAttrDesc{ - name: c'position' - sem_name: c'POSITION' - sem_index: 0 - } - shader_attrs[1] = gfx.ShaderAttrDesc{ - name: c'texcoord0' - sem_name: c'TEXCOORD' - sem_index: 0 - } - shader_attrs[2] = gfx.ShaderAttrDesc{ - name: c'color0' - sem_name: c'COLOR' - sem_index: 0 - } - - mut ub_uniforms := [16]gfx.ShaderUniformDesc{} - ub_uniforms[0] = gfx.ShaderUniformDesc{ - name: c'mvp' - @type: .mat4 - array_count: 1 - } - ub_uniforms[1] = gfx.ShaderUniformDesc{ - name: c'tm' - @type: .mat4 - array_count: 1 - } - - mut ub := [4]gfx.ShaderUniformBlockDesc{} - ub[0] = gfx.ShaderUniformBlockDesc{ - size: 128 - uniforms: ub_uniforms - } - - mut colors := [4]gfx.ColorTargetState{} - colors[0] = gfx.ColorTargetState{ - blend: gfx.BlendState{ - enabled: true - src_factor_rgb: .src_alpha - dst_factor_rgb: .one_minus_src_alpha - src_factor_alpha: .one - dst_factor_alpha: .one_minus_src_alpha - } - write_mask: .rgba - } - - mut shader_images := [12]gfx.ShaderImageDesc{} - shader_images[0] = gfx.ShaderImageDesc{ - used: true - image_type: ._2d - sample_type: .float - } - - mut shader_samplers := [8]gfx.ShaderSamplerDesc{} - shader_samplers[0] = gfx.ShaderSamplerDesc{ - used: true - sampler_type: .filtering - } - - mut shader_image_sampler_pairs := [12]gfx.ShaderImageSamplerPairDesc{} - shader_image_sampler_pairs[0] = gfx.ShaderImageSamplerPairDesc{ - used: true - image_slot: 0 - sampler_slot: 0 - glsl_name: c'tex' - } - - mut shader_desc := gfx.ShaderDesc{ - attrs: shader_attrs - } - - $if macos { - fs_source := build_metal_fragment(shader.metal) - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_custom_metal.str - entry: c'vs_main' - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_source.str - entry: c'fs_main' - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } $else { - fs_source := build_glsl_fragment(shader.glsl) - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_custom_glsl.str - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_source.str - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } - - desc := gfx.PipelineDesc{ - label: c'custom_shader_pip' - colors: colors - layout: gfx.VertexLayoutState{ - attrs: attrs - buffers: buffers - } - shader: gfx.make_shader(&shader_desc) - } - - pip := sgl.make_pipeline(&desc) - window.pip.custom[key] = pip - return pip -} - -// draw_custom_shader_rect draws a rounded rectangle filled by a -// custom fragment shader. User params are loaded into the tm matrix. -pub fn draw_custom_shader_rect(x f32, y f32, w f32, h f32, radius f32, c gg.Color, shader &Shader, mut window Window) { - if w <= 0 || h <= 0 { - return - } - - scale := window.ui.scale - sx := x * scale - sy := y * scale - sw := w * scale - sh := h * scale - mut r := radius * scale - - min_dim := if sw < sh { sw } else { sh } - if r > min_dim / 2.0 { - r = min_dim / 2.0 - } - if r < 0 { - r = 0 - } - - pip := init_custom_pipeline(shader, mut window) - - // Load user params into tm matrix - sgl.matrix_mode_texture() - sgl.push_matrix() - - mut tm_data := [16]f32{} - max_params := if shader.params.len > 16 { 16 } else { shader.params.len } - for i in 0 .. max_params { - tm_data[i] = shader.params[i] - } - sgl.load_matrix(tm_data[0..]) + sgl.translate(ox, oy, 0.0) - sgl.load_pipeline(pip) + sgl.load_pipeline(window.pip.shadow) sgl.c4b(c.r, c.g, c.b, c.a) - z_val := pack_shader_params(r, 0) - draw_quad(sx, sy, sw, sh, z_val) - - sgl.load_default_pipeline() - sgl.c4b(255, 255, 255, 255) - sgl.pop_matrix() - sgl.matrix_mode_modelview() -} - -// FilterVertex matches the SGL vertex layout (24 bytes): -// position(float3) + texcoord(float2) + color(ubyte4n). -struct FilterVertex { - x f32 - y f32 - z f32 - u f32 - v f32 - r u8 - g u8 - b u8 - a u8 -} - -// ortho_column_major builds an orthographic projection matrix -// in column-major order (Metal/GL convention). -fn ortho_column_major(l f32, r f32, b f32, t f32, n f32, f f32) [16]f32 { - mut m := [16]f32{} - m[0] = 2.0 / (r - l) - m[5] = 2.0 / (t - b) - m[10] = -2.0 / (f - n) - m[12] = -(r + l) / (r - l) - m[13] = -(t + b) / (t - b) - m[14] = -(f + n) / (f - n) - m[15] = 1.0 - return m -} - -// make_filter_gfx_pipeline creates a raw gfx.Pipeline for offscreen -// rendering (blur passes). Uses images/samplers for texture sampling. -fn make_filter_gfx_pipeline(vs_src string, fs_src string, vs_entry &u8, fs_entry &u8, glsl_sampler_name &u8) gfx.Pipeline { - mut attrs := [16]gfx.VertexAttrDesc{} - attrs[0] = gfx.VertexAttrDesc{ - format: .float3 - offset: 0 - } - attrs[1] = gfx.VertexAttrDesc{ - format: .float2 - offset: 12 - } - attrs[2] = gfx.VertexAttrDesc{ - format: .ubyte4n - offset: 20 - } - mut buffers := [8]gfx.VertexBufferLayoutState{} - buffers[0] = gfx.VertexBufferLayoutState{ - stride: 24 - } - layout := gfx.VertexLayoutState{ - attrs: attrs - buffers: buffers - } - - mut shader_attrs := [16]gfx.ShaderAttrDesc{} - shader_attrs[0] = gfx.ShaderAttrDesc{ - name: c'position' - sem_name: c'POSITION' - } - shader_attrs[1] = gfx.ShaderAttrDesc{ - name: c'texcoord0' - sem_name: c'TEXCOORD' - sem_index: 0 - } - shader_attrs[2] = gfx.ShaderAttrDesc{ - name: c'color0' - sem_name: c'COLOR' - sem_index: 0 - } - - mut ub_uniforms := [16]gfx.ShaderUniformDesc{} - ub_uniforms[0] = gfx.ShaderUniformDesc{ - name: c'mvp' - @type: .mat4 - array_count: 1 - } - ub_uniforms[1] = gfx.ShaderUniformDesc{ - name: c'tm' - @type: .mat4 - array_count: 1 - } - mut ub := [4]gfx.ShaderUniformBlockDesc{} - ub[0] = gfx.ShaderUniformBlockDesc{ - size: 128 - uniforms: ub_uniforms - } - - mut colors := [4]gfx.ColorTargetState{} - colors[0] = gfx.ColorTargetState{ - blend: gfx.BlendState{ - enabled: true - src_factor_rgb: .src_alpha - dst_factor_rgb: .one_minus_src_alpha - src_factor_alpha: .one - dst_factor_alpha: .one_minus_src_alpha - } - write_mask: .rgba - } + // Pack radius and blur using the fixed-point packer. + z_val := pack_shader_params(r, b) - mut shader_images := [12]gfx.ShaderImageDesc{} - shader_images[0] = gfx.ShaderImageDesc{ - used: true - image_type: ._2d - sample_type: .float - } - mut shader_samplers := [8]gfx.ShaderSamplerDesc{} - shader_samplers[0] = gfx.ShaderSamplerDesc{ - used: true - sampler_type: .filtering - } - mut shader_image_sampler_pairs := [12]gfx.ShaderImageSamplerPairDesc{} - unsafe { - shader_image_sampler_pairs[0] = gfx.ShaderImageSamplerPairDesc{ - used: true - image_slot: 0 - sampler_slot: 0 - glsl_name: glsl_sampler_name - } - } - mut shader_desc := gfx.ShaderDesc{ - attrs: shader_attrs - } - $if macos { - unsafe { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_src.str - entry: vs_entry - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_src.str - entry: fs_entry - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } - } $else { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_src.str - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_src.str - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } + draw_quad(sx, sy, sw, sh, z_val) + sgl.load_default_pipeline() + sgl.c4b(255, 255, 255, 255) // Reset color state - return gfx.make_pipeline(&gfx.PipelineDesc{ - label: c'filter_gfx_pip' - layout: layout - colors: colors - shader: gfx.make_shader(&shader_desc) - }) + sgl.pop_matrix() + sgl.matrix_mode_modelview() } -// make_content_gfx_pipeline creates a raw gfx.Pipeline for rendering -// colored triangles to offscreen texture (no texture sampling). -fn make_content_gfx_pipeline(vs_src string, fs_src string, vs_entry &u8, fs_entry &u8) gfx.Pipeline { - mut attrs := [16]gfx.VertexAttrDesc{} - attrs[0] = gfx.VertexAttrDesc{ - format: .float3 - offset: 0 - } - attrs[1] = gfx.VertexAttrDesc{ - format: .float2 - offset: 12 - } - attrs[2] = gfx.VertexAttrDesc{ - format: .ubyte4n - offset: 20 +// draw_rounded_rect_filled draws a solid rounded rectangle using SDF shading. +// The shape is mathematically defined in the fragment shader, allowing for infinite resolution +// and perfect anti-aliasing. +pub fn draw_rounded_rect_filled(x f32, y f32, w f32, h f32, radius f32, c gg.Color, mut window Window) { + if w <= 0 || h <= 0 { + return } - mut buffers := [8]gfx.VertexBufferLayoutState{} - buffers[0] = gfx.VertexBufferLayoutState{ - stride: 24 + + scale := window.ui.scale + sx := x * scale + sy := y * scale + sw := w * scale + sh := h * scale + mut r := radius * scale + + // Clamp radius + min_dim := if sw < sh { sw } else { sh } + if r > min_dim / 2.0 { + r = min_dim / 2.0 } - layout := gfx.VertexLayoutState{ - attrs: attrs - buffers: buffers + if r < 0 { + r = 0 } - mut shader_attrs := [16]gfx.ShaderAttrDesc{} - shader_attrs[0] = gfx.ShaderAttrDesc{ - name: c'position' - sem_name: c'POSITION' - } - shader_attrs[1] = gfx.ShaderAttrDesc{ - name: c'texcoord0' - sem_name: c'TEXCOORD' - sem_index: 0 + if !init_rounded_rect_pipeline(mut window) { + return } - shader_attrs[2] = gfx.ShaderAttrDesc{ - name: c'color0' - sem_name: c'COLOR' - sem_index: 0 + + sgl.load_pipeline(window.pip.rounded_rect) + sgl.c4b(c.r, c.g, c.b, c.a) + + z_val := pack_shader_params(r, 0) + + draw_quad(sx, sy, sw, sh, z_val) + sgl.load_default_pipeline() +} + +// draw_rounded_rect_empty draws a bordered (stroked) rounded rectangle. +// It uses the same SDF logic as the filled rect but subtracts an inner shape +// based on the thickness parameter to create the border. +pub fn draw_rounded_rect_empty(x f32, y f32, w f32, h f32, radius f32, thickness f32, c gg.Color, mut window Window) { + if w <= 0 || h <= 0 { + return } - mut ub_uniforms := [16]gfx.ShaderUniformDesc{} - ub_uniforms[0] = gfx.ShaderUniformDesc{ - name: c'mvp' - @type: .mat4 - array_count: 1 + scale := window.ui.scale + sx := x * scale + sy := y * scale + sw := w * scale + sh := h * scale + mut r := radius * scale + + min_dim := if sw < sh { sw } else { sh } + if r > min_dim / 2.0 { + r = min_dim / 2.0 } - ub_uniforms[1] = gfx.ShaderUniformDesc{ - name: c'tm' - @type: .mat4 - array_count: 1 + if r < 0 { + r = 0 } - mut ub := [4]gfx.ShaderUniformBlockDesc{} - ub[0] = gfx.ShaderUniformBlockDesc{ - size: 128 - uniforms: ub_uniforms + + if !init_rounded_rect_pipeline(mut window) { + return } - mut colors := [4]gfx.ColorTargetState{} - colors[0] = gfx.ColorTargetState{ - blend: gfx.BlendState{ - enabled: true - src_factor_rgb: .src_alpha - dst_factor_rgb: .one_minus_src_alpha - src_factor_alpha: .one - dst_factor_alpha: .one_minus_src_alpha + sgl.load_pipeline(window.pip.rounded_rect) + sgl.c4b(c.r, c.g, c.b, c.a) + + // Pack radius and stroke thickness. + z_val := pack_shader_params(r, thickness * scale) + + draw_quad(sx, sy, sw, sh, z_val) + sgl.load_default_pipeline() +} + +// init_stencil_pipelines creates two sgl pipelines for clipPath +// stencil clipping: +// stencil_write_pip: writes 1 to stencil, no color output +// stencil_test_pip: draws only where stencil == 1 +fn init_stencil_pipelines(mut window Window) { + if window.pip.stencil_write.id == 0 { + // Stencil write: always pass, replace with ref=1, + // disable color writes. + mut colors_w := [4]gfx.ColorTargetState{} + colors_w[0] = gfx.ColorTargetState{ + write_mask: .none } - write_mask: .rgba + desc_w := gfx.PipelineDesc{ + label: c'stencil_write_pip' + colors: colors_w + stencil: gfx.StencilState{ + enabled: true + front: gfx.StencilFaceState{ + compare: .always + pass_op: .replace + fail_op: .keep + depth_fail_op: .keep + } + back: gfx.StencilFaceState{ + compare: .always + pass_op: .replace + fail_op: .keep + depth_fail_op: .keep + } + read_mask: 0xFF + write_mask: 0xFF + ref: 1 + } + } + window.pip.stencil_write = sgl.make_pipeline(&desc_w) } - mut shader_desc := gfx.ShaderDesc{ - attrs: shader_attrs - } - $if macos { - unsafe { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_src.str - entry: vs_entry - uniform_blocks: ub + if window.pip.stencil_test.id == 0 { + // Stencil test: draw only where stencil == ref(1), + // normal alpha blending. + mut colors_t := [4]gfx.ColorTargetState{} + colors_t[0] = gfx.ColorTargetState{ + blend: gfx.BlendState{ + enabled: true + src_factor_rgb: .src_alpha + dst_factor_rgb: .one_minus_src_alpha + src_factor_alpha: .one + dst_factor_alpha: .one_minus_src_alpha } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_src.str - entry: fs_entry + write_mask: .rgba + } + desc_t := gfx.PipelineDesc{ + label: c'stencil_test_pip' + colors: colors_t + stencil: gfx.StencilState{ + enabled: true + front: gfx.StencilFaceState{ + compare: .equal + pass_op: .keep + fail_op: .keep + depth_fail_op: .keep + } + back: gfx.StencilFaceState{ + compare: .equal + pass_op: .keep + fail_op: .keep + depth_fail_op: .keep + } + read_mask: 0xFF + write_mask: 0x00 + ref: 1 } } - } $else { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_src.str - uniform_blocks: ub + window.pip.stencil_test = sgl.make_pipeline(&desc_t) + } + + if window.pip.stencil_clear.id == 0 { + // Stencil clear: write ref=0 to reset stencil bits, + // no color output. + mut colors_c := [4]gfx.ColorTargetState{} + colors_c[0] = gfx.ColorTargetState{ + write_mask: .none } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_src.str + desc_c := gfx.PipelineDesc{ + label: c'stencil_clear_pip' + colors: colors_c + stencil: gfx.StencilState{ + enabled: true + front: gfx.StencilFaceState{ + compare: .always + pass_op: .replace + fail_op: .keep + depth_fail_op: .keep + } + back: gfx.StencilFaceState{ + compare: .always + pass_op: .replace + fail_op: .keep + depth_fail_op: .keep + } + read_mask: 0xFF + write_mask: 0xFF + ref: 0 + } } + window.pip.stencil_clear = sgl.make_pipeline(&desc_c) } - - return gfx.make_pipeline(&gfx.PipelineDesc{ - label: c'content_gfx_pip' - layout: layout - colors: colors - shader: gfx.make_shader(&shader_desc) - }) } -// make_filter_sgl_pipeline creates an SGL pipeline for compositing -// the blurred result onto the swapchain. -fn make_filter_sgl_pipeline(ctx sgl.Context, vs_src string, fs_src string, vs_entry &u8, fs_entry &u8, glsl_sampler_name &u8) sgl.Pipeline { +// init_custom_pipeline creates and caches a pipeline for a custom +// fragment shader. Pipelines are keyed by source hash so identical +// shader bodies share a single compiled pipeline. +fn init_custom_pipeline(shader &Shader, mut window Window) sgl.Pipeline { + key := shader_hash(shader) + if pip := window.pip.custom[key] { + return pip + } + $if windows && sokol_d3d11 ? { + log.warn('custom GLSL/Metal shaders are not supported with -d sokol_d3d11; using rounded-rect fallback') + pip := sgl.Pipeline{} + window.pip.custom[key] = pip + return pip + } + mut attrs := [16]gfx.VertexAttrDesc{} attrs[0] = gfx.VertexAttrDesc{ - format: .float3 - offset: 0 + format: .float3 + offset: 0 + buffer_index: 0 } attrs[1] = gfx.VertexAttrDesc{ - format: .float2 - offset: 12 + format: .float2 + offset: 12 + buffer_index: 0 } attrs[2] = gfx.VertexAttrDesc{ - format: .ubyte4n - offset: 20 + format: .ubyte4n + offset: 20 + buffer_index: 0 } + mut buffers := [8]gfx.VertexBufferLayoutState{} buffers[0] = gfx.VertexBufferLayoutState{ stride: 24 } - layout := gfx.VertexLayoutState{ - attrs: attrs - buffers: buffers - } mut shader_attrs := [16]gfx.ShaderAttrDesc{} shader_attrs[0] = gfx.ShaderAttrDesc{ - name: c'position' - sem_name: c'POSITION' + name: c'position' + sem_name: c'POSITION' + sem_index: 0 } shader_attrs[1] = gfx.ShaderAttrDesc{ name: c'texcoord0' @@ -1495,6 +514,7 @@ fn make_filter_sgl_pipeline(ctx sgl.Context, vs_src string, fs_src string, vs_en @type: .mat4 array_count: 1 } + mut ub := [4]gfx.ShaderUniformBlockDesc{} ub[0] = gfx.ShaderUniformBlockDesc{ size: 128 @@ -1519,57 +539,159 @@ fn make_filter_sgl_pipeline(ctx sgl.Context, vs_src string, fs_src string, vs_en image_type: ._2d sample_type: .float } + mut shader_samplers := [8]gfx.ShaderSamplerDesc{} shader_samplers[0] = gfx.ShaderSamplerDesc{ used: true sampler_type: .filtering } + mut shader_image_sampler_pairs := [12]gfx.ShaderImageSamplerPairDesc{} - unsafe { - shader_image_sampler_pairs[0] = gfx.ShaderImageSamplerPairDesc{ - used: true - image_slot: 0 - sampler_slot: 0 - glsl_name: glsl_sampler_name - } + shader_image_sampler_pairs[0] = gfx.ShaderImageSamplerPairDesc{ + used: true + image_slot: 0 + sampler_slot: 0 + glsl_name: c'tex' } + mut shader_desc := gfx.ShaderDesc{ attrs: shader_attrs } + $if macos { - unsafe { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_src.str - entry: vs_entry - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_src.str - entry: fs_entry - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } + fs_source := build_metal_fragment(shader.metal) + shader_desc.vs = gfx.ShaderStageDesc{ + source: vs_custom_metal.str + entry: c'vs_main' + uniform_blocks: ub + } + shader_desc.fs = gfx.ShaderStageDesc{ + source: fs_source.str + entry: c'fs_main' + images: shader_images + samplers: shader_samplers + image_sampler_pairs: shader_image_sampler_pairs } } $else { + fs_source := build_glsl_fragment(shader.glsl) shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_src.str + source: vs_custom_glsl.str uniform_blocks: ub } shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_src.str + source: fs_source.str images: shader_images samplers: shader_samplers image_sampler_pairs: shader_image_sampler_pairs } } - return sgl.context_make_pipeline(ctx, &gfx.PipelineDesc{ - label: c'filter_sgl_pip' - layout: layout + desc := gfx.PipelineDesc{ + label: c'custom_shader_pip' colors: colors + layout: gfx.VertexLayoutState{ + attrs: attrs + buffers: buffers + } shader: gfx.make_shader(&shader_desc) - }) + } + + pip := sgl.make_pipeline(&desc) + window.pip.custom[key] = pip + return pip +} + +// draw_custom_shader_rect draws a rounded rectangle filled by a +// custom fragment shader. User params are loaded into the tm matrix. +pub fn draw_custom_shader_rect(x f32, y f32, w f32, h f32, radius f32, c gg.Color, shader &Shader, mut window Window) { + if w <= 0 || h <= 0 { + return + } + + scale := window.ui.scale + sx := x * scale + sy := y * scale + sw := w * scale + sh := h * scale + mut r := radius * scale + + min_dim := if sw < sh { sw } else { sh } + if r > min_dim / 2.0 { + r = min_dim / 2.0 + } + if r < 0 { + r = 0 + } + + pip := init_custom_pipeline(shader, mut window) + if pip.id == 0 { + $if windows && sokol_d3d11 ? { + draw_rounded_rect_filled(x, y, w, h, radius, c, mut window) + } + return + } + + // Load user params into tm matrix + sgl.matrix_mode_texture() + sgl.push_matrix() + + mut tm_data := [16]f32{} + max_params := if shader.params.len > 16 { 16 } else { shader.params.len } + for i in 0 .. max_params { + tm_data[i] = shader.params[i] + } + sgl.load_matrix(tm_data[0..]) + + sgl.load_pipeline(pip) + sgl.c4b(c.r, c.g, c.b, c.a) + + z_val := pack_shader_params(r, 0) + draw_quad(sx, sy, sw, sh, z_val) + + sgl.load_default_pipeline() + sgl.c4b(255, 255, 255, 255) + sgl.pop_matrix() + sgl.matrix_mode_modelview() +} + +// FilterVertex matches the SGL vertex layout (24 bytes): +// position(float3) + texcoord(float2) + color(ubyte4n). +struct FilterVertex { + x f32 + y f32 + z f32 + u f32 + v f32 + r u8 + g u8 + b u8 + a u8 +} + +// ortho_column_major builds an orthographic projection matrix +// in column-major order (Metal/GL convention). +fn ortho_column_major(l f32, r f32, b f32, t f32, n f32, f f32) [16]f32 { + mut m := [16]f32{} + m[0] = 2.0 / (r - l) + m[5] = 2.0 / (t - b) + m[10] = -2.0 / (f - n) + m[12] = -(r + l) / (r - l) + m[13] = -(t + b) / (t - b) + m[14] = -(f + n) / (f - n) + m[15] = 1.0 + return m +} + +// make_filter_gfx_pipeline creates a raw gfx.Pipeline for offscreen +// rendering using the generated built-in shader descriptors. +fn make_filter_gfx_pipeline(label &char, shader gfx.Shader) gfx.Pipeline { + return make_gui_builtin_gfx_pipeline(label, shader) +} + +// make_filter_sgl_pipeline creates an SGL pipeline for compositing +// the blurred result onto the swapchain. +fn make_filter_sgl_pipeline(ctx sgl.Context, label &char, shader gfx.Shader) sgl.Pipeline { + return make_gui_builtin_sgl_context_pipeline(ctx, label, shader) } // ensure_filter_state lazily initializes offscreen filter resources. @@ -1587,31 +709,17 @@ fn ensure_filter_state(mut window Window) { }) // Blur/content pipelines: raw gfx (offscreen passes) - $if macos { - window.filter_state.blur_h_pip = make_filter_gfx_pipeline(vs_filter_blur_metal, - fs_filter_blur_h_metal, c'vs_main', c'fs_main', c'tex') - window.filter_state.blur_v_pip = make_filter_gfx_pipeline(vs_filter_blur_metal, - fs_filter_blur_v_metal, c'vs_main', c'fs_main', c'tex') - window.filter_state.content_pip = make_content_gfx_pipeline(vs_filter_blur_metal, - fs_filter_color_metal, c'vs_main', c'fs_main') - } $else { - window.filter_state.blur_h_pip = make_filter_gfx_pipeline(vs_filter_blur_glsl, - fs_filter_blur_h_glsl, c'', c'', c'tex_smp') - window.filter_state.blur_v_pip = make_filter_gfx_pipeline(vs_filter_blur_glsl, - fs_filter_blur_v_glsl, c'', c'', c'tex_smp') - window.filter_state.content_pip = make_content_gfx_pipeline(vs_filter_blur_glsl, - fs_filter_color_glsl, c'', c'') - } + window.filter_state.blur_h_pip = make_filter_gfx_pipeline(c'filter_blur_h_pip', + gfx.make_shader(voidptr(C.gui_filter_blur_h_shader_desc(gfx.query_backend())))) + window.filter_state.blur_v_pip = make_filter_gfx_pipeline(c'filter_blur_v_pip', + gfx.make_shader(voidptr(C.gui_filter_blur_v_shader_desc(gfx.query_backend())))) + window.filter_state.content_pip = make_filter_gfx_pipeline(c'filter_content_pip', + gfx.make_shader(voidptr(C.gui_filter_color_shader_desc(gfx.query_backend())))) // Composite pipeline: SGL (swapchain pass) ctx := sgl.default_context() - $if macos { - window.filter_state.texture_quad_pip = make_filter_sgl_pipeline(ctx, vs_filter_blur_metal, - fs_filter_texture_metal, c'vs_main', c'fs_main', c'tex') - } $else { - window.filter_state.texture_quad_pip = make_filter_sgl_pipeline(ctx, vs_filter_blur_glsl, - fs_filter_texture_glsl, c'', c'', c'tex_smp') - } + window.filter_state.texture_quad_pip = make_filter_sgl_pipeline(ctx, c'filter_texture_pip', + gfx.make_shader(voidptr(C.gui_filter_texture_shader_desc(gfx.query_backend())))) // Static unit quad for blur fullscreen passes (6 vertices) quad_verts := [ @@ -1656,14 +764,13 @@ fn ensure_filter_textures(mut window Window, width int, height int) bool { gfx.destroy_attachments(window.filter_state.att_b) } - color_fmt := gfx.PixelFormat.from(sapp.color_format()) or { gfx.PixelFormat.bgra8 } - depth_fmt := gfx.PixelFormat.from(sapp.depth_format()) or { gfx.PixelFormat.depth_stencil } + formats := gui_render_target_formats() img_desc := gfx.ImageDesc{ render_target: true width: w height: h - pixel_format: color_fmt + pixel_format: formats.color label: c'filter_tex' } tex_a := gfx.make_image(&img_desc) @@ -1674,7 +781,7 @@ fn ensure_filter_textures(mut window Window, width int, height int) bool { render_target: true width: w height: h - pixel_format: depth_fmt + pixel_format: formats.depth label: c'filter_depth' }) if tex_a.id == 0 || tex_b.id == 0 || depth.id == 0 { @@ -1767,138 +874,8 @@ fn init_image_clip_pipeline(mut window Window) bool { if window.pip.image_clip_init_failed { return false } - - mut attrs := [16]gfx.VertexAttrDesc{} - attrs[0] = gfx.VertexAttrDesc{ - format: .float3 - offset: 0 - buffer_index: 0 - } - attrs[1] = gfx.VertexAttrDesc{ - format: .float2 - offset: 12 - buffer_index: 0 - } - attrs[2] = gfx.VertexAttrDesc{ - format: .ubyte4n - offset: 20 - buffer_index: 0 - } - - mut buffers := [8]gfx.VertexBufferLayoutState{} - buffers[0] = gfx.VertexBufferLayoutState{ - stride: 24 - } - - mut shader_attrs := [16]gfx.ShaderAttrDesc{} - shader_attrs[0] = gfx.ShaderAttrDesc{ - name: c'position' - sem_name: c'POSITION' - sem_index: 0 - } - shader_attrs[1] = gfx.ShaderAttrDesc{ - name: c'texcoord0' - sem_name: c'TEXCOORD' - sem_index: 0 - } - shader_attrs[2] = gfx.ShaderAttrDesc{ - name: c'color0' - sem_name: c'COLOR' - sem_index: 0 - } - - mut ub_uniforms := [16]gfx.ShaderUniformDesc{} - ub_uniforms[0] = gfx.ShaderUniformDesc{ - name: c'mvp' - @type: .mat4 - array_count: 1 - } - ub_uniforms[1] = gfx.ShaderUniformDesc{ - name: c'tm' - @type: .mat4 - array_count: 1 - } - - mut ub := [4]gfx.ShaderUniformBlockDesc{} - ub[0] = gfx.ShaderUniformBlockDesc{ - size: 128 - uniforms: ub_uniforms - } - - mut colors := [4]gfx.ColorTargetState{} - colors[0] = gfx.ColorTargetState{ - blend: gfx.BlendState{ - enabled: true - src_factor_rgb: .src_alpha - dst_factor_rgb: .one_minus_src_alpha - src_factor_alpha: .one - dst_factor_alpha: .one_minus_src_alpha - } - write_mask: .rgba - } - - mut shader_images := [12]gfx.ShaderImageDesc{} - shader_images[0] = gfx.ShaderImageDesc{ - used: true - image_type: ._2d - sample_type: .float - } - - mut shader_samplers := [8]gfx.ShaderSamplerDesc{} - shader_samplers[0] = gfx.ShaderSamplerDesc{ - used: true - sampler_type: .filtering - } - - mut shader_image_sampler_pairs := [12]gfx.ShaderImageSamplerPairDesc{} - shader_image_sampler_pairs[0] = gfx.ShaderImageSamplerPairDesc{ - used: true - image_slot: 0 - sampler_slot: 0 - glsl_name: c'tex' - } - - mut shader_desc := gfx.ShaderDesc{ - attrs: shader_attrs - } - - $if macos { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_metal.str - entry: c'vs_main' - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_image_clip_metal.str - entry: c'fs_main' - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } $else { - shader_desc.vs = gfx.ShaderStageDesc{ - source: vs_glsl.str - uniform_blocks: ub - } - shader_desc.fs = gfx.ShaderStageDesc{ - source: fs_image_clip_glsl.str - images: shader_images - samplers: shader_samplers - image_sampler_pairs: shader_image_sampler_pairs - } - } - - desc := gfx.PipelineDesc{ - label: c'image_clip_pip' - colors: colors - layout: gfx.VertexLayoutState{ - attrs: attrs - buffers: buffers - } - shader: gfx.make_shader(&shader_desc) - } - - window.pip.image_clip = sgl.make_pipeline(&desc) + window.pip.image_clip = make_gui_builtin_sgl_pipeline(c'image_clip_pip', + gfx.make_shader(voidptr(C.gui_image_clip_shader_desc(gfx.query_backend())))) if window.pip.image_clip.id == 0 { window.pip.image_clip_init_failed = true return false diff --git a/shaders/README.md b/shaders/README.md new file mode 100644 index 0000000..ef0abb0 --- /dev/null +++ b/shaders/README.md @@ -0,0 +1,21 @@ +# Generated Shaders + +`gui_builtin.h` is generated from `gui_builtin.glsl` and committed so users do +not need to run shader generation before importing `gui`. + +Regenerate after editing `gui_builtin.glsl`: + +```sh +v shader -l glsl410 -l hlsl4 -l metal_macos shaders/gui_builtin.glsl +``` + +The `glsl410` target is intentional for the generated built-ins: current +`sokol-shdc` maps desktop `SG_BACKEND_GLCORE` shaders to GLSL 410/430. Do not +rewrite the generated header to `glsl330`; GLSL 3.3 remains the runtime custom +`Shader.glsl` body format, not the generated built-in shader target. + +Before committing, keep the generated header's `Cmdline` line path-neutral: + +```text +sokol-shdc --input shaders/gui_builtin.glsl --output shaders/gui_builtin.h --slang glsl410:hlsl4:metal_macos +``` diff --git a/shaders/gui_builtin.glsl b/shaders/gui_builtin.glsl new file mode 100644 index 0000000..cdd520d --- /dev/null +++ b/shaders/gui_builtin.glsl @@ -0,0 +1,512 @@ +// Built-in v-gui shaders. +// +// Regenerate gui_builtin.h with: +// v shader -l glsl410 -l hlsl4 -l metal_macos shaders/gui_builtin.glsl + +@vs gui_rect_vs +uniform gui_rect_vs_params { + mat4 mvp; + mat4 tm; +}; + +in vec3 position; +in vec2 texcoord0; +in vec4 color0; +in float psize; + +out vec2 uv; +out vec4 color; +out float params; + +void main() { + gl_Position = mvp * vec4(position.xy, 0.0, 1.0); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + params = position.z; +} +@end + +@vs gui_shadow_vs +uniform gui_shadow_vs_params { + mat4 mvp; + mat4 tm; +}; + +in vec3 position; +in vec2 texcoord0; +in vec4 color0; +in float psize; + +out vec2 uv; +out vec4 color; +out float params; +out vec2 offset; + +void main() { + gl_Position = mvp * vec4(position.xy, 0.0, 1.0); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + params = position.z; + offset = (tm * vec4(0.0, 0.0, 0.0, 1.0)).xy; +} +@end + +@vs gui_gradient_vs +uniform gui_gradient_vs_params { + mat4 mvp; + mat4 tm; +}; + +in vec3 position; +in vec2 texcoord0; +in vec4 color0; +in float psize; + +out vec2 uv; +out vec4 color; +out float params; +out vec4 stop12; +out vec4 stop34; +out vec4 stop56; +out vec4 meta; + +void main() { + gl_Position = mvp * vec4(position.xy, 0.0, 1.0); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + params = position.z; + stop12 = tm[0]; + stop34 = tm[1]; + stop56 = tm[2]; + meta = tm[3]; +} +@end + +@vs gui_filter_vs +uniform gui_filter_vs_params { + mat4 mvp; + mat4 tm; +}; + +in vec3 position; +in vec2 texcoord0; +in vec4 color0; + +out vec2 uv; +out vec4 color; +out float std_dev; + +void main() { + gl_Position = mvp * vec4(position.xy, 0.0, 1.0); + uv = texcoord0; + color = color0; + std_dev = tm[0][0]; +} +@end + +@vs gui_filter_sgl_vs +uniform gui_filter_sgl_vs_params { + mat4 mvp; + mat4 tm; +}; + +in vec3 position; +in vec2 texcoord0; +in vec4 color0; +in float psize; + +out vec2 uv; +out vec4 color; +out float std_dev; + +void main() { + gl_Position = mvp * vec4(position.xy, 0.0, 1.0); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + std_dev = tm[0][0]; +} +@end + +@fs gui_rounded_rect_fs +uniform texture2D tex; +uniform sampler smp; + +in vec2 uv; +in vec4 color; +in float params; + +out vec4 frag_color; + +float gui_unpack_radius(float packed_params) { + return floor(packed_params / 4096.0) / 4.0; +} + +float gui_unpack_secondary(float packed_params) { + return mod(packed_params, 4096.0) / 4.0; +} + +float gui_rounded_box_sdf(vec2 pos, vec2 half_size, float radius) { + vec2 q = abs(pos) - half_size + vec2(radius); + return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; +} + +float gui_normalized_sdf_alpha(float d) { + float grad_len = length(vec2(dFdx(d), dFdy(d))); + d = d / max(grad_len, 0.001); + return 1.0 - smoothstep(-0.59, 0.59, d); +} + +void main() { + float radius = gui_unpack_radius(params); + float thickness = gui_unpack_secondary(params); + + vec2 uv_to_px = 1.0 / (vec2(fwidth(uv.x), fwidth(uv.y)) + 1e-6); + vec2 half_size = uv_to_px; + vec2 pos = uv * half_size; + + float d = gui_rounded_box_sdf(pos, half_size, radius); + if (thickness > 0.0) { + d = abs(d + thickness * 0.5) - thickness * 0.5; + } + + float alpha = gui_normalized_sdf_alpha(d); + frag_color = vec4(color.rgb, color.a * alpha); + if (frag_color.a < 0.0) { + frag_color += texture(sampler2D(tex, smp), uv); + } +} +@end + +@fs gui_shadow_fs +uniform texture2D tex; +uniform sampler smp; + +in vec2 uv; +in vec4 color; +in float params; +in vec2 offset; + +out vec4 frag_color; + +float gui_unpack_radius(float packed_params) { + return floor(packed_params / 4096.0) / 4.0; +} + +float gui_unpack_secondary(float packed_params) { + return mod(packed_params, 4096.0) / 4.0; +} + +float gui_rounded_box_sdf(vec2 pos, vec2 half_size, float radius) { + vec2 q = abs(pos) - half_size + vec2(radius); + return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; +} + +void main() { + float radius = gui_unpack_radius(params); + float blur = gui_unpack_secondary(params); + + vec2 uv_to_px = 1.0 / (vec2(fwidth(uv.x), fwidth(uv.y)) + 1e-6); + vec2 half_size = uv_to_px; + vec2 pos = uv * half_size; + + vec2 expanded = half_size - vec2(1.5 * blur); + float d = gui_rounded_box_sdf(pos, expanded, radius); + float d_c = gui_rounded_box_sdf(pos + offset, expanded, radius); + + float alpha_falloff = 1.0 - smoothstep(0.0, max(1.0, blur), d); + float alpha_clip = smoothstep(-1.0, 0.0, d_c); + float alpha = alpha_falloff * alpha_clip; + + frag_color = vec4(color.rgb, color.a * alpha); + if (frag_color.a < 0.0) { + frag_color += texture(sampler2D(tex, smp), uv); + } +} +@end + +@fs gui_blur_fs +uniform texture2D tex; +uniform sampler smp; + +in vec2 uv; +in vec4 color; +in float params; +in vec2 offset; + +out vec4 frag_color; + +float gui_unpack_radius(float packed_params) { + return floor(packed_params / 4096.0) / 4.0; +} + +float gui_unpack_secondary(float packed_params) { + return mod(packed_params, 4096.0) / 4.0; +} + +float gui_rounded_box_sdf(vec2 pos, vec2 half_size, float radius) { + vec2 q = abs(pos) - half_size + vec2(radius); + return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; +} + +void main() { + float radius = gui_unpack_radius(params); + float blur = gui_unpack_secondary(params); + + vec2 uv_to_px = 1.0 / (vec2(fwidth(uv.x), fwidth(uv.y)) + 1e-6); + vec2 half_size = uv_to_px; + vec2 pos = uv * half_size; + + vec2 expanded = half_size - vec2(1.5 * blur); + float d = gui_rounded_box_sdf(pos, expanded, radius); + float alpha = 1.0 - smoothstep(-blur, blur, d); + + frag_color = vec4(color.rgb, color.a * alpha); + if (frag_color.a < 0.0) { + frag_color += texture(sampler2D(tex, smp), uv); + } +} +@end + +@fs gui_gradient_fs +uniform texture2D tex; +uniform sampler smp; + +in vec2 uv; +in vec4 color; +in float params; +in vec4 stop12; +in vec4 stop34; +in vec4 stop56; +in vec4 meta; + +out vec4 frag_color; + +float gui_unpack_radius(float packed_params) { + return floor(packed_params / 4096.0) / 4.0; +} + +float gui_rounded_box_sdf(vec2 pos, vec2 half_size, float radius) { + vec2 q = abs(pos) - half_size + vec2(radius); + return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; +} + +float gui_normalized_sdf_alpha(float d) { + float grad_len = length(vec2(dFdx(d), dFdy(d))); + d = d / max(grad_len, 0.001); + return 1.0 - smoothstep(-0.59, 0.59, d); +} + +float gui_random(vec2 coords) { + return fract(sin(dot(coords.xy, vec2(12.9898, 78.233))) * 43758.5453); +} + +void gui_unpack_gradient_data(float val1, float val2, out vec4 c, out float p) { + float r = mod(val1, 256.0); + float g = mod(floor(val1 / 256.0), 256.0); + float b = floor(val1 / 65536.0); + float a = mod(val2, 256.0); + p = floor(val2 / 256.0) / 10000.0; + c = vec4(r / 255.0, g / 255.0, b / 255.0, a / 255.0); +} + +void main() { + float radius = gui_unpack_radius(params); + float hw = meta.x; + float hh = meta.y; + float grad_type = meta.z; + int stop_count = int(meta.w); + + vec2 pos = uv * vec2(hw, hh); + float d = gui_rounded_box_sdf(pos, vec2(hw, hh), radius); + float sdf_alpha = 1.0 - smoothstep(-0.5, 0.5, d); + + float t; + if (grad_type > 0.5) { + float target_radius = stop56.w; + t = length(pos) / target_radius; + } else { + vec2 stop_dir = vec2(stop56.z, stop56.w); + t = dot(uv, stop_dir) * 0.5 + 0.5; + } + t = clamp(t, 0.0, 1.0); + + vec4 stop_colors[6]; + float stop_positions[6]; + gui_unpack_gradient_data(stop12.x, stop12.y, stop_colors[0], stop_positions[0]); + gui_unpack_gradient_data(stop12.z, stop12.w, stop_colors[1], stop_positions[1]); + gui_unpack_gradient_data(stop34.x, stop34.y, stop_colors[2], stop_positions[2]); + gui_unpack_gradient_data(stop34.z, stop34.w, stop_colors[3], stop_positions[3]); + gui_unpack_gradient_data(stop56.x, stop56.y, stop_colors[4], stop_positions[4]); + stop_colors[5] = stop_colors[4]; + stop_positions[5] = stop_positions[4]; + + vec4 c1 = stop_colors[0]; + vec4 c2 = c1; + float p1 = stop_positions[0]; + float p2 = p1; + + for (int i = 1; i < 6; i++) { + if (i >= stop_count) { + break; + } + if (t <= stop_positions[i]) { + c2 = stop_colors[i]; + p2 = stop_positions[i]; + c1 = stop_colors[i - 1]; + p1 = stop_positions[i - 1]; + break; + } + if (i == stop_count - 1) { + c1 = stop_colors[i]; + c2 = c1; + p1 = stop_positions[i]; + p2 = p1; + } + } + + float local_t = (t - p1) / max(p2 - p1, 0.0001); + vec3 c1_pre = c1.rgb * c1.a; + vec3 c2_pre = c2.rgb * c2.a; + vec3 rgb_pre = mix(c1_pre, c2_pre, local_t); + float alpha = mix(c1.a, c2.a, local_t); + vec3 rgb = rgb_pre / max(alpha, 0.0001); + vec4 gradient_color = vec4(rgb, alpha); + + float dither = (gui_random(gl_FragCoord.xy) - 0.5) / 255.0; + gradient_color.rgb += vec3(dither); + + frag_color = vec4(gradient_color.rgb, gradient_color.a * sdf_alpha * color.a); + if (frag_color.a < 0.0) { + frag_color += texture(sampler2D(tex, smp), uv); + } +} +@end + +@fs gui_image_clip_fs +uniform texture2D tex; +uniform sampler smp; + +in vec2 uv; +in vec4 color; +in float params; + +out vec4 frag_color; + +float gui_unpack_radius(float packed_params) { + return floor(packed_params / 4096.0) / 4.0; +} + +float gui_rounded_box_sdf(vec2 pos, vec2 half_size, float radius) { + vec2 q = abs(pos) - half_size + vec2(radius); + return length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; +} + +float gui_normalized_sdf_alpha(float d) { + float grad_len = length(vec2(dFdx(d), dFdy(d))); + d = d / max(grad_len, 0.001); + return 1.0 - smoothstep(-0.59, 0.59, d); +} + +void main() { + float radius = gui_unpack_radius(params); + vec2 uv_to_px = 1.0 / (vec2(fwidth(uv.x), fwidth(uv.y)) + 1e-6); + vec2 half_size = uv_to_px; + vec2 pos = uv * half_size; + + float d = gui_rounded_box_sdf(pos, half_size, radius); + float alpha = gui_normalized_sdf_alpha(d); + + vec2 tex_uv = uv * 0.5 + 0.5; + vec4 tex_color = texture(sampler2D(tex, smp), tex_uv); + frag_color = vec4(tex_color.rgb, tex_color.a * alpha); +} +@end + +@fs gui_filter_blur_h_fs +uniform texture2D tex; +uniform sampler smp; + +in vec2 uv; +in vec4 color; +in float std_dev; + +out vec4 frag_color; + +void main() { + float w[7] = float[7](0.19947, 0.17603, 0.12098, 0.06476, 0.02700, 0.00877, 0.00222); + vec2 tex_size = vec2(textureSize(sampler2D(tex, smp), 0)); + float step_size = std_dev / tex_size.x; + + frag_color = texture(sampler2D(tex, smp), uv) * w[0]; + for (int i = 1; i < 7; i++) { + float off = float(i) * step_size; + frag_color += texture(sampler2D(tex, smp), uv + vec2(off, 0.0)) * w[i]; + frag_color += texture(sampler2D(tex, smp), uv - vec2(off, 0.0)) * w[i]; + } +} +@end + +@fs gui_filter_blur_v_fs +uniform texture2D tex; +uniform sampler smp; + +in vec2 uv; +in vec4 color; +in float std_dev; + +out vec4 frag_color; + +void main() { + float w[7] = float[7](0.19947, 0.17603, 0.12098, 0.06476, 0.02700, 0.00877, 0.00222); + vec2 tex_size = vec2(textureSize(sampler2D(tex, smp), 0)); + float step_size = std_dev / tex_size.y; + + frag_color = texture(sampler2D(tex, smp), uv) * w[0]; + for (int i = 1; i < 7; i++) { + float off = float(i) * step_size; + frag_color += texture(sampler2D(tex, smp), uv + vec2(0.0, off)) * w[i]; + frag_color += texture(sampler2D(tex, smp), uv - vec2(0.0, off)) * w[i]; + } +} +@end + +@fs gui_filter_color_fs +in vec2 uv; +in vec4 color; +in float std_dev; + +out vec4 frag_color; + +void main() { + frag_color = color; +} +@end + +@fs gui_filter_texture_fs +uniform texture2D tex; +uniform sampler smp; + +in vec2 uv; +in vec4 color; +in float std_dev; + +out vec4 frag_color; + +void main() { + frag_color = texture(sampler2D(tex, smp), uv) * color; +} +@end + +@program gui_rounded_rect gui_rect_vs gui_rounded_rect_fs +@program gui_shadow gui_shadow_vs gui_shadow_fs +@program gui_blur gui_shadow_vs gui_blur_fs +@program gui_gradient gui_gradient_vs gui_gradient_fs +@program gui_image_clip gui_rect_vs gui_image_clip_fs +@program gui_filter_blur_h gui_filter_vs gui_filter_blur_h_fs +@program gui_filter_blur_v gui_filter_vs gui_filter_blur_v_fs +@program gui_filter_color gui_filter_vs gui_filter_color_fs +@program gui_filter_texture gui_filter_sgl_vs gui_filter_texture_fs diff --git a/shaders/gui_builtin.h b/shaders/gui_builtin.h new file mode 100644 index 0000000..29acae0 --- /dev/null +++ b/shaders/gui_builtin.h @@ -0,0 +1,7550 @@ +#pragma once +/* + #version:1# (machine generated, don't edit!) + + Generated by sokol-shdc (https://github.com/floooh/sokol-tools) + + Cmdline: + sokol-shdc --input shaders/gui_builtin.glsl --output shaders/gui_builtin.h --slang glsl410:hlsl4:metal_macos + + Overview: + ========= + Shader program: 'gui_blur': + Get shader desc: gui_blur_shader_desc(sg_query_backend()); + Vertex shader: gui_shadow_vs + Attributes: + ATTR_gui_shadow_vs_position => 0 + ATTR_gui_shadow_vs_texcoord0 => 1 + ATTR_gui_shadow_vs_color0 => 2 + ATTR_gui_shadow_vs_psize => 3 + Uniform block 'gui_shadow_vs_params': + C struct: gui_shadow_vs_params_t + Bind slot: SLOT_gui_shadow_vs_params => 0 + Fragment shader: gui_blur_fs + Image 'tex': + Image type: SG_IMAGETYPE_2D + Sample type: SG_IMAGESAMPLETYPE_FLOAT + Multisampled: false + Bind slot: SLOT_tex => 0 + Sampler 'smp': + Type: SG_SAMPLERTYPE_FILTERING + Bind slot: SLOT_smp => 0 + Image Sampler Pair 'tex_smp': + Image: tex + Sampler: smp + Shader program: 'gui_filter_blur_h': + Get shader desc: gui_filter_blur_h_shader_desc(sg_query_backend()); + Vertex shader: gui_filter_vs + Attributes: + ATTR_gui_filter_vs_position => 0 + ATTR_gui_filter_vs_texcoord0 => 1 + ATTR_gui_filter_vs_color0 => 2 + Uniform block 'gui_filter_vs_params': + C struct: gui_filter_vs_params_t + Bind slot: SLOT_gui_filter_vs_params => 0 + Fragment shader: gui_filter_blur_h_fs + Image 'tex': + Image type: SG_IMAGETYPE_2D + Sample type: SG_IMAGESAMPLETYPE_FLOAT + Multisampled: false + Bind slot: SLOT_tex => 0 + Sampler 'smp': + Type: SG_SAMPLERTYPE_FILTERING + Bind slot: SLOT_smp => 0 + Image Sampler Pair 'tex_smp': + Image: tex + Sampler: smp + Shader program: 'gui_filter_blur_v': + Get shader desc: gui_filter_blur_v_shader_desc(sg_query_backend()); + Vertex shader: gui_filter_vs + Attributes: + ATTR_gui_filter_vs_position => 0 + ATTR_gui_filter_vs_texcoord0 => 1 + ATTR_gui_filter_vs_color0 => 2 + Uniform block 'gui_filter_vs_params': + C struct: gui_filter_vs_params_t + Bind slot: SLOT_gui_filter_vs_params => 0 + Fragment shader: gui_filter_blur_v_fs + Image 'tex': + Image type: SG_IMAGETYPE_2D + Sample type: SG_IMAGESAMPLETYPE_FLOAT + Multisampled: false + Bind slot: SLOT_tex => 0 + Sampler 'smp': + Type: SG_SAMPLERTYPE_FILTERING + Bind slot: SLOT_smp => 0 + Image Sampler Pair 'tex_smp': + Image: tex + Sampler: smp + Shader program: 'gui_filter_color': + Get shader desc: gui_filter_color_shader_desc(sg_query_backend()); + Vertex shader: gui_filter_vs + Attributes: + ATTR_gui_filter_vs_position => 0 + ATTR_gui_filter_vs_texcoord0 => 1 + ATTR_gui_filter_vs_color0 => 2 + Uniform block 'gui_filter_vs_params': + C struct: gui_filter_vs_params_t + Bind slot: SLOT_gui_filter_vs_params => 0 + Fragment shader: gui_filter_color_fs + Shader program: 'gui_filter_texture': + Get shader desc: gui_filter_texture_shader_desc(sg_query_backend()); + Vertex shader: gui_filter_sgl_vs + Attributes: + ATTR_gui_filter_sgl_vs_position => 0 + ATTR_gui_filter_sgl_vs_texcoord0 => 1 + ATTR_gui_filter_sgl_vs_color0 => 2 + ATTR_gui_filter_sgl_vs_psize => 3 + Uniform block 'gui_filter_sgl_vs_params': + C struct: gui_filter_sgl_vs_params_t + Bind slot: SLOT_gui_filter_sgl_vs_params => 0 + Fragment shader: gui_filter_texture_fs + Image 'tex': + Image type: SG_IMAGETYPE_2D + Sample type: SG_IMAGESAMPLETYPE_FLOAT + Multisampled: false + Bind slot: SLOT_tex => 0 + Sampler 'smp': + Type: SG_SAMPLERTYPE_FILTERING + Bind slot: SLOT_smp => 0 + Image Sampler Pair 'tex_smp': + Image: tex + Sampler: smp + Shader program: 'gui_gradient': + Get shader desc: gui_gradient_shader_desc(sg_query_backend()); + Vertex shader: gui_gradient_vs + Attributes: + ATTR_gui_gradient_vs_position => 0 + ATTR_gui_gradient_vs_texcoord0 => 1 + ATTR_gui_gradient_vs_color0 => 2 + ATTR_gui_gradient_vs_psize => 3 + Uniform block 'gui_gradient_vs_params': + C struct: gui_gradient_vs_params_t + Bind slot: SLOT_gui_gradient_vs_params => 0 + Fragment shader: gui_gradient_fs + Image 'tex': + Image type: SG_IMAGETYPE_2D + Sample type: SG_IMAGESAMPLETYPE_FLOAT + Multisampled: false + Bind slot: SLOT_tex => 0 + Sampler 'smp': + Type: SG_SAMPLERTYPE_FILTERING + Bind slot: SLOT_smp => 0 + Image Sampler Pair 'tex_smp': + Image: tex + Sampler: smp + Shader program: 'gui_image_clip': + Get shader desc: gui_image_clip_shader_desc(sg_query_backend()); + Vertex shader: gui_rect_vs + Attributes: + ATTR_gui_rect_vs_position => 0 + ATTR_gui_rect_vs_texcoord0 => 1 + ATTR_gui_rect_vs_color0 => 2 + ATTR_gui_rect_vs_psize => 3 + Uniform block 'gui_rect_vs_params': + C struct: gui_rect_vs_params_t + Bind slot: SLOT_gui_rect_vs_params => 0 + Fragment shader: gui_image_clip_fs + Image 'tex': + Image type: SG_IMAGETYPE_2D + Sample type: SG_IMAGESAMPLETYPE_FLOAT + Multisampled: false + Bind slot: SLOT_tex => 0 + Sampler 'smp': + Type: SG_SAMPLERTYPE_FILTERING + Bind slot: SLOT_smp => 0 + Image Sampler Pair 'tex_smp': + Image: tex + Sampler: smp + Shader program: 'gui_rounded_rect': + Get shader desc: gui_rounded_rect_shader_desc(sg_query_backend()); + Vertex shader: gui_rect_vs + Attributes: + ATTR_gui_rect_vs_position => 0 + ATTR_gui_rect_vs_texcoord0 => 1 + ATTR_gui_rect_vs_color0 => 2 + ATTR_gui_rect_vs_psize => 3 + Uniform block 'gui_rect_vs_params': + C struct: gui_rect_vs_params_t + Bind slot: SLOT_gui_rect_vs_params => 0 + Fragment shader: gui_rounded_rect_fs + Image 'tex': + Image type: SG_IMAGETYPE_2D + Sample type: SG_IMAGESAMPLETYPE_FLOAT + Multisampled: false + Bind slot: SLOT_tex => 0 + Sampler 'smp': + Type: SG_SAMPLERTYPE_FILTERING + Bind slot: SLOT_smp => 0 + Image Sampler Pair 'tex_smp': + Image: tex + Sampler: smp + Shader program: 'gui_shadow': + Get shader desc: gui_shadow_shader_desc(sg_query_backend()); + Vertex shader: gui_shadow_vs + Attributes: + ATTR_gui_shadow_vs_position => 0 + ATTR_gui_shadow_vs_texcoord0 => 1 + ATTR_gui_shadow_vs_color0 => 2 + ATTR_gui_shadow_vs_psize => 3 + Uniform block 'gui_shadow_vs_params': + C struct: gui_shadow_vs_params_t + Bind slot: SLOT_gui_shadow_vs_params => 0 + Fragment shader: gui_shadow_fs + Image 'tex': + Image type: SG_IMAGETYPE_2D + Sample type: SG_IMAGESAMPLETYPE_FLOAT + Multisampled: false + Bind slot: SLOT_tex => 0 + Sampler 'smp': + Type: SG_SAMPLERTYPE_FILTERING + Bind slot: SLOT_smp => 0 + Image Sampler Pair 'tex_smp': + Image: tex + Sampler: smp +*/ +#if !defined(SOKOL_GFX_INCLUDED) +#error "Please include sokol_gfx.h before gui_builtin.h" +#endif +#if !defined(SOKOL_SHDC_ALIGN) +#if defined(_MSC_VER) +#define SOKOL_SHDC_ALIGN(a) __declspec(align(a)) +#else +#define SOKOL_SHDC_ALIGN(a) __attribute__((aligned(a))) +#endif +#endif +#define ATTR_gui_shadow_vs_position (0) +#define ATTR_gui_shadow_vs_texcoord0 (1) +#define ATTR_gui_shadow_vs_color0 (2) +#define ATTR_gui_shadow_vs_psize (3) +#define ATTR_gui_filter_vs_position (0) +#define ATTR_gui_filter_vs_texcoord0 (1) +#define ATTR_gui_filter_vs_color0 (2) +#define ATTR_gui_filter_sgl_vs_position (0) +#define ATTR_gui_filter_sgl_vs_texcoord0 (1) +#define ATTR_gui_filter_sgl_vs_color0 (2) +#define ATTR_gui_filter_sgl_vs_psize (3) +#define ATTR_gui_gradient_vs_position (0) +#define ATTR_gui_gradient_vs_texcoord0 (1) +#define ATTR_gui_gradient_vs_color0 (2) +#define ATTR_gui_gradient_vs_psize (3) +#define ATTR_gui_rect_vs_position (0) +#define ATTR_gui_rect_vs_texcoord0 (1) +#define ATTR_gui_rect_vs_color0 (2) +#define ATTR_gui_rect_vs_psize (3) +#define SLOT_gui_rect_vs_params (0) +#define SLOT_gui_shadow_vs_params (0) +#define SLOT_gui_gradient_vs_params (0) +#define SLOT_gui_filter_vs_params (0) +#define SLOT_gui_filter_sgl_vs_params (0) +#define SLOT_tex (0) +#define SLOT_smp (0) +#pragma pack(push,1) +SOKOL_SHDC_ALIGN(16) typedef struct gui_rect_vs_params_t { + float mvp[16]; + float tm[16]; +} gui_rect_vs_params_t; +#pragma pack(pop) +#pragma pack(push,1) +SOKOL_SHDC_ALIGN(16) typedef struct gui_shadow_vs_params_t { + float mvp[16]; + float tm[16]; +} gui_shadow_vs_params_t; +#pragma pack(pop) +#pragma pack(push,1) +SOKOL_SHDC_ALIGN(16) typedef struct gui_gradient_vs_params_t { + float mvp[16]; + float tm[16]; +} gui_gradient_vs_params_t; +#pragma pack(pop) +#pragma pack(push,1) +SOKOL_SHDC_ALIGN(16) typedef struct gui_filter_vs_params_t { + float mvp[16]; + float tm[16]; +} gui_filter_vs_params_t; +#pragma pack(pop) +#pragma pack(push,1) +SOKOL_SHDC_ALIGN(16) typedef struct gui_filter_sgl_vs_params_t { + float mvp[16]; + float tm[16]; +} gui_filter_sgl_vs_params_t; +#pragma pack(pop) +/* + #version 410 + + uniform vec4 gui_rect_vs_params[8]; + layout(location = 0) in vec3 position; + layout(location = 3) in float psize; + layout(location = 0) out vec2 uv; + layout(location = 1) in vec2 texcoord0; + layout(location = 1) out vec4 color; + layout(location = 2) in vec4 color0; + layout(location = 2) out float params; + + void main() + { + gl_Position = mat4(gui_rect_vs_params[0], gui_rect_vs_params[1], gui_rect_vs_params[2], gui_rect_vs_params[3]) * vec4(position.xy, 0.0, 1.0); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + params = position.z; + } + +*/ +static const uint8_t gui_rect_vs_source_glsl410[569] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x67,0x75,0x69,0x5f,0x72, + 0x65,0x63,0x74,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x38,0x5d, + 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,0x33,0x20,0x70, + 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28, + 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x69,0x6e, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,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,0x32,0x20,0x75,0x76,0x3b,0x0a, + 0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20, + 0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, + 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x6f,0x75,0x74, + 0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79, + 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32, + 0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30, + 0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f, + 0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x6f,0x75,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x73,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,0x6d,0x61,0x74,0x34,0x28,0x67, + 0x75,0x69,0x5f,0x72,0x65,0x63,0x74,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x5b,0x30,0x5d,0x2c,0x20,0x67,0x75,0x69,0x5f,0x72,0x65,0x63,0x74,0x5f,0x76, + 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x67,0x75,0x69, + 0x5f,0x72,0x65,0x63,0x74,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x32,0x5d,0x2c,0x20,0x67,0x75,0x69,0x5f,0x72,0x65,0x63,0x74,0x5f,0x76,0x73,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,0x2e,0x78,0x79,0x2c,0x20,0x30, + 0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c, + 0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x73,0x69, + 0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,0x2e,0x7a,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #version 410 + + uniform vec4 gui_shadow_vs_params[8]; + layout(location = 0) in vec3 position; + layout(location = 3) in float psize; + layout(location = 0) out vec2 uv; + layout(location = 1) in vec2 texcoord0; + layout(location = 1) out vec4 color; + layout(location = 2) in vec4 color0; + layout(location = 2) out float params; + layout(location = 3) out vec2 offset; + + void main() + { + gl_Position = mat4(gui_shadow_vs_params[0], gui_shadow_vs_params[1], gui_shadow_vs_params[2], gui_shadow_vs_params[3]) * vec4(position.xy, 0.0, 1.0); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + params = position.z; + offset = (mat4(gui_shadow_vs_params[4], gui_shadow_vs_params[5], gui_shadow_vs_params[6], gui_shadow_vs_params[7]) * vec4(0.0, 0.0, 0.0, 1.0)).xy; + } + +*/ +static const uint8_t gui_shadow_vs_source_glsl410[768] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x67,0x75,0x69,0x5f,0x73, + 0x68,0x61,0x64,0x6f,0x77,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x38,0x5d,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,0x33, + 0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75, + 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20, + 0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,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,0x32,0x20,0x75,0x76, + 0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f, + 0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x74, + 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, + 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x6f, + 0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c, + 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, + 0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f, + 0x72,0x30,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74, + 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x6f,0x75,0x74,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75, + 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20, + 0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x6f,0x66,0x66,0x73,0x65,0x74,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,0x6d,0x61,0x74,0x34,0x28,0x67,0x75,0x69,0x5f,0x73,0x68,0x61,0x64,0x6f, + 0x77,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20, + 0x67,0x75,0x69,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x76,0x73,0x5f,0x70,0x61, + 0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x67,0x75,0x69,0x5f,0x73,0x68,0x61, + 0x64,0x6f,0x77,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d, + 0x2c,0x20,0x67,0x75,0x69,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x76,0x73,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,0x2e,0x78,0x79,0x2c,0x20,0x30, + 0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c, + 0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x73,0x69, + 0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x66,0x66,0x73,0x65,0x74,0x20, + 0x3d,0x20,0x28,0x6d,0x61,0x74,0x34,0x28,0x67,0x75,0x69,0x5f,0x73,0x68,0x61,0x64, + 0x6f,0x77,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x2c, + 0x20,0x67,0x75,0x69,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x76,0x73,0x5f,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x5b,0x35,0x5d,0x2c,0x20,0x67,0x75,0x69,0x5f,0x73,0x68, + 0x61,0x64,0x6f,0x77,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36, + 0x5d,0x2c,0x20,0x67,0x75,0x69,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x76,0x73, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x37,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65, + 0x63,0x34,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30, + 0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + +}; +/* + #version 410 + + uniform vec4 gui_gradient_vs_params[8]; + layout(location = 0) in vec3 position; + layout(location = 3) in float psize; + layout(location = 0) out vec2 uv; + layout(location = 1) in vec2 texcoord0; + layout(location = 1) out vec4 color; + layout(location = 2) in vec4 color0; + layout(location = 2) out float params; + layout(location = 3) out vec4 stop12; + layout(location = 4) out vec4 stop34; + layout(location = 5) out vec4 stop56; + layout(location = 6) out vec4 meta; + + void main() + { + gl_Position = mat4(gui_gradient_vs_params[0], gui_gradient_vs_params[1], gui_gradient_vs_params[2], gui_gradient_vs_params[3]) * vec4(position.xy, 0.0, 1.0); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + params = position.z; + stop12 = gui_gradient_vs_params[4]; + stop34 = gui_gradient_vs_params[5]; + stop56 = gui_gradient_vs_params[6]; + meta = gui_gradient_vs_params[7]; + } + +*/ +static const uint8_t gui_gradient_vs_source_glsl410[897] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x67,0x75,0x69,0x5f,0x67, + 0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x5b,0x38,0x5d,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,0x33,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6c,0x61,0x79, + 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33, + 0x29,0x20,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73,0x69,0x7a,0x65, + 0x3b,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,0x32,0x20, + 0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74, + 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32, + 0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6c,0x61,0x79,0x6f, + 0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29, + 0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b, + 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, + 0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f, + 0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63, + 0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x6f,0x75,0x74,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x6c,0x61,0x79, + 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33, + 0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x73,0x74,0x6f,0x70,0x31, + 0x32,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69, + 0x6f,0x6e,0x20,0x3d,0x20,0x34,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34, + 0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28, + 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x35,0x29,0x20,0x6f,0x75, + 0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x3b,0x0a,0x6c, + 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, + 0x20,0x36,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x6d,0x65,0x74, + 0x61,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,0x6d,0x61,0x74,0x34,0x28,0x67,0x75,0x69,0x5f,0x67,0x72,0x61, + 0x64,0x69,0x65,0x6e,0x74,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x30,0x5d,0x2c,0x20,0x67,0x75,0x69,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74, + 0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x67, + 0x75,0x69,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x76,0x73,0x5f,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x67,0x75,0x69,0x5f,0x67,0x72, + 0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x76,0x73,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,0x2e,0x78,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e, + 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74, + 0x53,0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f, + 0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f, + 0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x33, + 0x34,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74, + 0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f, + 0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x5b,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x65,0x74,0x61,0x20, + 0x3d,0x20,0x67,0x75,0x69,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x76, + 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x37,0x5d,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x00, +}; +/* + #version 410 + + uniform vec4 gui_filter_vs_params[8]; + layout(location = 0) in vec3 position; + layout(location = 0) out vec2 uv; + layout(location = 1) in vec2 texcoord0; + layout(location = 1) out vec4 color; + layout(location = 2) in vec4 color0; + layout(location = 2) out float std_dev; + + void main() + { + gl_Position = mat4(gui_filter_vs_params[0], gui_filter_vs_params[1], gui_filter_vs_params[2], gui_filter_vs_params[3]) * vec4(position.xy, 0.0, 1.0); + uv = texcoord0; + color = color0; + std_dev = gui_filter_vs_params[4].x; + } + +*/ +static const uint8_t gui_filter_vs_source_glsl410[533] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x67,0x75,0x69,0x5f,0x66, + 0x69,0x6c,0x74,0x65,0x72,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x38,0x5d,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,0x33, + 0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,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,0x32,0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79, + 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31, + 0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f, + 0x72,0x64,0x30,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61, + 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65, + 0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, + 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69, + 0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x6c, + 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, + 0x20,0x32,0x29,0x20,0x6f,0x75,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74, + 0x64,0x5f,0x64,0x65,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,0x6d,0x61,0x74,0x34,0x28,0x67,0x75,0x69, + 0x5f,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x5b,0x30,0x5d,0x2c,0x20,0x67,0x75,0x69,0x5f,0x66,0x69,0x6c,0x74,0x65,0x72, + 0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x67, + 0x75,0x69,0x5f,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x67,0x75,0x69,0x5f,0x66,0x69,0x6c,0x74, + 0x65,0x72,0x5f,0x76,0x73,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, + 0x2e,0x78,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72, + 0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x64,0x5f, + 0x64,0x65,0x76,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x66,0x69,0x6c,0x74,0x65,0x72, + 0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x2e,0x78,0x3b, + 0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #version 410 + + uniform vec4 gui_filter_sgl_vs_params[8]; + layout(location = 0) in vec3 position; + layout(location = 3) in float psize; + layout(location = 0) out vec2 uv; + layout(location = 1) in vec2 texcoord0; + layout(location = 1) out vec4 color; + layout(location = 2) in vec4 color0; + layout(location = 2) out float std_dev; + + void main() + { + gl_Position = mat4(gui_filter_sgl_vs_params[0], gui_filter_sgl_vs_params[1], gui_filter_sgl_vs_params[2], gui_filter_sgl_vs_params[3]) * vec4(position.xy, 0.0, 1.0); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + std_dev = gui_filter_sgl_vs_params[4].x; + } + +*/ +static const uint8_t gui_filter_sgl_vs_source_glsl410[620] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x67,0x75,0x69,0x5f,0x66, + 0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x67,0x6c,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x5b,0x38,0x5d,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,0x33,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6c, + 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, + 0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73,0x69, + 0x7a,0x65,0x3b,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, + 0x32,0x20,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63, + 0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65, + 0x63,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x6c,0x61, + 0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, + 0x31,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f, + 0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69, + 0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, + 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x6f,0x75,0x74, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,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,0x6d,0x61,0x74,0x34,0x28,0x67,0x75,0x69,0x5f,0x66,0x69,0x6c,0x74,0x65,0x72, + 0x5f,0x73,0x67,0x6c,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30, + 0x5d,0x2c,0x20,0x67,0x75,0x69,0x5f,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x67, + 0x6c,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20, + 0x67,0x75,0x69,0x5f,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x67,0x6c,0x5f,0x76, + 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x67,0x75,0x69, + 0x5f,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x67,0x6c,0x5f,0x76,0x73,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,0x2e,0x78,0x79,0x2c,0x20,0x30,0x2e, + 0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f, + 0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x73,0x69,0x7a, + 0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78,0x63, + 0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73, + 0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x66,0x69,0x6c, + 0x74,0x65,0x72,0x5f,0x73,0x67,0x6c,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x5b,0x34,0x5d,0x2e,0x78,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #version 410 + + uniform sampler2D tex_smp; + + layout(location = 2) in float params; + layout(location = 0) in vec2 uv; + layout(location = 0) out vec4 frag_color; + layout(location = 1) in vec4 color; + + float gui_unpack_radius(float packed_params) + { + return floor(packed_params * 0.000244140625) * 0.25; + } + + float gui_unpack_secondary(float packed_params) + { + return mod(packed_params, 4096.0) * 0.25; + } + + float gui_rounded_box_sdf(vec2 pos, vec2 half_size, float radius) + { + vec2 _46 = (abs(pos) - half_size) + vec2(radius); + return (length(max(_46, vec2(0.0))) + min(max(_46.x, _46.y), 0.0)) - radius; + } + + float gui_normalized_sdf_alpha(inout float d) + { + d /= max(length(vec2(dFdx(d), dFdy(d))), 0.001000000047497451305389404296875); + return 1.0 - smoothstep(-0.589999973773956298828125, 0.589999973773956298828125, d); + } + + void main() + { + float param = params; + float param_1 = params; + float _95 = gui_unpack_secondary(param_1); + vec2 _110 = vec2(1.0) / (vec2(fwidth(uv.x), fwidth(uv.y)) + vec2(9.9999999747524270787835121154785e-07)); + vec2 param_2 = uv * _110; + vec2 param_3 = _110; + float param_4 = gui_unpack_radius(param); + float d = gui_rounded_box_sdf(param_2, param_3, param_4); + if (_95 > 0.0) + { + d = fma(-_95, 0.5, abs(fma(_95, 0.5, d))); + } + float param_5 = d; + float _142 = gui_normalized_sdf_alpha(param_5); + frag_color = vec4(color.xyz, color.w * _142); + if (frag_color.w < 0.0) + { + frag_color += texture(tex_smp, uv); + } + } + +*/ +static const uint8_t gui_rounded_rect_fs_source_glsl410[1510] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20, + 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, + 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69, + 0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,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,0x75,0x76,0x3b, + 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,0x6c,0x61,0x79,0x6f,0x75, + 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20, + 0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b, + 0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61, + 0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28, + 0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x2a,0x20, + 0x30,0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f, + 0x6e,0x64,0x61,0x72,0x79,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x63,0x6b, + 0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x6f,0x64,0x28,0x70,0x61,0x63,0x6b, + 0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2c,0x20,0x34,0x30,0x39,0x36,0x2e, + 0x30,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f, + 0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73, + 0x2c,0x20,0x76,0x65,0x63,0x32,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x34,0x36,0x20,0x3d, + 0x20,0x28,0x61,0x62,0x73,0x28,0x70,0x6f,0x73,0x29,0x20,0x2d,0x20,0x68,0x61,0x6c, + 0x66,0x5f,0x73,0x69,0x7a,0x65,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x72, + 0x61,0x64,0x69,0x75,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, + 0x72,0x6e,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28,0x5f, + 0x34,0x36,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x20, + 0x2b,0x20,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f,0x34,0x36,0x2e,0x78,0x2c, + 0x20,0x5f,0x34,0x36,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2d, + 0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x67,0x75,0x69,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64, + 0x5f,0x73,0x64,0x66,0x5f,0x61,0x6c,0x70,0x68,0x61,0x28,0x69,0x6e,0x6f,0x75,0x74, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x64,0x20,0x2f,0x3d,0x20,0x6d,0x61,0x78,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28, + 0x76,0x65,0x63,0x32,0x28,0x64,0x46,0x64,0x78,0x28,0x64,0x29,0x2c,0x20,0x64,0x46, + 0x64,0x79,0x28,0x64,0x29,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x30,0x31,0x30,0x30, + 0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35, + 0x33,0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20, + 0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x2d,0x30,0x2e,0x35,0x38, + 0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39,0x38, + 0x38,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x35,0x38,0x39,0x39,0x39,0x39, + 0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39,0x38,0x38,0x32,0x38,0x31, + 0x32,0x35,0x2c,0x20,0x64,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20, + 0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x35,0x20,0x3d,0x20,0x67, + 0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f,0x6e,0x64, + 0x61,0x72,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x31,0x31,0x30,0x20,0x3d,0x20,0x76,0x65, + 0x63,0x32,0x28,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x28,0x76,0x65,0x63,0x32,0x28, + 0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x75,0x76,0x2e,0x78,0x29,0x2c,0x20,0x66,0x77, + 0x69,0x64,0x74,0x68,0x28,0x75,0x76,0x2e,0x79,0x29,0x29,0x20,0x2b,0x20,0x76,0x65, + 0x63,0x32,0x28,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x35, + 0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33,0x35,0x31,0x32,0x31,0x31,0x35, + 0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x75, + 0x76,0x20,0x2a,0x20,0x5f,0x31,0x31,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, + 0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x31,0x31, + 0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63, + 0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x20,0x3d,0x20,0x67, + 0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73, + 0x64,0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x39,0x35,0x20,0x3e,0x20,0x30,0x2e,0x30, + 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x64,0x20,0x3d,0x20,0x66,0x6d,0x61,0x28,0x2d,0x5f,0x39,0x35,0x2c,0x20,0x30,0x2e, + 0x35,0x2c,0x20,0x61,0x62,0x73,0x28,0x66,0x6d,0x61,0x28,0x5f,0x39,0x35,0x2c,0x20, + 0x30,0x2e,0x35,0x2c,0x20,0x64,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x35,0x20,0x3d,0x20,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x6e,0x6f,0x72, + 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x5f,0x73,0x64,0x66,0x5f,0x61,0x6c,0x70,0x68, + 0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63, + 0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x63,0x6f,0x6c, + 0x6f,0x72,0x2e,0x77,0x20,0x2a,0x20,0x5f,0x31,0x34,0x32,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x77,0x20,0x3c,0x20,0x30,0x2e,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,0x2b,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x74,0x65, + 0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #version 410 + + uniform sampler2D tex_smp; + + layout(location = 2) in float params; + layout(location = 0) in vec2 uv; + layout(location = 3) in vec2 offset; + layout(location = 0) out vec4 frag_color; + layout(location = 1) in vec4 color; + + float gui_unpack_radius(float packed_params) + { + return floor(packed_params * 0.000244140625) * 0.25; + } + + float gui_unpack_secondary(float packed_params) + { + return mod(packed_params, 4096.0) * 0.25; + } + + float gui_rounded_box_sdf(vec2 pos, vec2 half_size, float radius) + { + vec2 _43 = (abs(pos) - half_size) + vec2(radius); + return (length(max(_43, vec2(0.0))) + min(max(_43.x, _43.y), 0.0)) - radius; + } + + void main() + { + float param = params; + float _68 = gui_unpack_radius(param); + float param_1 = params; + float _72 = gui_unpack_secondary(param_1); + vec2 _88 = vec2(1.0) / (vec2(fwidth(uv.x), fwidth(uv.y)) + vec2(9.9999999747524270787835121154785e-07)); + vec2 _101 = _88 - vec2(1.5 * _72); + vec2 param_2 = uv * _88; + vec2 param_3 = _101; + float param_4 = _68; + vec2 param_5 = fma(uv, _88, offset); + vec2 param_6 = _101; + float param_7 = _68; + frag_color = vec4(color.xyz, color.w * ((1.0 - smoothstep(0.0, max(1.0, _72), gui_rounded_box_sdf(param_2, param_3, param_4))) * smoothstep(-1.0, 0.0, gui_rounded_box_sdf(param_5, param_6, param_7)))); + if (frag_color.w < 0.0) + { + frag_color += texture(tex_smp, uv); + } + } + +*/ +static const uint8_t gui_shadow_fs_source_glsl410[1410] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20, + 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, + 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69, + 0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,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,0x75,0x76,0x3b, + 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, + 0x20,0x3d,0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x6f,0x66, + 0x66,0x73,0x65,0x74,0x3b,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, + 0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20, + 0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c, + 0x6f,0x72,0x3b,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75, + 0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30, + 0x36,0x32,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b, + 0x5f,0x73,0x65,0x63,0x6f,0x6e,0x64,0x61,0x72,0x79,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x6f,0x64, + 0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2c,0x20, + 0x34,0x30,0x39,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75, + 0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x76,0x65,0x63, + 0x32,0x20,0x70,0x6f,0x73,0x2c,0x20,0x76,0x65,0x63,0x32,0x20,0x68,0x61,0x6c,0x66, + 0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64, + 0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20, + 0x5f,0x34,0x33,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x70,0x6f,0x73,0x29,0x20, + 0x2d,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x29,0x20,0x2b,0x20,0x76, + 0x65,0x63,0x32,0x28,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28, + 0x6d,0x61,0x78,0x28,0x5f,0x34,0x33,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e, + 0x30,0x29,0x29,0x29,0x20,0x2b,0x20,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f, + 0x34,0x33,0x2e,0x78,0x2c,0x20,0x5f,0x34,0x33,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e, + 0x30,0x29,0x29,0x20,0x2d,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x36,0x38,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70, + 0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x37,0x32,0x20,0x3d,0x20,0x67, + 0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f,0x6e,0x64, + 0x61,0x72,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x38,0x38,0x20,0x3d,0x20,0x76,0x65,0x63, + 0x32,0x28,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x66, + 0x77,0x69,0x64,0x74,0x68,0x28,0x75,0x76,0x2e,0x78,0x29,0x2c,0x20,0x66,0x77,0x69, + 0x64,0x74,0x68,0x28,0x75,0x76,0x2e,0x79,0x29,0x29,0x20,0x2b,0x20,0x76,0x65,0x63, + 0x32,0x28,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x35,0x32, + 0x34,0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33,0x35,0x31,0x32,0x31,0x31,0x35,0x34, + 0x37,0x38,0x35,0x65,0x2d,0x30,0x37,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, + 0x65,0x63,0x32,0x20,0x5f,0x31,0x30,0x31,0x20,0x3d,0x20,0x5f,0x38,0x38,0x20,0x2d, + 0x20,0x76,0x65,0x63,0x32,0x28,0x31,0x2e,0x35,0x20,0x2a,0x20,0x5f,0x37,0x32,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x32,0x20,0x3d,0x20,0x75,0x76,0x20,0x2a,0x20,0x5f,0x38,0x38,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20, + 0x3d,0x20,0x5f,0x31,0x30,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f,0x36,0x38,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x35,0x20,0x3d,0x20,0x66,0x6d,0x61,0x28,0x75,0x76,0x2c,0x20,0x5f,0x38,0x38,0x2c, + 0x20,0x6f,0x66,0x66,0x73,0x65,0x74,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, + 0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,0x20,0x5f,0x31,0x30, + 0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x36,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63, + 0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x63,0x6f,0x6c, + 0x6f,0x72,0x2e,0x77,0x20,0x2a,0x20,0x28,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x73, + 0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x6d, + 0x61,0x78,0x28,0x31,0x2e,0x30,0x2c,0x20,0x5f,0x37,0x32,0x29,0x2c,0x20,0x67,0x75, + 0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64, + 0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x29,0x29,0x20,0x2a, + 0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x2d,0x31,0x2e,0x30, + 0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64, + 0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x37,0x29,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, + 0x20,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3c, + 0x20,0x30,0x2e,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,0x2b, + 0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d, + 0x70,0x2c,0x20,0x75,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a, + 0x0a,0x00, +}; +/* + #version 410 + + uniform sampler2D tex_smp; + + layout(location = 2) in float params; + layout(location = 0) in vec2 uv; + layout(location = 0) out vec4 frag_color; + layout(location = 1) in vec4 color; + layout(location = 3) in vec2 offset; + + float gui_unpack_radius(float packed_params) + { + return floor(packed_params * 0.000244140625) * 0.25; + } + + float gui_unpack_secondary(float packed_params) + { + return mod(packed_params, 4096.0) * 0.25; + } + + float gui_rounded_box_sdf(vec2 pos, vec2 half_size, float radius) + { + vec2 _43 = (abs(pos) - half_size) + vec2(radius); + return (length(max(_43, vec2(0.0))) + min(max(_43.x, _43.y), 0.0)) - radius; + } + + void main() + { + float param = params; + float param_1 = params; + float _72 = gui_unpack_secondary(param_1); + vec2 _88 = vec2(1.0) / (vec2(fwidth(uv.x), fwidth(uv.y)) + vec2(9.9999999747524270787835121154785e-07)); + vec2 param_2 = uv * _88; + vec2 param_3 = _88 - vec2(1.5 * _72); + float param_4 = gui_unpack_radius(param); + frag_color = vec4(color.xyz, color.w * (1.0 - smoothstep(-_72, _72, gui_rounded_box_sdf(param_2, param_3, param_4)))); + if (frag_color.w < 0.0) + { + frag_color += texture(tex_smp, uv); + } + } + +*/ +static const uint8_t gui_blur_fs_source_glsl410[1193] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20, + 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, + 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69, + 0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,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,0x75,0x76,0x3b, + 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,0x6c,0x61,0x79,0x6f,0x75, + 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20, + 0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c, + 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, + 0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x6f,0x66,0x66,0x73, + 0x65,0x74,0x3b,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75, + 0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30, + 0x36,0x32,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b, + 0x5f,0x73,0x65,0x63,0x6f,0x6e,0x64,0x61,0x72,0x79,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x6f,0x64, + 0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2c,0x20, + 0x34,0x30,0x39,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75, + 0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x76,0x65,0x63, + 0x32,0x20,0x70,0x6f,0x73,0x2c,0x20,0x76,0x65,0x63,0x32,0x20,0x68,0x61,0x6c,0x66, + 0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64, + 0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20, + 0x5f,0x34,0x33,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x70,0x6f,0x73,0x29,0x20, + 0x2d,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x29,0x20,0x2b,0x20,0x76, + 0x65,0x63,0x32,0x28,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28, + 0x6d,0x61,0x78,0x28,0x5f,0x34,0x33,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e, + 0x30,0x29,0x29,0x29,0x20,0x2b,0x20,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f, + 0x34,0x33,0x2e,0x78,0x2c,0x20,0x5f,0x34,0x33,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e, + 0x30,0x29,0x29,0x20,0x2d,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x37,0x32,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f, + 0x73,0x65,0x63,0x6f,0x6e,0x64,0x61,0x72,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x38,0x38, + 0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x28,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x28, + 0x76,0x65,0x63,0x32,0x28,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x75,0x76,0x2e,0x78, + 0x29,0x2c,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x75,0x76,0x2e,0x79,0x29,0x29, + 0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39, + 0x39,0x37,0x34,0x37,0x35,0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33,0x35, + 0x31,0x32,0x31,0x31,0x35,0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37,0x29,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x32,0x20,0x3d,0x20,0x75,0x76,0x20,0x2a,0x20,0x5f,0x38,0x38,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d, + 0x20,0x5f,0x38,0x38,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x28,0x31,0x2e,0x35,0x20, + 0x2a,0x20,0x5f,0x37,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f, + 0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f, + 0x72,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a, + 0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74, + 0x65,0x70,0x28,0x2d,0x5f,0x37,0x32,0x2c,0x20,0x5f,0x37,0x32,0x2c,0x20,0x67,0x75, + 0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64, + 0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x29,0x29,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3c,0x20,0x30,0x2e,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,0x2b,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, + 0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #version 410 + + uniform sampler2D tex_smp; + + layout(location = 2) in float params; + layout(location = 6) in vec4 meta; + layout(location = 0) in vec2 uv; + layout(location = 5) in vec4 stop56; + layout(location = 3) in vec4 stop12; + layout(location = 4) in vec4 stop34; + layout(location = 0) out vec4 frag_color; + layout(location = 1) in vec4 color; + + float gui_unpack_radius(float packed_params) + { + return floor(packed_params * 0.000244140625) * 0.25; + } + + float gui_rounded_box_sdf(vec2 pos, vec2 half_size, float radius) + { + vec2 _48 = (abs(pos) - half_size) + vec2(radius); + return (length(max(_48, vec2(0.0))) + min(max(_48.x, _48.y), 0.0)) - radius; + } + + void gui_unpack_gradient_data(float val1, float val2, out vec4 c, out float p) + { + p = floor(val2 * 0.00390625) * 9.9999997473787516355514526367188e-05; + c = vec4(mod(val1, 256.0) * 0.0039215688593685626983642578125, mod(floor(val1 * 0.00390625), 256.0) * 0.0039215688593685626983642578125, floor(val1 * 1.52587890625e-05) * 0.0039215688593685626983642578125, mod(val2, 256.0) * 0.0039215688593685626983642578125); + } + + float gui_random(vec2 coords) + { + return fract(sin(dot(coords, vec2(12.98980045318603515625, 78.233001708984375))) * 43758.546875); + } + + void main() + { + float param = params; + int _135 = int(meta.w); + vec2 _142 = vec2(meta.x, meta.y); + vec2 _143 = uv * _142; + vec2 param_1 = _143; + vec2 param_2 = _142; + float param_3 = gui_unpack_radius(param); + float t; + if (meta.z > 0.5) + { + t = length(_143) / stop56.w; + } + else + { + t = fma(dot(uv, vec2(stop56.z, stop56.w)), 0.5, 0.5); + } + t = clamp(t, 0.0, 1.0); + float param_4 = stop12.x; + float param_5 = stop12.y; + vec4 param_6; + float param_7; + gui_unpack_gradient_data(param_4, param_5, param_6, param_7); + vec4 stop_colors[6]; + stop_colors[0] = param_6; + float stop_positions[6]; + stop_positions[0] = param_7; + float param_8 = stop12.z; + float param_9 = stop12.w; + vec4 param_10; + float param_11; + gui_unpack_gradient_data(param_8, param_9, param_10, param_11); + stop_colors[1] = param_10; + stop_positions[1] = param_11; + float param_12 = stop34.x; + float param_13 = stop34.y; + vec4 param_14; + float param_15; + gui_unpack_gradient_data(param_12, param_13, param_14, param_15); + stop_colors[2] = param_14; + stop_positions[2] = param_15; + float param_16 = stop34.z; + float param_17 = stop34.w; + vec4 param_18; + float param_19; + gui_unpack_gradient_data(param_16, param_17, param_18, param_19); + stop_colors[3] = param_18; + stop_positions[3] = param_19; + float param_20 = stop56.x; + float param_21 = stop56.y; + vec4 param_22; + float param_23; + gui_unpack_gradient_data(param_20, param_21, param_22, param_23); + stop_colors[4] = param_22; + stop_positions[4] = param_23; + stop_colors[5] = stop_colors[4]; + stop_positions[5] = stop_positions[4]; + vec4 c1 = stop_colors[0]; + vec4 c2 = stop_colors[0]; + float p1 = stop_positions[0]; + float p2 = stop_positions[0]; + for (int i = 1; i < 6; i++) + { + if (i >= _135) + { + break; + } + if (t <= stop_positions[i]) + { + c2 = stop_colors[i]; + p2 = stop_positions[i]; + int _314 = i - 1; + c1 = stop_colors[_314]; + p1 = stop_positions[_314]; + break; + } + if (i == (_135 - 1)) + { + c1 = stop_colors[i]; + c2 = stop_colors[i]; + p1 = stop_positions[i]; + p2 = stop_positions[i]; + } + } + float _347 = (t - p1) / max(p2 - p1, 9.9999997473787516355514526367188e-05); + float _374 = mix(c1.w, c2.w, _347); + vec4 gradient_color = vec4(mix(c1.xyz * c1.w, c2.xyz * c2.w, vec3(_347)) / vec3(max(_374, 9.9999997473787516355514526367188e-05)), _374); + vec2 param_24 = gl_FragCoord.xy; + vec4 _398 = gradient_color; + vec3 _400 = _398.xyz + vec3((gui_random(param_24) - 0.5) * 0.0039215688593685626983642578125); + float _402 = _400.x; + vec4 _448 = _398; + _448.x = _402; + _448.y = _400.y; + _448.z = _400.z; + gradient_color = _448; + frag_color = vec4(_402, _400.yz, (_398.w * (1.0 - smoothstep(-0.5, 0.5, gui_rounded_box_sdf(param_1, param_2, param_3)))) * color.w); + if (frag_color.w < 0.0) + { + frag_color += texture(tex_smp, uv); + } + } + +*/ +static const uint8_t gui_gradient_fs_source_glsl410[4397] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20, + 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, + 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69, + 0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a, + 0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20, + 0x3d,0x20,0x36,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x6d,0x65,0x74, + 0x61,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, + 0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74, + 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x35,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34, + 0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28, + 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x69,0x6e, + 0x20,0x76,0x65,0x63,0x34,0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x3b,0x0a,0x6c,0x61, + 0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, + 0x34,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x73,0x74,0x6f,0x70,0x33, + 0x34,0x3b,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,0x6c,0x61,0x79, + 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31, + 0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b, + 0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61, + 0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f, + 0x72,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20, + 0x2a,0x20,0x30,0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35, + 0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62, + 0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73,0x2c, + 0x20,0x76,0x65,0x63,0x32,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x2c, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20, + 0x28,0x61,0x62,0x73,0x28,0x70,0x6f,0x73,0x29,0x20,0x2d,0x20,0x68,0x61,0x6c,0x66, + 0x5f,0x73,0x69,0x7a,0x65,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x72,0x61, + 0x64,0x69,0x75,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28,0x5f,0x34, + 0x38,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x20,0x2b, + 0x20,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f,0x34,0x38,0x2e,0x78,0x2c,0x20, + 0x5f,0x34,0x38,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2d,0x20, + 0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20, + 0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69, + 0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76, + 0x61,0x6c,0x31,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x61,0x6c,0x32,0x2c, + 0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x2c,0x20,0x6f,0x75,0x74, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x70,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x76,0x61,0x6c,0x32,0x20,0x2a, + 0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x29,0x20,0x2a,0x20,0x39, + 0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31, + 0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38, + 0x65,0x2d,0x30,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x20,0x3d,0x20,0x76,0x65, + 0x63,0x34,0x28,0x6d,0x6f,0x64,0x28,0x76,0x61,0x6c,0x31,0x2c,0x20,0x32,0x35,0x36, + 0x2e,0x30,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36, + 0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34, + 0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f, + 0x6f,0x72,0x28,0x76,0x61,0x6c,0x31,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39, + 0x30,0x36,0x32,0x35,0x29,0x2c,0x20,0x32,0x35,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36, + 0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32, + 0x35,0x2c,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x76,0x61,0x6c,0x31,0x20,0x2a,0x20, + 0x31,0x2e,0x35,0x32,0x35,0x38,0x37,0x38,0x39,0x30,0x36,0x32,0x35,0x65,0x2d,0x30, + 0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38, + 0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32, + 0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x6d,0x6f,0x64,0x28,0x76,0x61,0x6c,0x32, + 0x2c,0x20,0x32,0x35,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33, + 0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36, + 0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x29,0x3b,0x0a,0x7d, + 0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72,0x61,0x6e,0x64, + 0x6f,0x6d,0x28,0x76,0x65,0x63,0x32,0x20,0x63,0x6f,0x6f,0x72,0x64,0x73,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x72,0x61, + 0x63,0x74,0x28,0x73,0x69,0x6e,0x28,0x64,0x6f,0x74,0x28,0x63,0x6f,0x6f,0x72,0x64, + 0x73,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x31,0x32,0x2e,0x39,0x38,0x39,0x38,0x30, + 0x30,0x34,0x35,0x33,0x31,0x38,0x36,0x30,0x33,0x35,0x31,0x35,0x36,0x32,0x35,0x2c, + 0x20,0x37,0x38,0x2e,0x32,0x33,0x33,0x30,0x30,0x31,0x37,0x30,0x38,0x39,0x38,0x34, + 0x33,0x37,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x34,0x33,0x37,0x35,0x38,0x2e,0x35, + 0x34,0x36,0x38,0x37,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20, + 0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x33,0x35,0x20, + 0x3d,0x20,0x69,0x6e,0x74,0x28,0x6d,0x65,0x74,0x61,0x2e,0x77,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x76, + 0x65,0x63,0x32,0x28,0x6d,0x65,0x74,0x61,0x2e,0x78,0x2c,0x20,0x6d,0x65,0x74,0x61, + 0x2e,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x31, + 0x34,0x33,0x20,0x3d,0x20,0x75,0x76,0x20,0x2a,0x20,0x5f,0x31,0x34,0x32,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x20,0x3d,0x20,0x5f,0x31,0x34,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63, + 0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x31,0x34,0x32, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x33,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b, + 0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x74,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x69,0x66,0x20,0x28,0x6d,0x65,0x74,0x61,0x2e,0x7a,0x20,0x3e,0x20,0x30,0x2e, + 0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x74,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x31,0x34,0x33, + 0x29,0x20,0x2f,0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x77,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,0x74,0x20,0x3d,0x20,0x66, + 0x6d,0x61,0x28,0x64,0x6f,0x74,0x28,0x75,0x76,0x2c,0x20,0x76,0x65,0x63,0x32,0x28, + 0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x7a,0x2c,0x20,0x73,0x74,0x6f,0x70,0x35,0x36, + 0x2e,0x77,0x29,0x29,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x30,0x2e,0x35,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x74,0x20,0x3d,0x20,0x63, + 0x6c,0x61,0x6d,0x70,0x28,0x74,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x2e,0x78,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x35,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x2e,0x79,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61, + 0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x73, + 0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x36,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30, + 0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69, + 0x74,0x69,0x6f,0x6e,0x73,0x5b,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74, + 0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x30,0x5d,0x20, + 0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x73, + 0x74,0x6f,0x70,0x31,0x32,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x73,0x74,0x6f, + 0x70,0x31,0x32,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61, + 0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x73,0x5b,0x31,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x73,0x5b,0x31,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x33,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x2e,0x79,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x75,0x69,0x5f, + 0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f, + 0x64,0x61,0x74,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x32,0x5d, + 0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x34,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b, + 0x32,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x36,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x2e,0x7a,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37, + 0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61, + 0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74, + 0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x33,0x5d,0x20,0x3d,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f, + 0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x33,0x5d,0x20,0x3d, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x30,0x20,0x3d,0x20, + 0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x31,0x20,0x3d,0x20,0x73, + 0x74,0x6f,0x70,0x35,0x36,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63, + 0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x33,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67, + 0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x32,0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x31,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x32,0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x34,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x32,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x34,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x32,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x35,0x5d,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x35, + 0x5d,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20, + 0x63,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73, + 0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x32, + 0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30, + 0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x31,0x20, + 0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73, + 0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, + 0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,0x73,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28, + 0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20,0x36, + 0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x69,0x20,0x3e,0x3d,0x20,0x5f,0x31, + 0x33,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,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,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x74,0x20,0x3c,0x3d,0x20,0x73,0x74,0x6f,0x70, + 0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x29,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x63,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f, + 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33, + 0x31,0x34,0x20,0x3d,0x20,0x69,0x20,0x2d,0x20,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f, + 0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x5f,0x33,0x31,0x34,0x5d,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x31,0x20,0x3d, + 0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b, + 0x5f,0x33,0x31,0x34,0x5d,0x3b,0x0a,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,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x69,0x20,0x3d,0x3d,0x20,0x28,0x5f,0x31,0x33,0x35,0x20,0x2d,0x20,0x31,0x29,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f, + 0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x31,0x20,0x3d,0x20,0x73,0x74, + 0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x32,0x20, + 0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73, + 0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x33,0x34,0x37,0x20,0x3d,0x20,0x28,0x74,0x20,0x2d,0x20,0x70,0x31,0x29,0x20,0x2f, + 0x20,0x6d,0x61,0x78,0x28,0x70,0x32,0x20,0x2d,0x20,0x70,0x31,0x2c,0x20,0x39,0x2e, + 0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36, + 0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65, + 0x2d,0x30,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x33,0x37,0x34,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x63,0x31,0x2e,0x77,0x2c, + 0x20,0x63,0x32,0x2e,0x77,0x2c,0x20,0x5f,0x33,0x34,0x37,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x6d,0x69,0x78, + 0x28,0x63,0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x31,0x2e,0x77,0x2c,0x20, + 0x63,0x32,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x32,0x2e,0x77,0x2c,0x20,0x76, + 0x65,0x63,0x33,0x28,0x5f,0x33,0x34,0x37,0x29,0x29,0x20,0x2f,0x20,0x76,0x65,0x63, + 0x33,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x37,0x34,0x2c,0x20,0x39,0x2e,0x39,0x39, + 0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35, + 0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30, + 0x35,0x29,0x29,0x2c,0x20,0x5f,0x33,0x37,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x34,0x20,0x3d,0x20, + 0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x39,0x38,0x20,0x3d, + 0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x30,0x30,0x20,0x3d, + 0x20,0x5f,0x33,0x39,0x38,0x2e,0x78,0x79,0x7a,0x20,0x2b,0x20,0x76,0x65,0x63,0x33, + 0x28,0x28,0x67,0x75,0x69,0x5f,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x32,0x34,0x29,0x20,0x2d,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36, + 0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32, + 0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34, + 0x30,0x32,0x20,0x3d,0x20,0x5f,0x34,0x30,0x30,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x34,0x34,0x38,0x20,0x3d,0x20,0x5f,0x33,0x39, + 0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x34,0x34,0x38,0x2e,0x78,0x20,0x3d,0x20, + 0x5f,0x34,0x30,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x34,0x34,0x38,0x2e,0x79, + 0x20,0x3d,0x20,0x5f,0x34,0x30,0x30,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f, + 0x34,0x34,0x38,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x34,0x30,0x30,0x2e,0x7a,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x20,0x3d,0x20,0x5f,0x34,0x34,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34, + 0x28,0x5f,0x34,0x30,0x32,0x2c,0x20,0x5f,0x34,0x30,0x30,0x2e,0x79,0x7a,0x2c,0x20, + 0x28,0x5f,0x33,0x39,0x38,0x2e,0x77,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d, + 0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x2d,0x30,0x2e,0x35, + 0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64, + 0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x33,0x29,0x29,0x29,0x29,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x66,0x72,0x61, + 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3c,0x20,0x30,0x2e,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,0x2b,0x3d,0x20,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #version 410 + + uniform sampler2D tex_smp; + + layout(location = 2) in float params; + layout(location = 0) in vec2 uv; + layout(location = 0) out vec4 frag_color; + layout(location = 1) in vec4 color; + + float gui_unpack_radius(float packed_params) + { + return floor(packed_params * 0.000244140625) * 0.25; + } + + float gui_rounded_box_sdf(vec2 pos, vec2 half_size, float radius) + { + vec2 _38 = (abs(pos) - half_size) + vec2(radius); + return (length(max(_38, vec2(0.0))) + min(max(_38.x, _38.y), 0.0)) - radius; + } + + float gui_normalized_sdf_alpha(inout float d) + { + d /= max(length(vec2(dFdx(d), dFdy(d))), 0.001000000047497451305389404296875); + return 1.0 - smoothstep(-0.589999973773956298828125, 0.589999973773956298828125, d); + } + + void main() + { + float param = params; + vec2 _98 = vec2(1.0) / (vec2(fwidth(uv.x), fwidth(uv.y)) + vec2(9.9999999747524270787835121154785e-07)); + vec2 param_1 = uv * _98; + vec2 param_2 = _98; + float param_3 = gui_unpack_radius(param); + float param_4 = gui_rounded_box_sdf(param_1, param_2, param_3); + float _116 = gui_normalized_sdf_alpha(param_4); + vec4 _137 = texture(tex_smp, (uv * 0.5) + vec2(0.5)); + frag_color = vec4(_137.xyz, _137.w * _116); + } + +*/ +static const uint8_t gui_image_clip_fs_source_glsl410[1206] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20, + 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, + 0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69, + 0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,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,0x75,0x76,0x3b, + 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,0x6c,0x61,0x79,0x6f,0x75, + 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20, + 0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b, + 0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61, + 0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28, + 0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x2a,0x20, + 0x30,0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78, + 0x5f,0x73,0x64,0x66,0x28,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73,0x2c,0x20,0x76, + 0x65,0x63,0x32,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x33,0x38,0x20,0x3d,0x20,0x28,0x61, + 0x62,0x73,0x28,0x70,0x6f,0x73,0x29,0x20,0x2d,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73, + 0x69,0x7a,0x65,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x72,0x61,0x64,0x69, + 0x75,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, + 0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x38,0x2c, + 0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x20,0x2b,0x20,0x6d, + 0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x38,0x2e,0x78,0x2c,0x20,0x5f,0x33, + 0x38,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2d,0x20,0x72,0x61, + 0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67, + 0x75,0x69,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x5f,0x73,0x64, + 0x66,0x5f,0x61,0x6c,0x70,0x68,0x61,0x28,0x69,0x6e,0x6f,0x75,0x74,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x64,0x20,0x2f, + 0x3d,0x20,0x6d,0x61,0x78,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x76,0x65,0x63, + 0x32,0x28,0x64,0x46,0x64,0x78,0x28,0x64,0x29,0x2c,0x20,0x64,0x46,0x64,0x79,0x28, + 0x64,0x29,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x30,0x31,0x30,0x30,0x30,0x30,0x30, + 0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35,0x33,0x38,0x39, + 0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x73,0x6d,0x6f, + 0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x2d,0x30,0x2e,0x35,0x38,0x39,0x39,0x39, + 0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39,0x38,0x38,0x32,0x38, + 0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x35,0x38,0x39,0x39,0x39,0x39,0x39,0x37,0x33, + 0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39,0x38,0x38,0x32,0x38,0x31,0x32,0x35,0x2c, + 0x20,0x64,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69, + 0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x39,0x38,0x20,0x3d,0x20,0x76, + 0x65,0x63,0x32,0x28,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x28,0x76,0x65,0x63,0x32, + 0x28,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x75,0x76,0x2e,0x78,0x29,0x2c,0x20,0x66, + 0x77,0x69,0x64,0x74,0x68,0x28,0x75,0x76,0x2e,0x79,0x29,0x29,0x20,0x2b,0x20,0x76, + 0x65,0x63,0x32,0x28,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37, + 0x35,0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33,0x35,0x31,0x32,0x31,0x31, + 0x35,0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, + 0x75,0x76,0x20,0x2a,0x20,0x5f,0x39,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, + 0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x39,0x38, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x33,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b, + 0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x34,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f, + 0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31, + 0x31,0x36,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69, + 0x7a,0x65,0x64,0x5f,0x73,0x64,0x66,0x5f,0x61,0x6c,0x70,0x68,0x61,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34, + 0x20,0x5f,0x31,0x33,0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, + 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x75,0x76,0x20,0x2a,0x20,0x30, + 0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x31,0x33,0x37,0x2e,0x78,0x79,0x7a, + 0x2c,0x20,0x5f,0x31,0x33,0x37,0x2e,0x77,0x20,0x2a,0x20,0x5f,0x31,0x31,0x36,0x29, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #version 410 + + const float _19[7] = float[](0.19946999847888946533203125, 0.17602999508380889892578125, 0.120980001986026763916015625, 0.0647599995136260986328125, 0.02700000070035457611083984375, 0.0087700001895427703857421875, 0.00221999990753829479217529296875); + + uniform sampler2D tex_smp; + + layout(location = 2) in float std_dev; + layout(location = 0) out vec4 frag_color; + layout(location = 0) in vec2 uv; + layout(location = 1) in vec4 color; + + void main() + { + float _47 = std_dev / vec2(textureSize(tex_smp, 0)).x; + frag_color = texture(tex_smp, uv) * _19[0]; + for (int i = 1; i < 7; i++) + { + vec2 _84 = vec2(float(i) * _47, 0.0); + frag_color += (texture(tex_smp, uv + _84) * _19[i]); + frag_color += (texture(tex_smp, uv - _84) * _19[i]); + } + } + +*/ +static const uint8_t gui_filter_blur_h_fs_source_glsl410[782] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x63,0x6f, + 0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x39,0x5b,0x37,0x5d, + 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x5b,0x5d,0x28,0x30,0x2e,0x31,0x39,0x39, + 0x34,0x36,0x39,0x39,0x39,0x38,0x34,0x37,0x38,0x38,0x38,0x39,0x34,0x36,0x35,0x33, + 0x33,0x32,0x30,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x31,0x37,0x36,0x30,0x32, + 0x39,0x39,0x39,0x35,0x30,0x38,0x33,0x38,0x30,0x38,0x38,0x39,0x38,0x39,0x32,0x35, + 0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x31,0x32,0x30,0x39,0x38,0x30,0x30, + 0x30,0x31,0x39,0x38,0x36,0x30,0x32,0x36,0x37,0x36,0x33,0x39,0x31,0x36,0x30,0x31, + 0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x36,0x34,0x37,0x35,0x39,0x39,0x39, + 0x39,0x35,0x31,0x33,0x36,0x32,0x36,0x30,0x39,0x38,0x36,0x33,0x32,0x38,0x31,0x32, + 0x35,0x2c,0x20,0x30,0x2e,0x30,0x32,0x37,0x30,0x30,0x30,0x30,0x30,0x30,0x37,0x30, + 0x30,0x33,0x35,0x34,0x35,0x37,0x36,0x31,0x31,0x30,0x38,0x33,0x39,0x38,0x34,0x33, + 0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x38,0x37,0x37,0x30,0x30,0x30,0x30,0x31, + 0x38,0x39,0x35,0x34,0x32,0x37,0x37,0x30,0x33,0x38,0x35,0x37,0x34,0x32,0x31,0x38, + 0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x32,0x32,0x31,0x39,0x39,0x39,0x39,0x39, + 0x30,0x37,0x35,0x33,0x38,0x32,0x39,0x34,0x37,0x39,0x32,0x31,0x37,0x35,0x32,0x39, + 0x32,0x39,0x36,0x38,0x37,0x35,0x29,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72, + 0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x74,0x65,0x78,0x5f, + 0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63, + 0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x3b,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,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,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, + 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20, + 0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69, + 0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x37,0x20,0x3d,0x20,0x73,0x74,0x64,0x5f,0x64, + 0x65,0x76,0x20,0x2f,0x20,0x76,0x65,0x63,0x32,0x28,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x53,0x69,0x7a,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x30, + 0x29,0x29,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x74, + 0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x29,0x20,0x2a,0x20,0x5f,0x31, + 0x39,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69, + 0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20,0x37,0x3b, + 0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x38,0x34,0x20,0x3d,0x20,0x76, + 0x65,0x63,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,0x29,0x20,0x2a,0x20,0x5f, + 0x34,0x37,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20, + 0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70, + 0x2c,0x20,0x75,0x76,0x20,0x2b,0x20,0x5f,0x38,0x34,0x29,0x20,0x2a,0x20,0x5f,0x31, + 0x39,0x5b,0x69,0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x28,0x74,0x65, + 0x78,0x74,0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75, + 0x76,0x20,0x2d,0x20,0x5f,0x38,0x34,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x5b,0x69, + 0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #version 410 + + const float _19[7] = float[](0.19946999847888946533203125, 0.17602999508380889892578125, 0.120980001986026763916015625, 0.0647599995136260986328125, 0.02700000070035457611083984375, 0.0087700001895427703857421875, 0.00221999990753829479217529296875); + + uniform sampler2D tex_smp; + + layout(location = 2) in float std_dev; + layout(location = 0) out vec4 frag_color; + layout(location = 0) in vec2 uv; + layout(location = 1) in vec4 color; + + void main() + { + float _47 = std_dev / vec2(textureSize(tex_smp, 0)).y; + frag_color = texture(tex_smp, uv) * _19[0]; + for (int i = 1; i < 7; i++) + { + vec2 _84 = vec2(0.0, float(i) * _47); + frag_color += (texture(tex_smp, uv + _84) * _19[i]); + frag_color += (texture(tex_smp, uv - _84) * _19[i]); + } + } + +*/ +static const uint8_t gui_filter_blur_v_fs_source_glsl410[782] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x63,0x6f, + 0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x39,0x5b,0x37,0x5d, + 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x5b,0x5d,0x28,0x30,0x2e,0x31,0x39,0x39, + 0x34,0x36,0x39,0x39,0x39,0x38,0x34,0x37,0x38,0x38,0x38,0x39,0x34,0x36,0x35,0x33, + 0x33,0x32,0x30,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x31,0x37,0x36,0x30,0x32, + 0x39,0x39,0x39,0x35,0x30,0x38,0x33,0x38,0x30,0x38,0x38,0x39,0x38,0x39,0x32,0x35, + 0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x31,0x32,0x30,0x39,0x38,0x30,0x30, + 0x30,0x31,0x39,0x38,0x36,0x30,0x32,0x36,0x37,0x36,0x33,0x39,0x31,0x36,0x30,0x31, + 0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x36,0x34,0x37,0x35,0x39,0x39,0x39, + 0x39,0x35,0x31,0x33,0x36,0x32,0x36,0x30,0x39,0x38,0x36,0x33,0x32,0x38,0x31,0x32, + 0x35,0x2c,0x20,0x30,0x2e,0x30,0x32,0x37,0x30,0x30,0x30,0x30,0x30,0x30,0x37,0x30, + 0x30,0x33,0x35,0x34,0x35,0x37,0x36,0x31,0x31,0x30,0x38,0x33,0x39,0x38,0x34,0x33, + 0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x38,0x37,0x37,0x30,0x30,0x30,0x30,0x31, + 0x38,0x39,0x35,0x34,0x32,0x37,0x37,0x30,0x33,0x38,0x35,0x37,0x34,0x32,0x31,0x38, + 0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x32,0x32,0x31,0x39,0x39,0x39,0x39,0x39, + 0x30,0x37,0x35,0x33,0x38,0x32,0x39,0x34,0x37,0x39,0x32,0x31,0x37,0x35,0x32,0x39, + 0x32,0x39,0x36,0x38,0x37,0x35,0x29,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72, + 0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x74,0x65,0x78,0x5f, + 0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63, + 0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x3b,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,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,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, + 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20, + 0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f,0x69, + 0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x37,0x20,0x3d,0x20,0x73,0x74,0x64,0x5f,0x64, + 0x65,0x76,0x20,0x2f,0x20,0x76,0x65,0x63,0x32,0x28,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x53,0x69,0x7a,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x30, + 0x29,0x29,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x74, + 0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x29,0x20,0x2a,0x20,0x5f,0x31, + 0x39,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69, + 0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20,0x37,0x3b, + 0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x38,0x34,0x20,0x3d,0x20,0x76, + 0x65,0x63,0x32,0x28,0x30,0x2e,0x30,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69, + 0x29,0x20,0x2a,0x20,0x5f,0x34,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20, + 0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70, + 0x2c,0x20,0x75,0x76,0x20,0x2b,0x20,0x5f,0x38,0x34,0x29,0x20,0x2a,0x20,0x5f,0x31, + 0x39,0x5b,0x69,0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x28,0x74,0x65, + 0x78,0x74,0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75, + 0x76,0x20,0x2d,0x20,0x5f,0x38,0x34,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x5b,0x69, + 0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #version 410 + + layout(location = 0) out vec4 frag_color; + layout(location = 1) in vec4 color; + layout(location = 0) in vec2 uv; + layout(location = 2) in float std_dev; + + void main() + { + frag_color = color; + } + +*/ +static const uint8_t gui_filter_color_fs_source_glsl410[207] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,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,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, + 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20, + 0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,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,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79, + 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32, + 0x29,0x20,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64, + 0x65,0x76,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29, + 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #version 410 + + uniform sampler2D tex_smp; + + layout(location = 0) out vec4 frag_color; + layout(location = 0) in vec2 uv; + layout(location = 1) in vec4 color; + layout(location = 2) in float std_dev; + + void main() + { + frag_color = texture(tex_smp, uv) * color; + } + +*/ +static const uint8_t gui_filter_texture_fs_source_glsl410[258] = { + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, + 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20, + 0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,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,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,0x75,0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61, + 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63, + 0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28, + 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x3b,0x0a, + 0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c, + 0x20,0x75,0x76,0x29,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x00, +}; +/* + cbuffer gui_rect_vs_params : register(b0) + { + row_major float4x4 _19_mvp : packoffset(c0); + row_major float4x4 _19_tm : packoffset(c4); + }; + + + static float4 gl_Position; + static float gl_PointSize; + static float3 position; + static float psize; + static float2 uv; + static float2 texcoord0; + static float4 color; + static float4 color0; + static float params; + + struct SPIRV_Cross_Input + { + float3 position : TEXCOORD0; + float2 texcoord0 : TEXCOORD1; + float4 color0 : TEXCOORD2; + float psize : TEXCOORD3; + }; + + struct SPIRV_Cross_Output + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float params : TEXCOORD2; + float4 gl_Position : SV_Position; + }; + + void vert_main() + { + gl_Position = mul(float4(position.xy, 0.0f, 1.0f), _19_mvp); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + params = position.z; + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + position = stage_input.position; + psize = stage_input.psize; + texcoord0 = stage_input.texcoord0; + color0 = stage_input.color0; + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output.uv = uv; + stage_output.color = color; + stage_output.params = params; + return stage_output; + } +*/ +static const uint8_t gui_rect_vs_source_hlsl4[1260] = { + 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x67,0x75,0x69,0x5f,0x72,0x65,0x63,0x74, + 0x5f,0x76,0x73,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,0x31,0x39,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,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x34,0x78,0x34,0x20,0x5f,0x31,0x39,0x5f,0x74,0x6d,0x20,0x3a,0x20,0x70,0x61,0x63, + 0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x34,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,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69, + 0x6e,0x74,0x53,0x69,0x7a,0x65,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a, + 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73,0x69, + 0x7a,0x65,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x75,0x76,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x73, + 0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c, + 0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,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,0x33,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a, + 0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30, + 0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20, + 0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x3a,0x20,0x54, + 0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x33,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,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, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44, + 0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,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,0x76,0x6f,0x69,0x64,0x20, + 0x76,0x65,0x72,0x74,0x5f,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, + 0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x70,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x2e,0x78,0x79,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e, + 0x30,0x66,0x29,0x2c,0x20,0x5f,0x31,0x39,0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20, + 0x3d,0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20, + 0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x70,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,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,0x70, + 0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70, + 0x75,0x74,0x2e,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x65, + 0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, + 0x69,0x6e,0x70,0x75,0x74,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3d,0x20,0x73,0x74, + 0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x30, + 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,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,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, +}; +/* + cbuffer gui_shadow_vs_params : register(b0) + { + row_major float4x4 _19_mvp : packoffset(c0); + row_major float4x4 _19_tm : packoffset(c4); + }; + + + static float4 gl_Position; + static float gl_PointSize; + static float3 position; + static float psize; + static float2 uv; + static float2 texcoord0; + static float4 color; + static float4 color0; + static float params; + static float2 offset; + + struct SPIRV_Cross_Input + { + float3 position : TEXCOORD0; + float2 texcoord0 : TEXCOORD1; + float4 color0 : TEXCOORD2; + float psize : TEXCOORD3; + }; + + struct SPIRV_Cross_Output + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float params : TEXCOORD2; + float2 offset : TEXCOORD3; + float4 gl_Position : SV_Position; + }; + + void vert_main() + { + gl_Position = mul(float4(position.xy, 0.0f, 1.0f), _19_mvp); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + params = position.z; + offset = mul(float4(0.0f, 0.0f, 0.0f, 1.0f), _19_tm).xy; + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + position = stage_input.position; + psize = stage_input.psize; + texcoord0 = stage_input.texcoord0; + color0 = stage_input.color0; + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output.uv = uv; + stage_output.color = color; + stage_output.params = params; + stage_output.offset = offset; + return stage_output; + } +*/ +static const uint8_t gui_shadow_vs_source_hlsl4[1410] = { + 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x67,0x75,0x69,0x5f,0x73,0x68,0x61,0x64, + 0x6f,0x77,0x5f,0x76,0x73,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,0x31,0x39,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,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x31,0x39,0x5f,0x74,0x6d,0x20,0x3a,0x20,0x70, + 0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x34,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,0x20,0x67,0x6c,0x5f,0x50, + 0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, + 0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, + 0x73,0x69,0x7a,0x65,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x20,0x75,0x76,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b, + 0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x73,0x74,0x61,0x74, + 0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b, + 0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x6f, + 0x66,0x66,0x73,0x65,0x74,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,0x33,0x20,0x70,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52, + 0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74, + 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f, + 0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f, + 0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, + 0x73,0x69,0x7a,0x65,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x33, + 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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20, + 0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x54,0x45, + 0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x20,0x6f,0x66,0x66,0x73,0x65,0x74,0x20,0x3a,0x20,0x54,0x45,0x58, + 0x43,0x4f,0x4f,0x52,0x44,0x33,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,0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,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,0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x34,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x79,0x2c,0x20,0x30, + 0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x31,0x39,0x5f, + 0x6d,0x76,0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69, + 0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72, + 0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x20,0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x6f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x6d,0x75, + 0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x30,0x2e,0x30,0x66,0x2c,0x20,0x30, + 0x2e,0x30,0x66,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29, + 0x2c,0x20,0x5f,0x31,0x39,0x5f,0x74,0x6d,0x29,0x2e,0x78,0x79,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,0x70,0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65, + 0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20,0x73,0x74, + 0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f, + 0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20, + 0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x63,0x6f, + 0x6c,0x6f,0x72,0x30,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,0x75,0x76,0x20,0x3d,0x20,0x75,0x76, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70, + 0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70, + 0x75,0x74,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75, + 0x74,0x70,0x75,0x74,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x6f,0x66, + 0x66,0x73,0x65,0x74,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 gui_gradient_vs_params : register(b0) + { + row_major float4x4 _19_mvp : packoffset(c0); + row_major float4x4 _19_tm : packoffset(c4); + }; + + + static float4 gl_Position; + static float gl_PointSize; + static float3 position; + static float psize; + static float2 uv; + static float2 texcoord0; + static float4 color; + static float4 color0; + static float params; + static float4 stop12; + static float4 stop34; + static float4 stop56; + static float4 meta; + + struct SPIRV_Cross_Input + { + float3 position : TEXCOORD0; + float2 texcoord0 : TEXCOORD1; + float4 color0 : TEXCOORD2; + float psize : TEXCOORD3; + }; + + struct SPIRV_Cross_Output + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float params : TEXCOORD2; + float4 stop12 : TEXCOORD3; + float4 stop34 : TEXCOORD4; + float4 stop56 : TEXCOORD5; + float4 meta : TEXCOORD6; + float4 gl_Position : SV_Position; + }; + + void vert_main() + { + gl_Position = mul(float4(position.xy, 0.0f, 1.0f), _19_mvp); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + params = position.z; + stop12 = _19_tm[0]; + stop34 = _19_tm[1]; + stop56 = _19_tm[2]; + meta = _19_tm[3]; + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + position = stage_input.position; + psize = stage_input.psize; + texcoord0 = stage_input.texcoord0; + color0 = stage_input.color0; + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output.uv = uv; + stage_output.color = color; + stage_output.params = params; + stage_output.stop12 = stop12; + stage_output.stop34 = stop34; + stage_output.stop56 = stop56; + stage_output.meta = meta; + return stage_output; + } +*/ +static const uint8_t gui_gradient_vs_source_hlsl4[1698] = { + 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x67,0x75,0x69,0x5f,0x67,0x72,0x61,0x64, + 0x69,0x65,0x6e,0x74,0x5f,0x76,0x73,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,0x31,0x39,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,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x31,0x39,0x5f,0x74,0x6d,0x20,0x3a, + 0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x34,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,0x20,0x67,0x6c, + 0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x3b,0x0a,0x73,0x74,0x61,0x74, + 0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64, + 0x30,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x73,0x74, + 0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x3b,0x0a,0x73, + 0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f, + 0x70,0x35,0x36,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x6d,0x65,0x74,0x61,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,0x33,0x20, + 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f, + 0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3a,0x20,0x54,0x45,0x58, + 0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3a,0x20,0x54,0x45,0x58,0x43, + 0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52, + 0x44,0x33,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20, + 0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20, + 0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x20,0x3a,0x20,0x54, + 0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x20,0x3a,0x20,0x54,0x45, + 0x58,0x43,0x4f,0x4f,0x52,0x44,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x20,0x3a,0x20,0x54,0x45,0x58, + 0x43,0x4f,0x4f,0x52,0x44,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x6d,0x65,0x74,0x61,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f, + 0x52,0x44,0x36,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,0x76, + 0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,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,0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x70, + 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x79,0x2c,0x20,0x30,0x2e,0x30,0x66, + 0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x31,0x39,0x5f,0x6d,0x76,0x70, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53, + 0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c, + 0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20, + 0x3d,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x20,0x3d,0x20,0x5f,0x31,0x39,0x5f,0x74, + 0x6d,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x33,0x34, + 0x20,0x3d,0x20,0x5f,0x31,0x39,0x5f,0x74,0x6d,0x5b,0x31,0x5d,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x20,0x3d,0x20,0x5f,0x31,0x39,0x5f,0x74, + 0x6d,0x5b,0x32,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x65,0x74,0x61,0x20,0x3d, + 0x20,0x5f,0x31,0x39,0x5f,0x74,0x6d,0x5b,0x33,0x5d,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,0x70,0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, + 0x6e,0x70,0x75,0x74,0x2e,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67, + 0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64, + 0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3d,0x20, + 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f, + 0x72,0x30,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,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74, + 0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74, + 0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70, + 0x75,0x74,0x2e,0x73,0x74,0x6f,0x70,0x31,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70, + 0x31,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75, + 0x74,0x70,0x75,0x74,0x2e,0x73,0x74,0x6f,0x70,0x33,0x34,0x20,0x3d,0x20,0x73,0x74, + 0x6f,0x70,0x33,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, + 0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x73,0x74,0x6f,0x70,0x35,0x36,0x20,0x3d,0x20, + 0x73,0x74,0x6f,0x70,0x35,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67, + 0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x6d,0x65,0x74,0x61,0x20,0x3d,0x20, + 0x6d,0x65,0x74,0x61,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 gui_filter_vs_params : register(b0) + { + row_major float4x4 _19_mvp : packoffset(c0); + row_major float4x4 _19_tm : packoffset(c4); + }; + + + static float4 gl_Position; + static float3 position; + static float2 uv; + static float2 texcoord0; + static float4 color; + static float4 color0; + static float std_dev; + + struct SPIRV_Cross_Input + { + float3 position : TEXCOORD0; + float2 texcoord0 : TEXCOORD1; + float4 color0 : TEXCOORD2; + }; + + struct SPIRV_Cross_Output + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float std_dev : TEXCOORD2; + float4 gl_Position : SV_Position; + }; + + void vert_main() + { + gl_Position = mul(float4(position.xy, 0.0f, 1.0f), _19_mvp); + uv = texcoord0; + color = color0; + std_dev = _19_tm[0].x; + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + position = stage_input.position; + texcoord0 = stage_input.texcoord0; + color0 = stage_input.color0; + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output.uv = uv; + stage_output.color = color; + stage_output.std_dev = std_dev; + return stage_output; + } +*/ +static const uint8_t gui_filter_vs_source_hlsl4[1135] = { + 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x67,0x75,0x69,0x5f,0x66,0x69,0x6c,0x74, + 0x65,0x72,0x5f,0x76,0x73,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,0x31,0x39,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,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x31,0x39,0x5f,0x74,0x6d,0x20,0x3a,0x20,0x70, + 0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x34,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,0x33,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,0x75,0x76,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30, + 0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x73,0x74,0x61, + 0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65, + 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,0x33,0x20,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f, + 0x6f,0x72,0x64,0x30,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c, + 0x6f,0x72,0x30,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54, + 0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3a,0x20,0x54,0x45, + 0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,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,0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,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,0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x79,0x2c,0x20, + 0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x31,0x39, + 0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20, + 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3d,0x20,0x5f,0x31,0x39, + 0x5f,0x74,0x6d,0x5b,0x30,0x5d,0x2e,0x78,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,0x74, + 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65, + 0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3d,0x20,0x73, + 0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72, + 0x30,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,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e, + 0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3d,0x20,0x73,0x74,0x64,0x5f,0x64,0x65, + 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 gui_filter_sgl_vs_params : register(b0) + { + row_major float4x4 _19_mvp : packoffset(c0); + row_major float4x4 _19_tm : packoffset(c4); + }; + + + static float4 gl_Position; + static float gl_PointSize; + static float3 position; + static float psize; + static float2 uv; + static float2 texcoord0; + static float4 color; + static float4 color0; + static float std_dev; + + struct SPIRV_Cross_Input + { + float3 position : TEXCOORD0; + float2 texcoord0 : TEXCOORD1; + float4 color0 : TEXCOORD2; + float psize : TEXCOORD3; + }; + + struct SPIRV_Cross_Output + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float std_dev : TEXCOORD2; + float4 gl_Position : SV_Position; + }; + + void vert_main() + { + gl_Position = mul(float4(position.xy, 0.0f, 1.0f), _19_mvp); + gl_PointSize = psize; + uv = texcoord0; + color = color0; + std_dev = _19_tm[0].x; + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + position = stage_input.position; + psize = stage_input.psize; + texcoord0 = stage_input.texcoord0; + color0 = stage_input.color0; + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output.uv = uv; + stage_output.color = color; + stage_output.std_dev = std_dev; + return stage_output; + } +*/ +static const uint8_t gui_filter_sgl_vs_source_hlsl4[1272] = { + 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x67,0x75,0x69,0x5f,0x66,0x69,0x6c,0x74, + 0x65,0x72,0x5f,0x73,0x67,0x6c,0x5f,0x76,0x73,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,0x31,0x39,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,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x31,0x39,0x5f,0x74,0x6d, + 0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x34, + 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,0x20, + 0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x3b,0x0a,0x73,0x74, + 0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x6f,0x73,0x69, + 0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x3b,0x0a,0x73,0x74,0x61,0x74, + 0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f, + 0x72,0x64,0x30,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a, + 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x64, + 0x5f,0x64,0x65,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,0x33,0x20,0x70,0x6f,0x73, + 0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44, + 0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65, + 0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f, + 0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52, + 0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73, + 0x69,0x7a,0x65,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x33,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54, + 0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3a,0x20,0x54,0x45, + 0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,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,0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,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,0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x79,0x2c,0x20, + 0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x31,0x39, + 0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f, + 0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x3d,0x20,0x70,0x73,0x69,0x7a,0x65,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f, + 0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, + 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x64, + 0x5f,0x64,0x65,0x76,0x20,0x3d,0x20,0x5f,0x31,0x39,0x5f,0x74,0x6d,0x5b,0x30,0x5d, + 0x2e,0x78,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,0x70,0x73,0x69,0x7a,0x65,0x20,0x3d, + 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x70,0x73,0x69, + 0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64, + 0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e, + 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e, + 0x70,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x30,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,0x75, + 0x76,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67, + 0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, + 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67, + 0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x73,0x74,0x64,0x5f,0x64,0x65,0x76, + 0x20,0x3d,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,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, +}; +/* + Texture2D tex : register(t0); + SamplerState smp : register(s0); + + static float params; + static float2 uv; + static float4 frag_color; + static float4 color; + + struct SPIRV_Cross_Input + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float params : TEXCOORD2; + }; + + struct SPIRV_Cross_Output + { + float4 frag_color : SV_Target0; + }; + + float mod(float x, float y) + { + return x - y * floor(x / y); + } + + float2 mod(float2 x, float2 y) + { + return x - y * floor(x / y); + } + + float3 mod(float3 x, float3 y) + { + return x - y * floor(x / y); + } + + float4 mod(float4 x, float4 y) + { + return x - y * floor(x / y); + } + + float gui_unpack_radius(float packed_params) + { + return floor(packed_params * 0.000244140625f) * 0.25f; + } + + float gui_unpack_secondary(float packed_params) + { + return mod(packed_params, 4096.0f) * 0.25f; + } + + float gui_rounded_box_sdf(float2 pos, float2 half_size, float radius) + { + float2 _46 = (abs(pos) - half_size) + radius.xx; + return (length(max(_46, 0.0f.xx)) + min(max(_46.x, _46.y), 0.0f)) - radius; + } + + float gui_normalized_sdf_alpha(inout float d) + { + d /= max(length(float2(ddx(d), ddy(d))), 0.001000000047497451305389404296875f); + return 1.0f - smoothstep(-0.589999973773956298828125f, 0.589999973773956298828125f, d); + } + + void frag_main() + { + float param = params; + float param_1 = params; + float _95 = gui_unpack_secondary(param_1); + float2 _110 = 1.0f.xx / (float2(fwidth(uv.x), fwidth(uv.y)) + 9.9999999747524270787835121154785e-07f.xx); + float2 param_2 = uv * _110; + float2 param_3 = _110; + float param_4 = gui_unpack_radius(param); + float d = gui_rounded_box_sdf(param_2, param_3, param_4); + if (_95 > 0.0f) + { + d = mad(-_95, 0.5f, abs(mad(_95, 0.5f, d))); + } + float param_5 = d; + float _142 = gui_normalized_sdf_alpha(param_5); + frag_color = float4(color.xyz, color.w * _142); + if (frag_color.w < 0.0f) + { + frag_color += tex.Sample(smp, uv); + } + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + params = stage_input.params; + uv = stage_input.uv; + color = stage_input.color; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.frag_color = frag_color; + return stage_output; + } +*/ +static const uint8_t gui_rounded_rect_fs_source_hlsl4[2229] = { + 0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x3e,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72, + 0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,0x53,0x74,0x61, + 0x74,0x65,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65, + 0x72,0x28,0x73,0x30,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x73,0x74,0x61, + 0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x3b,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,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,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,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, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44, + 0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,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,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d, + 0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x78,0x2c,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28, + 0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x78,0x2c,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x20,0x78,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x79,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20, + 0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6d,0x6f,0x64,0x28, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x78,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x78, + 0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75, + 0x73,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x70,0x61,0x63,0x6b,0x65,0x64, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x30,0x32, + 0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35,0x66,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32, + 0x35,0x66,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69, + 0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f,0x6e,0x64,0x61,0x72, + 0x79,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x6d,0x6f,0x64,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x2c,0x20,0x34,0x30,0x39,0x36,0x2e,0x30,0x66,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x32,0x35,0x66,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f, + 0x78,0x5f,0x73,0x64,0x66,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69, + 0x7a,0x65,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64,0x69,0x75,0x73, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f, + 0x34,0x36,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x70,0x6f,0x73,0x29,0x20,0x2d, + 0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x29,0x20,0x2b,0x20,0x72,0x61, + 0x64,0x69,0x75,0x73,0x2e,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28, + 0x5f,0x34,0x36,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2e,0x78,0x78,0x29,0x29,0x20,0x2b, + 0x20,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f,0x34,0x36,0x2e,0x78,0x2c,0x20, + 0x5f,0x34,0x36,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x29,0x20,0x2d, + 0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x67,0x75,0x69,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64, + 0x5f,0x73,0x64,0x66,0x5f,0x61,0x6c,0x70,0x68,0x61,0x28,0x69,0x6e,0x6f,0x75,0x74, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x64,0x20,0x2f,0x3d,0x20,0x6d,0x61,0x78,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x64,0x64,0x78,0x28,0x64,0x29,0x2c,0x20,0x64, + 0x64,0x79,0x28,0x64,0x29,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x30,0x31,0x30,0x30, + 0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35, + 0x33,0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x66,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x31,0x2e,0x30,0x66,0x20, + 0x2d,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x2d,0x30,0x2e, + 0x35,0x38,0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32, + 0x39,0x38,0x38,0x32,0x38,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x35,0x38,0x39, + 0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39,0x38,0x38, + 0x32,0x38,0x31,0x32,0x35,0x66,0x2c,0x20,0x64,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76, + 0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x39,0x35,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61, + 0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f,0x6e,0x64,0x61,0x72,0x79,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x5f,0x31,0x31,0x30,0x20,0x3d,0x20,0x31,0x2e,0x30,0x66,0x2e,0x78,0x78, + 0x20,0x2f,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x66,0x77,0x69,0x64,0x74, + 0x68,0x28,0x75,0x76,0x2e,0x78,0x29,0x2c,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28, + 0x75,0x76,0x2e,0x79,0x29,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39, + 0x39,0x39,0x37,0x34,0x37,0x35,0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33, + 0x35,0x31,0x32,0x31,0x31,0x35,0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37,0x66,0x2e, + 0x78,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x75,0x76,0x20,0x2a,0x20,0x5f, + 0x31,0x31,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x31,0x31,0x30,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x34,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72, + 0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f, + 0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x5f,0x39,0x35,0x20,0x3e,0x20,0x30,0x2e,0x30,0x66,0x29,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x20, + 0x3d,0x20,0x6d,0x61,0x64,0x28,0x2d,0x5f,0x39,0x35,0x2c,0x20,0x30,0x2e,0x35,0x66, + 0x2c,0x20,0x61,0x62,0x73,0x28,0x6d,0x61,0x64,0x28,0x5f,0x39,0x35,0x2c,0x20,0x30, + 0x2e,0x35,0x66,0x2c,0x20,0x64,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x35,0x20,0x3d,0x20,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x6e,0x6f,0x72, + 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x5f,0x73,0x64,0x66,0x5f,0x61,0x6c,0x70,0x68, + 0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a,0x20,0x5f,0x31,0x34,0x32,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x2e,0x77,0x20,0x3c,0x20,0x30,0x2e,0x30,0x66,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,0x2b,0x3d,0x20,0x74,0x65,0x78,0x2e,0x53,0x61,0x6d, + 0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x29,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,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x73,0x74,0x61, + 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, + 0x69,0x6e,0x70,0x75,0x74,0x2e,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f, + 0x6c,0x6f,0x72,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75, + 0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,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, +}; +/* + Texture2D tex : register(t0); + SamplerState smp : register(s0); + + static float params; + static float2 uv; + static float2 offset; + static float4 frag_color; + static float4 color; + + struct SPIRV_Cross_Input + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float params : TEXCOORD2; + float2 offset : TEXCOORD3; + }; + + struct SPIRV_Cross_Output + { + float4 frag_color : SV_Target0; + }; + + float mod(float x, float y) + { + return x - y * floor(x / y); + } + + float2 mod(float2 x, float2 y) + { + return x - y * floor(x / y); + } + + float3 mod(float3 x, float3 y) + { + return x - y * floor(x / y); + } + + float4 mod(float4 x, float4 y) + { + return x - y * floor(x / y); + } + + float gui_unpack_radius(float packed_params) + { + return floor(packed_params * 0.000244140625f) * 0.25f; + } + + float gui_unpack_secondary(float packed_params) + { + return mod(packed_params, 4096.0f) * 0.25f; + } + + float gui_rounded_box_sdf(float2 pos, float2 half_size, float radius) + { + float2 _43 = (abs(pos) - half_size) + radius.xx; + return (length(max(_43, 0.0f.xx)) + min(max(_43.x, _43.y), 0.0f)) - radius; + } + + void frag_main() + { + float param = params; + float _68 = gui_unpack_radius(param); + float param_1 = params; + float _72 = gui_unpack_secondary(param_1); + float2 _88 = 1.0f.xx / (float2(fwidth(uv.x), fwidth(uv.y)) + 9.9999999747524270787835121154785e-07f.xx); + float2 _101 = _88 - (1.5f * _72).xx; + float2 param_2 = uv * _88; + float2 param_3 = _101; + float param_4 = _68; + float2 param_5 = mad(uv, _88, offset); + float2 param_6 = _101; + float param_7 = _68; + frag_color = float4(color.xyz, color.w * ((1.0f - smoothstep(0.0f, max(1.0f, _72), gui_rounded_box_sdf(param_2, param_3, param_4))) * smoothstep(-1.0f, 0.0f, gui_rounded_box_sdf(param_5, param_6, param_7)))); + if (frag_color.w < 0.0f) + { + frag_color += tex.Sample(smp, uv); + } + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + params = stage_input.params; + uv = stage_input.uv; + offset = stage_input.offset; + color = stage_input.color; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.frag_color = frag_color; + return stage_output; + } +*/ +static const uint8_t gui_shadow_fs_source_hlsl4[2182] = { + 0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x3e,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72, + 0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,0x53,0x74,0x61, + 0x74,0x65,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65, + 0x72,0x28,0x73,0x30,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x73,0x74,0x61, + 0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x3b,0x0a,0x73, + 0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x6f,0x66,0x66, + 0x73,0x65,0x74,0x3b,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,0x34,0x20,0x63,0x6f,0x6c, + 0x6f,0x72,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45, + 0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,0x43, + 0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x6f,0x66,0x66,0x73,0x65,0x74,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f, + 0x4f,0x52,0x44,0x33,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,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x78,0x2c, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x78,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x79,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20, + 0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6d,0x6f,0x64,0x28, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x78,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x78, + 0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x78,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72, + 0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66,0x6c, + 0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f, + 0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x63, + 0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x70, + 0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x2a,0x20,0x30, + 0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35,0x66,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x32,0x35,0x66,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63, + 0x6f,0x6e,0x64,0x61,0x72,0x79,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x63, + 0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x6f,0x64,0x28,0x70,0x61,0x63, + 0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2c,0x20,0x34,0x30,0x39,0x36, + 0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x66,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64, + 0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x70,0x6f,0x73,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x68,0x61, + 0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72, + 0x61,0x64,0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x20,0x5f,0x34,0x33,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x70, + 0x6f,0x73,0x29,0x20,0x2d,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x29, + 0x20,0x2b,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x2e,0x78,0x78,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68, + 0x28,0x6d,0x61,0x78,0x28,0x5f,0x34,0x33,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2e,0x78, + 0x78,0x29,0x29,0x20,0x2b,0x20,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f,0x34, + 0x33,0x2e,0x78,0x2c,0x20,0x5f,0x34,0x33,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30, + 0x66,0x29,0x29,0x20,0x2d,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x38,0x20,0x3d,0x20,0x67,0x75, + 0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28, + 0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x37, + 0x32,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73, + 0x65,0x63,0x6f,0x6e,0x64,0x61,0x72,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x38, + 0x38,0x20,0x3d,0x20,0x31,0x2e,0x30,0x66,0x2e,0x78,0x78,0x20,0x2f,0x20,0x28,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x28,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x75,0x76,0x2e, + 0x78,0x29,0x2c,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x75,0x76,0x2e,0x79,0x29, + 0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37, + 0x35,0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33,0x35,0x31,0x32,0x31,0x31, + 0x35,0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37,0x66,0x2e,0x78,0x78,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x30,0x31,0x20, + 0x3d,0x20,0x5f,0x38,0x38,0x20,0x2d,0x20,0x28,0x31,0x2e,0x35,0x66,0x20,0x2a,0x20, + 0x5f,0x37,0x32,0x29,0x2e,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x75,0x76, + 0x20,0x2a,0x20,0x5f,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x31,0x30, + 0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f,0x36,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d, + 0x20,0x6d,0x61,0x64,0x28,0x75,0x76,0x2c,0x20,0x5f,0x38,0x38,0x2c,0x20,0x6f,0x66, + 0x66,0x73,0x65,0x74,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,0x20,0x5f,0x31,0x30,0x31, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x36,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x63,0x6f, + 0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a,0x20,0x28,0x28,0x31,0x2e,0x30,0x66,0x20,0x2d, + 0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x66, + 0x2c,0x20,0x6d,0x61,0x78,0x28,0x31,0x2e,0x30,0x66,0x2c,0x20,0x5f,0x37,0x32,0x29, + 0x2c,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f, + 0x78,0x5f,0x73,0x64,0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29, + 0x29,0x29,0x20,0x2a,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28, + 0x2d,0x31,0x2e,0x30,0x66,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x67,0x75,0x69, + 0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x29,0x29,0x29,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x2e,0x77,0x20,0x3c,0x20,0x30,0x2e,0x30,0x66,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,0x2b,0x3d,0x20,0x74,0x65,0x78,0x2e,0x53,0x61,0x6d, + 0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x29,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,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x73,0x74,0x61, + 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, + 0x69,0x6e,0x70,0x75,0x74,0x2e,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x66, + 0x66,0x73,0x65,0x74,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70, + 0x75,0x74,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70, + 0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,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, +}; +/* + Texture2D tex : register(t0); + SamplerState smp : register(s0); + + static float params; + static float2 uv; + static float4 frag_color; + static float4 color; + static float2 offset; + + struct SPIRV_Cross_Input + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float params : TEXCOORD2; + float2 offset : TEXCOORD3; + }; + + struct SPIRV_Cross_Output + { + float4 frag_color : SV_Target0; + }; + + float mod(float x, float y) + { + return x - y * floor(x / y); + } + + float2 mod(float2 x, float2 y) + { + return x - y * floor(x / y); + } + + float3 mod(float3 x, float3 y) + { + return x - y * floor(x / y); + } + + float4 mod(float4 x, float4 y) + { + return x - y * floor(x / y); + } + + float gui_unpack_radius(float packed_params) + { + return floor(packed_params * 0.000244140625f) * 0.25f; + } + + float gui_unpack_secondary(float packed_params) + { + return mod(packed_params, 4096.0f) * 0.25f; + } + + float gui_rounded_box_sdf(float2 pos, float2 half_size, float radius) + { + float2 _43 = (abs(pos) - half_size) + radius.xx; + return (length(max(_43, 0.0f.xx)) + min(max(_43.x, _43.y), 0.0f)) - radius; + } + + void frag_main() + { + float param = params; + float param_1 = params; + float _72 = gui_unpack_secondary(param_1); + float2 _88 = 1.0f.xx / (float2(fwidth(uv.x), fwidth(uv.y)) + 9.9999999747524270787835121154785e-07f.xx); + float2 param_2 = uv * _88; + float2 param_3 = _88 - (1.5f * _72).xx; + float param_4 = gui_unpack_radius(param); + frag_color = float4(color.xyz, color.w * (1.0f - smoothstep(-_72, _72, gui_rounded_box_sdf(param_2, param_3, param_4)))); + if (frag_color.w < 0.0f) + { + frag_color += tex.Sample(smp, uv); + } + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + params = stage_input.params; + uv = stage_input.uv; + color = stage_input.color; + offset = stage_input.offset; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.frag_color = frag_color; + return stage_output; + } +*/ +static const uint8_t gui_blur_fs_source_hlsl4[1955] = { + 0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x3e,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72, + 0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,0x53,0x74,0x61, + 0x74,0x65,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65, + 0x72,0x28,0x73,0x30,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x73,0x74,0x61, + 0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x3b,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,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74, + 0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x6f,0x66,0x66,0x73, + 0x65,0x74,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45, + 0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,0x43, + 0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x6f,0x66,0x66,0x73,0x65,0x74,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f, + 0x4f,0x52,0x44,0x33,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,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x78,0x2c, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x78,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x79,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20, + 0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6d,0x6f,0x64,0x28, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x78,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x78, + 0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x78,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72, + 0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66,0x6c, + 0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f, + 0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x63, + 0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x70, + 0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x2a,0x20,0x30, + 0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35,0x66,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x32,0x35,0x66,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63, + 0x6f,0x6e,0x64,0x61,0x72,0x79,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x63, + 0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x6f,0x64,0x28,0x70,0x61,0x63, + 0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2c,0x20,0x34,0x30,0x39,0x36, + 0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x66,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64, + 0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x70,0x6f,0x73,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x68,0x61, + 0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72, + 0x61,0x64,0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x20,0x5f,0x34,0x33,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x70, + 0x6f,0x73,0x29,0x20,0x2d,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x29, + 0x20,0x2b,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x2e,0x78,0x78,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68, + 0x28,0x6d,0x61,0x78,0x28,0x5f,0x34,0x33,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2e,0x78, + 0x78,0x29,0x29,0x20,0x2b,0x20,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f,0x34, + 0x33,0x2e,0x78,0x2c,0x20,0x5f,0x34,0x33,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30, + 0x66,0x29,0x29,0x20,0x2d,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20, + 0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x37,0x32,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e, + 0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f,0x6e,0x64,0x61,0x72,0x79,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x20,0x5f,0x38,0x38,0x20,0x3d,0x20,0x31,0x2e,0x30,0x66,0x2e,0x78, + 0x78,0x20,0x2f,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x66,0x77,0x69,0x64, + 0x74,0x68,0x28,0x75,0x76,0x2e,0x78,0x29,0x2c,0x20,0x66,0x77,0x69,0x64,0x74,0x68, + 0x28,0x75,0x76,0x2e,0x79,0x29,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39, + 0x39,0x39,0x39,0x37,0x34,0x37,0x35,0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37,0x38, + 0x33,0x35,0x31,0x32,0x31,0x31,0x35,0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37,0x66, + 0x2e,0x78,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x75,0x76,0x20,0x2a,0x20, + 0x5f,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x38,0x38,0x20,0x2d,0x20, + 0x28,0x31,0x2e,0x35,0x66,0x20,0x2a,0x20,0x5f,0x37,0x32,0x29,0x2e,0x78,0x78,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x34,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f, + 0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a, + 0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30, + 0x66,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x2d, + 0x5f,0x37,0x32,0x2c,0x20,0x5f,0x37,0x32,0x2c,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f, + 0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x69,0x66,0x20,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, + 0x77,0x20,0x3c,0x20,0x30,0x2e,0x30,0x66,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,0x2b,0x3d,0x20,0x74,0x65,0x78,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65, + 0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x29,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,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, + 0x69,0x6e,0x70,0x75,0x74,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70, + 0x75,0x74,0x2e,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x63, + 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x66,0x66,0x73,0x65,0x74, + 0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x6f, + 0x66,0x66,0x73,0x65,0x74,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, +}; +/* + Texture2D tex : register(t0); + SamplerState smp : register(s0); + + static float4 gl_FragCoord; + static float params; + static float4 meta; + static float2 uv; + static float4 stop56; + static float4 stop12; + static float4 stop34; + static float4 frag_color; + static float4 color; + + struct SPIRV_Cross_Input + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float params : TEXCOORD2; + float4 stop12 : TEXCOORD3; + float4 stop34 : TEXCOORD4; + float4 stop56 : TEXCOORD5; + float4 meta : TEXCOORD6; + float4 gl_FragCoord : SV_Position; + }; + + struct SPIRV_Cross_Output + { + float4 frag_color : SV_Target0; + }; + + float mod(float x, float y) + { + return x - y * floor(x / y); + } + + float2 mod(float2 x, float2 y) + { + return x - y * floor(x / y); + } + + float3 mod(float3 x, float3 y) + { + return x - y * floor(x / y); + } + + float4 mod(float4 x, float4 y) + { + return x - y * floor(x / y); + } + + float gui_unpack_radius(float packed_params) + { + return floor(packed_params * 0.000244140625f) * 0.25f; + } + + float gui_rounded_box_sdf(float2 pos, float2 half_size, float radius) + { + float2 _48 = (abs(pos) - half_size) + radius.xx; + return (length(max(_48, 0.0f.xx)) + min(max(_48.x, _48.y), 0.0f)) - radius; + } + + void gui_unpack_gradient_data(float val1, float val2, out float4 c, out float p) + { + p = floor(val2 * 0.00390625f) * 9.9999997473787516355514526367188e-05f; + c = float4(mod(val1, 256.0f) * 0.0039215688593685626983642578125f, mod(floor(val1 * 0.00390625f), 256.0f) * 0.0039215688593685626983642578125f, floor(val1 * 1.52587890625e-05f) * 0.0039215688593685626983642578125f, mod(val2, 256.0f) * 0.0039215688593685626983642578125f); + } + + float gui_random(float2 coords) + { + return frac(sin(dot(coords, float2(12.98980045318603515625f, 78.233001708984375f))) * 43758.546875f); + } + + void frag_main() + { + float param = params; + int _135 = int(meta.w); + float2 _142 = float2(meta.x, meta.y); + float2 _143 = uv * _142; + float2 param_1 = _143; + float2 param_2 = _142; + float param_3 = gui_unpack_radius(param); + float t; + if (meta.z > 0.5f) + { + t = length(_143) / stop56.w; + } + else + { + t = mad(dot(uv, float2(stop56.z, stop56.w)), 0.5f, 0.5f); + } + t = clamp(t, 0.0f, 1.0f); + float param_4 = stop12.x; + float param_5 = stop12.y; + float4 param_6; + float param_7; + gui_unpack_gradient_data(param_4, param_5, param_6, param_7); + float4 stop_colors[6]; + stop_colors[0] = param_6; + float stop_positions[6]; + stop_positions[0] = param_7; + float param_8 = stop12.z; + float param_9 = stop12.w; + float4 param_10; + float param_11; + gui_unpack_gradient_data(param_8, param_9, param_10, param_11); + stop_colors[1] = param_10; + stop_positions[1] = param_11; + float param_12 = stop34.x; + float param_13 = stop34.y; + float4 param_14; + float param_15; + gui_unpack_gradient_data(param_12, param_13, param_14, param_15); + stop_colors[2] = param_14; + stop_positions[2] = param_15; + float param_16 = stop34.z; + float param_17 = stop34.w; + float4 param_18; + float param_19; + gui_unpack_gradient_data(param_16, param_17, param_18, param_19); + stop_colors[3] = param_18; + stop_positions[3] = param_19; + float param_20 = stop56.x; + float param_21 = stop56.y; + float4 param_22; + float param_23; + gui_unpack_gradient_data(param_20, param_21, param_22, param_23); + stop_colors[4] = param_22; + stop_positions[4] = param_23; + stop_colors[5] = stop_colors[4]; + stop_positions[5] = stop_positions[4]; + float4 c1 = stop_colors[0]; + float4 c2 = stop_colors[0]; + float p1 = stop_positions[0]; + float p2 = stop_positions[0]; + for (int i = 1; i < 6; i++) + { + if (i >= _135) + { + break; + } + if (t <= stop_positions[i]) + { + c2 = stop_colors[i]; + p2 = stop_positions[i]; + int _314 = i - 1; + c1 = stop_colors[_314]; + p1 = stop_positions[_314]; + break; + } + if (i == (_135 - 1)) + { + c1 = stop_colors[i]; + c2 = stop_colors[i]; + p1 = stop_positions[i]; + p2 = stop_positions[i]; + } + } + float _347 = (t - p1) / max(p2 - p1, 9.9999997473787516355514526367188e-05f); + float _374 = lerp(c1.w, c2.w, _347); + float4 gradient_color = float4(lerp(c1.xyz * c1.w, c2.xyz * c2.w, _347.xxx) / max(_374, 9.9999997473787516355514526367188e-05f).xxx, _374); + float2 param_24 = gl_FragCoord.xy; + float4 _398 = gradient_color; + float3 _400 = _398.xyz + ((gui_random(param_24) - 0.5f) * 0.0039215688593685626983642578125f).xxx; + float _402 = _400.x; + float4 _448 = _398; + _448.x = _402; + _448.y = _400.y; + _448.z = _400.z; + gradient_color = _448; + frag_color = float4(_402, _400.yz, (_398.w * (1.0f - smoothstep(-0.5f, 0.5f, gui_rounded_box_sdf(param_1, param_2, param_3)))) * color.w); + if (frag_color.w < 0.0f) + { + frag_color += tex.Sample(smp, uv); + } + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + gl_FragCoord = stage_input.gl_FragCoord; + gl_FragCoord.w = 1.0 / gl_FragCoord.w; + params = stage_input.params; + meta = stage_input.meta; + uv = stage_input.uv; + stop56 = stage_input.stop56; + stop12 = stage_input.stop12; + stop34 = stage_input.stop34; + color = stage_input.color; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.frag_color = frag_color; + return stage_output; + } +*/ +static const uint8_t gui_gradient_fs_source_hlsl4[5519] = { + 0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x3e,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72, + 0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,0x53,0x74,0x61, + 0x74,0x65,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65, + 0x72,0x28,0x73,0x30,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f, + 0x72,0x64,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6d,0x65,0x74,0x61,0x3b,0x0a,0x73,0x74,0x61, + 0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x3b,0x0a,0x73, + 0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f, + 0x70,0x35,0x36,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69, + 0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x3b, + 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,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f, + 0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44, + 0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74, + 0x6f,0x70,0x31,0x32,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x33, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f, + 0x70,0x33,0x34,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x34,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f,0x70, + 0x35,0x36,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x35,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6d,0x65,0x74,0x61,0x20, + 0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x36,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43, + 0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,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,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x78,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f, + 0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20, + 0x78,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20, + 0x2a,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x20,0x78,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x79, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78, + 0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f, + 0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6d, + 0x6f,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x78,0x2c,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x6f, + 0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61, + 0x64,0x69,0x75,0x73,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x63,0x6b,0x65, + 0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x70,0x61,0x63, + 0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x2a,0x20,0x30,0x2e,0x30, + 0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35,0x66,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x32,0x35,0x66,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f, + 0x73,0x64,0x66,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x2c,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x34,0x38, + 0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x70,0x6f,0x73,0x29,0x20,0x2d,0x20,0x68, + 0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x29,0x20,0x2b,0x20,0x72,0x61,0x64,0x69, + 0x75,0x73,0x2e,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28,0x5f,0x34, + 0x38,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2e,0x78,0x78,0x29,0x29,0x20,0x2b,0x20,0x6d, + 0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f,0x34,0x38,0x2e,0x78,0x2c,0x20,0x5f,0x34, + 0x38,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x29,0x20,0x2d,0x20,0x72, + 0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x67, + 0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69,0x65, + 0x6e,0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x61, + 0x6c,0x31,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x61,0x6c,0x32,0x2c,0x20, + 0x6f,0x75,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x2c,0x20,0x6f,0x75, + 0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x70,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x76,0x61,0x6c,0x32,0x20, + 0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x66,0x29,0x20,0x2a, + 0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37, + 0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31, + 0x38,0x38,0x65,0x2d,0x30,0x35,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x20,0x3d, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x6d,0x6f,0x64,0x28,0x76,0x61,0x6c,0x31, + 0x2c,0x20,0x32,0x35,0x36,0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30, + 0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32, + 0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x66,0x2c,0x20, + 0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x76,0x61,0x6c,0x31,0x20,0x2a, + 0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x66,0x29,0x2c,0x20,0x32, + 0x35,0x36,0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32, + 0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38, + 0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x66,0x2c,0x20,0x66,0x6c,0x6f, + 0x6f,0x72,0x28,0x76,0x61,0x6c,0x31,0x20,0x2a,0x20,0x31,0x2e,0x35,0x32,0x35,0x38, + 0x37,0x38,0x39,0x30,0x36,0x32,0x35,0x65,0x2d,0x30,0x35,0x66,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36, + 0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32, + 0x35,0x66,0x2c,0x20,0x6d,0x6f,0x64,0x28,0x76,0x61,0x6c,0x32,0x2c,0x20,0x32,0x35, + 0x36,0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31, + 0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33, + 0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72,0x61,0x6e,0x64,0x6f,0x6d, + 0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x63,0x6f,0x6f,0x72,0x64,0x73,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x72,0x61, + 0x63,0x28,0x73,0x69,0x6e,0x28,0x64,0x6f,0x74,0x28,0x63,0x6f,0x6f,0x72,0x64,0x73, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x32,0x2e,0x39,0x38,0x39,0x38, + 0x30,0x30,0x34,0x35,0x33,0x31,0x38,0x36,0x30,0x33,0x35,0x31,0x35,0x36,0x32,0x35, + 0x66,0x2c,0x20,0x37,0x38,0x2e,0x32,0x33,0x33,0x30,0x30,0x31,0x37,0x30,0x38,0x39, + 0x38,0x34,0x33,0x37,0x35,0x66,0x29,0x29,0x29,0x20,0x2a,0x20,0x34,0x33,0x37,0x35, + 0x38,0x2e,0x35,0x34,0x36,0x38,0x37,0x35,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76, + 0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x6e,0x74,0x20,0x5f,0x31,0x33,0x35,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x6d, + 0x65,0x74,0x61,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x6d,0x65,0x74,0x61,0x2e,0x78,0x2c,0x20,0x6d,0x65,0x74,0x61,0x2e,0x79,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x34, + 0x33,0x20,0x3d,0x20,0x75,0x76,0x20,0x2a,0x20,0x5f,0x31,0x34,0x32,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x20,0x3d,0x20,0x5f,0x31,0x34,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f, + 0x31,0x34,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70, + 0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x74,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x6d,0x65,0x74,0x61,0x2e,0x7a,0x20,0x3e, + 0x20,0x30,0x2e,0x35,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x74,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28, + 0x5f,0x31,0x34,0x33,0x29,0x20,0x2f,0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x77, + 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,0x74, + 0x20,0x3d,0x20,0x6d,0x61,0x64,0x28,0x64,0x6f,0x74,0x28,0x75,0x76,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x28,0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x7a,0x2c,0x20, + 0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x77,0x29,0x29,0x2c,0x20,0x30,0x2e,0x35,0x66, + 0x2c,0x20,0x30,0x2e,0x35,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x74,0x20,0x3d,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x74,0x2c,0x20, + 0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d, + 0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x73, + 0x74,0x6f,0x70,0x31,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67, + 0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f, + 0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x20, + 0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x73,0x5b,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70, + 0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x30,0x5d,0x20,0x3d,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x73,0x74,0x6f, + 0x70,0x31,0x32,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x31, + 0x32,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61, + 0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x73,0x5b,0x31,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x73,0x5b,0x31,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x33,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x2e,0x79,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x75, + 0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e, + 0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b, + 0x32,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x34,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, + 0x73,0x5b,0x32,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x36,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x2e,0x7a,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x37,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x2e,0x77,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x75,0x69,0x5f, + 0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f, + 0x64,0x61,0x74,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x36,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x33,0x5d, + 0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b, + 0x33,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32, + 0x30,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x78,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x31, + 0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x32, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x32,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e, + 0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61, + 0x74,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x30,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x32,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x32,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x34,0x5d,0x20,0x3d, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73, + 0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x34,0x5d, + 0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x33,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x35,0x5d,0x20, + 0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x34,0x5d, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x73,0x5b,0x35,0x5d,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70, + 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f, + 0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f, + 0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70, + 0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x30,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x32,0x20,0x3d,0x20,0x73,0x74, + 0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x30,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20, + 0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20,0x36,0x3b,0x20,0x69,0x2b,0x2b,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x69,0x20,0x3e,0x3d,0x20,0x5f,0x31,0x33,0x35,0x29,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,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,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x74,0x20,0x3c,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, + 0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b, + 0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x70,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x31,0x34,0x20,0x3d,0x20,0x69, + 0x20,0x2d,0x20,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x63,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x73,0x5b,0x5f,0x33,0x31,0x34,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f, + 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x5f,0x33,0x31,0x34,0x5d,0x3b, + 0x0a,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,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x69,0x20,0x3d,0x3d,0x20,0x28, + 0x5f,0x31,0x33,0x35,0x20,0x2d,0x20,0x31,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x63,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x63,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x70,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73, + 0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70, + 0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x34,0x37,0x20,0x3d,0x20, + 0x28,0x74,0x20,0x2d,0x20,0x70,0x31,0x29,0x20,0x2f,0x20,0x6d,0x61,0x78,0x28,0x70, + 0x32,0x20,0x2d,0x20,0x70,0x31,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39, + 0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34, + 0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x66,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x37,0x34,0x20, + 0x3d,0x20,0x6c,0x65,0x72,0x70,0x28,0x63,0x31,0x2e,0x77,0x2c,0x20,0x63,0x32,0x2e, + 0x77,0x2c,0x20,0x5f,0x33,0x34,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x6c,0x65,0x72, + 0x70,0x28,0x63,0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x31,0x2e,0x77,0x2c, + 0x20,0x63,0x32,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x32,0x2e,0x77,0x2c,0x20, + 0x5f,0x33,0x34,0x37,0x2e,0x78,0x78,0x78,0x29,0x20,0x2f,0x20,0x6d,0x61,0x78,0x28, + 0x5f,0x33,0x37,0x34,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34, + 0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32, + 0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x66,0x29,0x2e,0x78,0x78, + 0x78,0x2c,0x20,0x5f,0x33,0x37,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x34,0x20,0x3d,0x20, + 0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x33,0x39,0x38, + 0x20,0x3d,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34, + 0x30,0x30,0x20,0x3d,0x20,0x5f,0x33,0x39,0x38,0x2e,0x78,0x79,0x7a,0x20,0x2b,0x20, + 0x28,0x28,0x67,0x75,0x69,0x5f,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x32,0x34,0x29,0x20,0x2d,0x20,0x30,0x2e,0x35,0x66,0x29,0x20,0x2a, + 0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33, + 0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31, + 0x32,0x35,0x66,0x29,0x2e,0x78,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x34,0x30,0x32,0x20,0x3d,0x20,0x5f,0x34,0x30,0x30,0x2e, + 0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x34, + 0x34,0x38,0x20,0x3d,0x20,0x5f,0x33,0x39,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f, + 0x34,0x34,0x38,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x34,0x30,0x32,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x5f,0x34,0x34,0x38,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x34,0x30,0x30,0x2e, + 0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x34,0x34,0x38,0x2e,0x7a,0x20,0x3d,0x20, + 0x5f,0x34,0x30,0x30,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x72,0x61,0x64, + 0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x34,0x34, + 0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x34,0x30,0x32,0x2c, + 0x20,0x5f,0x34,0x30,0x30,0x2e,0x79,0x7a,0x2c,0x20,0x28,0x5f,0x33,0x39,0x38,0x2e, + 0x77,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f, + 0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x2d,0x30,0x2e,0x35,0x66,0x2c,0x20,0x30,0x2e, + 0x35,0x66,0x2c,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f, + 0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x33,0x29,0x29,0x29,0x29,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3c,0x20,0x30,0x2e,0x30,0x66,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,0x2b,0x3d,0x20,0x74,0x65,0x78,0x2e,0x53, + 0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x29,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,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f, + 0x72,0x64,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74, + 0x2e,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e, + 0x77,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2f,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61, + 0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70, + 0x75,0x74,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6d, + 0x65,0x74,0x61,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75, + 0x74,0x2e,0x6d,0x65,0x74,0x61,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d, + 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x75,0x76,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x20,0x3d,0x20,0x73,0x74, + 0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x73,0x74,0x6f,0x70,0x35,0x36, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x20,0x3d,0x20,0x73, + 0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x73,0x74,0x6f,0x70,0x31, + 0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x20,0x3d,0x20, + 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x73,0x74,0x6f,0x70, + 0x33,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f, + 0x72,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, +}; +/* + Texture2D tex : register(t0); + SamplerState smp : register(s0); + + static float params; + static float2 uv; + static float4 frag_color; + static float4 color; + + struct SPIRV_Cross_Input + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float params : TEXCOORD2; + }; + + struct SPIRV_Cross_Output + { + float4 frag_color : SV_Target0; + }; + + float gui_unpack_radius(float packed_params) + { + return floor(packed_params * 0.000244140625f) * 0.25f; + } + + float gui_rounded_box_sdf(float2 pos, float2 half_size, float radius) + { + float2 _38 = (abs(pos) - half_size) + radius.xx; + return (length(max(_38, 0.0f.xx)) + min(max(_38.x, _38.y), 0.0f)) - radius; + } + + float gui_normalized_sdf_alpha(inout float d) + { + d /= max(length(float2(ddx(d), ddy(d))), 0.001000000047497451305389404296875f); + return 1.0f - smoothstep(-0.589999973773956298828125f, 0.589999973773956298828125f, d); + } + + void frag_main() + { + float param = params; + float2 _98 = 1.0f.xx / (float2(fwidth(uv.x), fwidth(uv.y)) + 9.9999999747524270787835121154785e-07f.xx); + float2 param_1 = uv * _98; + float2 param_2 = _98; + float param_3 = gui_unpack_radius(param); + float param_4 = gui_rounded_box_sdf(param_1, param_2, param_3); + float _116 = gui_normalized_sdf_alpha(param_4); + float4 _137 = tex.Sample(smp, (uv * 0.5f) + 0.5f.xx); + frag_color = float4(_137.xyz, _137.w * _116); + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + params = stage_input.params; + uv = stage_input.uv; + color = stage_input.color; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.frag_color = frag_color; + return stage_output; + } +*/ +static const uint8_t gui_image_clip_fs_source_hlsl4[1647] = { + 0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x3e,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72, + 0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,0x53,0x74,0x61, + 0x74,0x65,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65, + 0x72,0x28,0x73,0x30,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x73,0x74,0x61, + 0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x3b,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,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,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,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, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44, + 0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,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,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67, + 0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73, + 0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61, + 0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, + 0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x30,0x32,0x34, + 0x34,0x31,0x34,0x30,0x36,0x32,0x35,0x66,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35, + 0x66,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f, + 0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x6f,0x73,0x2c,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x33,0x38,0x20,0x3d,0x20,0x28, + 0x61,0x62,0x73,0x28,0x70,0x6f,0x73,0x29,0x20,0x2d,0x20,0x68,0x61,0x6c,0x66,0x5f, + 0x73,0x69,0x7a,0x65,0x29,0x20,0x2b,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x2e,0x78, + 0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6c, + 0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x38,0x2c,0x20,0x30, + 0x2e,0x30,0x66,0x2e,0x78,0x78,0x29,0x29,0x20,0x2b,0x20,0x6d,0x69,0x6e,0x28,0x6d, + 0x61,0x78,0x28,0x5f,0x33,0x38,0x2e,0x78,0x2c,0x20,0x5f,0x33,0x38,0x2e,0x79,0x29, + 0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x29,0x20,0x2d,0x20,0x72,0x61,0x64,0x69,0x75, + 0x73,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f, + 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x5f,0x73,0x64,0x66,0x5f,0x61, + 0x6c,0x70,0x68,0x61,0x28,0x69,0x6e,0x6f,0x75,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x64,0x20,0x2f,0x3d,0x20,0x6d, + 0x61,0x78,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x64,0x64,0x78,0x28,0x64,0x29,0x2c,0x20,0x64,0x64,0x79,0x28,0x64,0x29,0x29, + 0x29,0x2c,0x20,0x30,0x2e,0x30,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x34, + 0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35,0x33,0x38,0x39,0x34,0x30,0x34, + 0x32,0x39,0x36,0x38,0x37,0x35,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f, + 0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x2d,0x30,0x2e,0x35,0x38,0x39,0x39,0x39,0x39, + 0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39,0x38,0x38,0x32,0x38,0x31, + 0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x35,0x38,0x39,0x39,0x39,0x39,0x39,0x37,0x33, + 0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39,0x38,0x38,0x32,0x38,0x31,0x32,0x35,0x66, + 0x2c,0x20,0x64,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72, + 0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x20,0x5f,0x39,0x38,0x20,0x3d,0x20,0x31,0x2e,0x30,0x66,0x2e,0x78,0x78,0x20,0x2f, + 0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x66,0x77,0x69,0x64,0x74,0x68,0x28, + 0x75,0x76,0x2e,0x78,0x29,0x2c,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x75,0x76, + 0x2e,0x79,0x29,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x39, + 0x37,0x34,0x37,0x35,0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33,0x35,0x31, + 0x32,0x31,0x31,0x35,0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37,0x66,0x2e,0x78,0x78, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x75,0x76,0x20,0x2a,0x20,0x5f,0x39,0x38, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x39,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20, + 0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75, + 0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x67,0x75, + 0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64, + 0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x31,0x36,0x20,0x3d,0x20,0x67, + 0x75,0x69,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x5f,0x73,0x64, + 0x66,0x5f,0x61,0x6c,0x70,0x68,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x33, + 0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73, + 0x6d,0x70,0x2c,0x20,0x28,0x75,0x76,0x20,0x2a,0x20,0x30,0x2e,0x35,0x66,0x29,0x20, + 0x2b,0x20,0x30,0x2e,0x35,0x66,0x2e,0x78,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x28,0x5f,0x31,0x33,0x37,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x31, + 0x33,0x37,0x2e,0x77,0x20,0x2a,0x20,0x5f,0x31,0x31,0x36,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,0x61, + 0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70, + 0x75,0x74,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75, + 0x76,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e, + 0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f, + 0x72,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, +}; +/* + static const float _19[7] = { 0.19946999847888946533203125f, 0.17602999508380889892578125f, 0.120980001986026763916015625f, 0.0647599995136260986328125f, 0.02700000070035457611083984375f, 0.0087700001895427703857421875f, 0.00221999990753829479217529296875f }; + + Texture2D tex : register(t0); + SamplerState smp : register(s0); + + static float std_dev; + static float4 frag_color; + static float2 uv; + static float4 color; + + struct SPIRV_Cross_Input + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float std_dev : TEXCOORD2; + }; + + struct SPIRV_Cross_Output + { + float4 frag_color : SV_Target0; + }; + + uint2 spvTextureSize(Texture2D Tex, uint Level, out uint Param) + { + uint2 ret; + Tex.GetDimensions(Level, ret.x, ret.y, Param); + return ret; + } + + void frag_main() + { + uint _37_dummy_parameter; + float _47 = std_dev / float2(int2(spvTextureSize(tex, uint(0), _37_dummy_parameter))).x; + frag_color = tex.Sample(smp, uv) * _19[0]; + for (int i = 1; i < 7; i++) + { + float2 _84 = float2(float(i) * _47, 0.0f); + frag_color += (tex.Sample(smp, uv + _84) * _19[i]); + frag_color += (tex.Sample(smp, uv - _84) * _19[i]); + } + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + std_dev = stage_input.std_dev; + uv = stage_input.uv; + color = stage_input.color; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.frag_color = frag_color; + return stage_output; + } +*/ +static const uint8_t gui_filter_blur_h_fs_source_hlsl4[1446] = { + 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x31,0x39,0x5b,0x37,0x5d,0x20,0x3d,0x20,0x7b,0x20,0x30,0x2e, + 0x31,0x39,0x39,0x34,0x36,0x39,0x39,0x39,0x38,0x34,0x37,0x38,0x38,0x38,0x39,0x34, + 0x36,0x35,0x33,0x33,0x32,0x30,0x33,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x31, + 0x37,0x36,0x30,0x32,0x39,0x39,0x39,0x35,0x30,0x38,0x33,0x38,0x30,0x38,0x38,0x39, + 0x38,0x39,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x31,0x32, + 0x30,0x39,0x38,0x30,0x30,0x30,0x31,0x39,0x38,0x36,0x30,0x32,0x36,0x37,0x36,0x33, + 0x39,0x31,0x36,0x30,0x31,0x35,0x36,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x36, + 0x34,0x37,0x35,0x39,0x39,0x39,0x39,0x35,0x31,0x33,0x36,0x32,0x36,0x30,0x39,0x38, + 0x36,0x33,0x32,0x38,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x32,0x37,0x30, + 0x30,0x30,0x30,0x30,0x30,0x37,0x30,0x30,0x33,0x35,0x34,0x35,0x37,0x36,0x31,0x31, + 0x30,0x38,0x33,0x39,0x38,0x34,0x33,0x37,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x30, + 0x38,0x37,0x37,0x30,0x30,0x30,0x30,0x31,0x38,0x39,0x35,0x34,0x32,0x37,0x37,0x30, + 0x33,0x38,0x35,0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30, + 0x30,0x32,0x32,0x31,0x39,0x39,0x39,0x39,0x39,0x30,0x37,0x35,0x33,0x38,0x32,0x39, + 0x34,0x37,0x39,0x32,0x31,0x37,0x35,0x32,0x39,0x32,0x39,0x36,0x38,0x37,0x35,0x66, + 0x20,0x7d,0x3b,0x0a,0x0a,0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x3e,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x72,0x65,0x67, + 0x69,0x73,0x74,0x65,0x72,0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c, + 0x65,0x72,0x53,0x74,0x61,0x74,0x65,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x72,0x65, + 0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x73,0x30,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61, + 0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65, + 0x76,0x3b,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,0x75,0x76,0x3b,0x0a,0x73, + 0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c, + 0x6f,0x72,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45, + 0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3a,0x20,0x54,0x45,0x58, + 0x43,0x4f,0x4f,0x52,0x44,0x32,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, + 0x75,0x69,0x6e,0x74,0x32,0x20,0x73,0x70,0x76,0x54,0x65,0x78,0x74,0x75,0x72,0x65, + 0x53,0x69,0x7a,0x65,0x28,0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x3e,0x20,0x54,0x65,0x78,0x2c,0x20,0x75,0x69,0x6e,0x74, + 0x20,0x4c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x6f,0x75,0x74,0x20,0x75,0x69,0x6e,0x74, + 0x20,0x50,0x61,0x72,0x61,0x6d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69, + 0x6e,0x74,0x32,0x20,0x72,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x54,0x65,0x78, + 0x2e,0x47,0x65,0x74,0x44,0x69,0x6d,0x65,0x6e,0x73,0x69,0x6f,0x6e,0x73,0x28,0x4c, + 0x65,0x76,0x65,0x6c,0x2c,0x20,0x72,0x65,0x74,0x2e,0x78,0x2c,0x20,0x72,0x65,0x74, + 0x2e,0x79,0x2c,0x20,0x50,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x76, + 0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x20,0x5f,0x33,0x37,0x5f,0x64, + 0x75,0x6d,0x6d,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x65,0x74,0x65,0x72,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x37,0x20,0x3d,0x20, + 0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x69,0x6e,0x74,0x32,0x28,0x73,0x70,0x76,0x54,0x65,0x78,0x74,0x75,0x72,0x65, + 0x53,0x69,0x7a,0x65,0x28,0x74,0x65,0x78,0x2c,0x20,0x75,0x69,0x6e,0x74,0x28,0x30, + 0x29,0x2c,0x20,0x5f,0x33,0x37,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x65,0x74,0x65,0x72,0x29,0x29,0x29,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65, + 0x78,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76, + 0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x31,0x3b,0x20, + 0x69,0x20,0x3c,0x20,0x37,0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x20,0x5f,0x38,0x34,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x66,0x6c, + 0x6f,0x61,0x74,0x28,0x69,0x29,0x20,0x2a,0x20,0x5f,0x34,0x37,0x2c,0x20,0x30,0x2e, + 0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61, + 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x28,0x74,0x65,0x78,0x2e, + 0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x20,0x2b, + 0x20,0x5f,0x38,0x34,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x5b,0x69,0x5d,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x28,0x74,0x65,0x78,0x2e,0x53,0x61,0x6d,0x70, + 0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x20,0x2d,0x20,0x5f,0x38,0x34, + 0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x5b,0x69,0x5d,0x29,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,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3d,0x20,0x73,0x74,0x61, + 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x73,0x74,0x64,0x5f,0x64,0x65,0x76, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65, + 0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70, + 0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,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, +}; +/* + static const float _19[7] = { 0.19946999847888946533203125f, 0.17602999508380889892578125f, 0.120980001986026763916015625f, 0.0647599995136260986328125f, 0.02700000070035457611083984375f, 0.0087700001895427703857421875f, 0.00221999990753829479217529296875f }; + + Texture2D tex : register(t0); + SamplerState smp : register(s0); + + static float std_dev; + static float4 frag_color; + static float2 uv; + static float4 color; + + struct SPIRV_Cross_Input + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float std_dev : TEXCOORD2; + }; + + struct SPIRV_Cross_Output + { + float4 frag_color : SV_Target0; + }; + + uint2 spvTextureSize(Texture2D Tex, uint Level, out uint Param) + { + uint2 ret; + Tex.GetDimensions(Level, ret.x, ret.y, Param); + return ret; + } + + void frag_main() + { + uint _37_dummy_parameter; + float _47 = std_dev / float2(int2(spvTextureSize(tex, uint(0), _37_dummy_parameter))).y; + frag_color = tex.Sample(smp, uv) * _19[0]; + for (int i = 1; i < 7; i++) + { + float2 _84 = float2(0.0f, float(i) * _47); + frag_color += (tex.Sample(smp, uv + _84) * _19[i]); + frag_color += (tex.Sample(smp, uv - _84) * _19[i]); + } + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + std_dev = stage_input.std_dev; + uv = stage_input.uv; + color = stage_input.color; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.frag_color = frag_color; + return stage_output; + } +*/ +static const uint8_t gui_filter_blur_v_fs_source_hlsl4[1446] = { + 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x31,0x39,0x5b,0x37,0x5d,0x20,0x3d,0x20,0x7b,0x20,0x30,0x2e, + 0x31,0x39,0x39,0x34,0x36,0x39,0x39,0x39,0x38,0x34,0x37,0x38,0x38,0x38,0x39,0x34, + 0x36,0x35,0x33,0x33,0x32,0x30,0x33,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x31, + 0x37,0x36,0x30,0x32,0x39,0x39,0x39,0x35,0x30,0x38,0x33,0x38,0x30,0x38,0x38,0x39, + 0x38,0x39,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x31,0x32, + 0x30,0x39,0x38,0x30,0x30,0x30,0x31,0x39,0x38,0x36,0x30,0x32,0x36,0x37,0x36,0x33, + 0x39,0x31,0x36,0x30,0x31,0x35,0x36,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x36, + 0x34,0x37,0x35,0x39,0x39,0x39,0x39,0x35,0x31,0x33,0x36,0x32,0x36,0x30,0x39,0x38, + 0x36,0x33,0x32,0x38,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x32,0x37,0x30, + 0x30,0x30,0x30,0x30,0x30,0x37,0x30,0x30,0x33,0x35,0x34,0x35,0x37,0x36,0x31,0x31, + 0x30,0x38,0x33,0x39,0x38,0x34,0x33,0x37,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x30, + 0x38,0x37,0x37,0x30,0x30,0x30,0x30,0x31,0x38,0x39,0x35,0x34,0x32,0x37,0x37,0x30, + 0x33,0x38,0x35,0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30, + 0x30,0x32,0x32,0x31,0x39,0x39,0x39,0x39,0x39,0x30,0x37,0x35,0x33,0x38,0x32,0x39, + 0x34,0x37,0x39,0x32,0x31,0x37,0x35,0x32,0x39,0x32,0x39,0x36,0x38,0x37,0x35,0x66, + 0x20,0x7d,0x3b,0x0a,0x0a,0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x3e,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x72,0x65,0x67, + 0x69,0x73,0x74,0x65,0x72,0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c, + 0x65,0x72,0x53,0x74,0x61,0x74,0x65,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x72,0x65, + 0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x73,0x30,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61, + 0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65, + 0x76,0x3b,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,0x75,0x76,0x3b,0x0a,0x73, + 0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c, + 0x6f,0x72,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45, + 0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3a,0x20,0x54,0x45,0x58, + 0x43,0x4f,0x4f,0x52,0x44,0x32,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, + 0x75,0x69,0x6e,0x74,0x32,0x20,0x73,0x70,0x76,0x54,0x65,0x78,0x74,0x75,0x72,0x65, + 0x53,0x69,0x7a,0x65,0x28,0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x3e,0x20,0x54,0x65,0x78,0x2c,0x20,0x75,0x69,0x6e,0x74, + 0x20,0x4c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x6f,0x75,0x74,0x20,0x75,0x69,0x6e,0x74, + 0x20,0x50,0x61,0x72,0x61,0x6d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69, + 0x6e,0x74,0x32,0x20,0x72,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x54,0x65,0x78, + 0x2e,0x47,0x65,0x74,0x44,0x69,0x6d,0x65,0x6e,0x73,0x69,0x6f,0x6e,0x73,0x28,0x4c, + 0x65,0x76,0x65,0x6c,0x2c,0x20,0x72,0x65,0x74,0x2e,0x78,0x2c,0x20,0x72,0x65,0x74, + 0x2e,0x79,0x2c,0x20,0x50,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x76, + 0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x20,0x5f,0x33,0x37,0x5f,0x64, + 0x75,0x6d,0x6d,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x65,0x74,0x65,0x72,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x37,0x20,0x3d,0x20, + 0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x69,0x6e,0x74,0x32,0x28,0x73,0x70,0x76,0x54,0x65,0x78,0x74,0x75,0x72,0x65, + 0x53,0x69,0x7a,0x65,0x28,0x74,0x65,0x78,0x2c,0x20,0x75,0x69,0x6e,0x74,0x28,0x30, + 0x29,0x2c,0x20,0x5f,0x33,0x37,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x65,0x74,0x65,0x72,0x29,0x29,0x29,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65, + 0x78,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76, + 0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x31,0x3b,0x20, + 0x69,0x20,0x3c,0x20,0x37,0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x20,0x5f,0x38,0x34,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e, + 0x30,0x66,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,0x29,0x20,0x2a,0x20,0x5f, + 0x34,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61, + 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x28,0x74,0x65,0x78,0x2e, + 0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x20,0x2b, + 0x20,0x5f,0x38,0x34,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x5b,0x69,0x5d,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x28,0x74,0x65,0x78,0x2e,0x53,0x61,0x6d,0x70, + 0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x20,0x2d,0x20,0x5f,0x38,0x34, + 0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x5b,0x69,0x5d,0x29,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,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3d,0x20,0x73,0x74,0x61, + 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x73,0x74,0x64,0x5f,0x64,0x65,0x76, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65, + 0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70, + 0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,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, +}; +/* + static float4 frag_color; + static float4 color; + static float2 uv; + static float std_dev; + + struct SPIRV_Cross_Input + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float std_dev : TEXCOORD2; + }; + + struct SPIRV_Cross_Output + { + float4 frag_color : SV_Target0; + }; + + void frag_main() + { + frag_color = color; + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + color = stage_input.color; + uv = stage_input.uv; + std_dev = stage_input.std_dev; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.frag_color = frag_color; + return stage_output; + } +*/ +static const uint8_t gui_filter_color_fs_source_hlsl4[593] = { + 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,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73, + 0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x3b, + 0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74, + 0x64,0x5f,0x64,0x65,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a, + 0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3a,0x20, + 0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,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,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69, + 0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,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,0x63,0x6f, + 0x6c,0x6f,0x72,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75, + 0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20, + 0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x75,0x76, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3d,0x20, + 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x73,0x74,0x64,0x5f, + 0x64,0x65,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, +}; +/* + Texture2D tex : register(t0); + SamplerState smp : register(s0); + + static float4 frag_color; + static float2 uv; + static float4 color; + static float std_dev; + + struct SPIRV_Cross_Input + { + float2 uv : TEXCOORD0; + float4 color : TEXCOORD1; + float std_dev : TEXCOORD2; + }; + + struct SPIRV_Cross_Output + { + float4 frag_color : SV_Target0; + }; + + void frag_main() + { + frag_color = tex.Sample(smp, uv) * color; + } + + SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) + { + uv = stage_input.uv; + color = stage_input.color; + std_dev = stage_input.std_dev; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.frag_color = frag_color; + return stage_output; + } +*/ +static const uint8_t gui_filter_texture_fs_source_hlsl4[687] = { + 0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x3e,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72, + 0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d,0x70,0x6c,0x65,0x72,0x53,0x74,0x61, + 0x74,0x65,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65, + 0x72,0x28,0x73,0x30,0x29,0x3b,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, + 0x75,0x76,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52, + 0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74, + 0x64,0x5f,0x64,0x65,0x76,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44, + 0x32,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,0x76,0x6f,0x69,0x64,0x20, + 0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74, + 0x65,0x78,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x75, + 0x76,0x29,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,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,0x75,0x76,0x20,0x3d, + 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x75,0x76,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x73,0x74,0x61, + 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3d,0x20,0x73,0x74, + 0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x73,0x74,0x64,0x5f,0x64,0x65, + 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 + #include + + using namespace metal; + + struct gui_rect_vs_params + { + float4x4 mvp; + float4x4 tm; + }; + + struct main0_out + { + float2 uv [[user(locn0)]]; + float4 color [[user(locn1)]]; + float params [[user(locn2)]]; + float4 gl_Position [[position]]; + float gl_PointSize [[point_size]]; + }; + + struct main0_in + { + float3 position [[attribute(0)]]; + float2 texcoord0 [[attribute(1)]]; + float4 color0 [[attribute(2)]]; + float psize [[attribute(3)]]; + }; + + vertex main0_out main0(main0_in in [[stage_in]], constant gui_rect_vs_params& _19 [[buffer(0)]]) + { + main0_out out = {}; + out.gl_Position = _19.mvp * float4(in.position.xy, 0.0, 1.0); + out.gl_PointSize = in.psize; + out.uv = in.texcoord0; + out.color = in.color0; + out.params = in.position.z; + return out; + } + +*/ +static const uint8_t gui_rect_vs_source_metal_macos[834] = { + 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, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x67, + 0x75,0x69,0x5f,0x72,0x65,0x63,0x74,0x5f,0x76,0x73,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x78,0x34,0x20,0x74,0x6d,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b, + 0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20, + 0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x5b,0x5b,0x70, + 0x6f,0x69,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65,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,0x33,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x5b,0x5b, + 0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72, + 0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x32,0x29, + 0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73, + 0x69,0x7a,0x65,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28, + 0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,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,0x67,0x75,0x69,0x5f,0x72,0x65,0x63,0x74,0x5f,0x76,0x73,0x5f, + 0x70,0x61,0x72,0x61,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,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f, + 0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,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,0x2e,0x78,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c, + 0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67, + 0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x3d,0x20,0x69,0x6e, + 0x2e,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e, + 0x75,0x76,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64, + 0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x3d,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x6f,0x75,0x74,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d,0x20,0x69, + 0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x00, +}; +/* + #include + #include + + using namespace metal; + + struct gui_shadow_vs_params + { + float4x4 mvp; + float4x4 tm; + }; + + struct main0_out + { + float2 uv [[user(locn0)]]; + float4 color [[user(locn1)]]; + float params [[user(locn2)]]; + float2 offset [[user(locn3)]]; + float4 gl_Position [[position]]; + float gl_PointSize [[point_size]]; + }; + + struct main0_in + { + float3 position [[attribute(0)]]; + float2 texcoord0 [[attribute(1)]]; + float4 color0 [[attribute(2)]]; + float psize [[attribute(3)]]; + }; + + vertex main0_out main0(main0_in in [[stage_in]], constant gui_shadow_vs_params& _19 [[buffer(0)]]) + { + main0_out out = {}; + out.gl_Position = _19.mvp * float4(in.position.xy, 0.0, 1.0); + out.gl_PointSize = in.psize; + out.uv = in.texcoord0; + out.color = in.color0; + out.params = in.position.z; + out.offset = (_19.tm * float4(0.0, 0.0, 0.0, 1.0)).xy; + return out; + } + +*/ +static const uint8_t gui_shadow_vs_source_metal_macos[932] = { + 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, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x67, + 0x75,0x69,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x76,0x73,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x78,0x34,0x20,0x74,0x6d,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20, + 0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d, + 0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x6f,0x66, + 0x66,0x73,0x65,0x74,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e, + 0x33,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,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a, + 0x65,0x20,0x5b,0x5b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65,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,0x33,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,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72, + 0x64,0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31, + 0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75, + 0x74,0x65,0x28,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69, + 0x62,0x75,0x74,0x65,0x28,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,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,0x67,0x75,0x69,0x5f,0x73,0x68,0x61, + 0x64,0x6f,0x77,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,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,0x20,0x20,0x20,0x20, + 0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20, + 0x3d,0x20,0x5f,0x31,0x39,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,0x2e,0x78, + 0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69, + 0x7a,0x65,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x75,0x76,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74, + 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75, + 0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c, + 0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x6f,0x66,0x66, + 0x73,0x65,0x74,0x20,0x3d,0x20,0x28,0x5f,0x31,0x39,0x2e,0x74,0x6d,0x20,0x2a,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c, + 0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x00, +}; +/* + #include + #include + + using namespace metal; + + struct gui_gradient_vs_params + { + float4x4 mvp; + float4x4 tm; + }; + + struct main0_out + { + float2 uv [[user(locn0)]]; + float4 color [[user(locn1)]]; + float params [[user(locn2)]]; + float4 stop12 [[user(locn3)]]; + float4 stop34 [[user(locn4)]]; + float4 stop56 [[user(locn5)]]; + float4 meta [[user(locn6)]]; + float4 gl_Position [[position]]; + float gl_PointSize [[point_size]]; + }; + + struct main0_in + { + float3 position [[attribute(0)]]; + float2 texcoord0 [[attribute(1)]]; + float4 color0 [[attribute(2)]]; + float psize [[attribute(3)]]; + }; + + vertex main0_out main0(main0_in in [[stage_in]], constant gui_gradient_vs_params& _19 [[buffer(0)]]) + { + main0_out out = {}; + out.gl_Position = _19.mvp * float4(in.position.xy, 0.0, 1.0); + out.gl_PointSize = in.psize; + out.uv = in.texcoord0; + out.color = in.color0; + out.params = in.position.z; + out.stop12 = _19.tm[0]; + out.stop34 = _19.tm[1]; + out.stop56 = _19.tm[2]; + out.meta = _19.tm[3]; + return out; + } + +*/ +static const uint8_t gui_gradient_vs_source_metal_macos[1090] = { + 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, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x67, + 0x75,0x69,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x76,0x73,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,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x74,0x6d,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,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,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d, + 0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32, + 0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x73,0x74,0x6f,0x70,0x31,0x32,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f, + 0x63,0x6e,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x33,0x34,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72, + 0x28,0x6c,0x6f,0x63,0x6e,0x34,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x35,0x36,0x20,0x5b,0x5b,0x75, + 0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x35,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6d,0x65,0x74,0x61,0x20,0x5b,0x5b, + 0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x36,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x6c, + 0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x5b,0x5b,0x70,0x6f,0x69, + 0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65,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,0x33,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x5b,0x5b,0x61,0x74, + 0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20, + 0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x32,0x29,0x5d,0x5d, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x73,0x69,0x7a, + 0x65,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x33,0x29, + 0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,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,0x67,0x75,0x69,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x76, + 0x73,0x5f,0x70,0x61,0x72,0x61,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,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67, + 0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39, + 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,0x2e,0x78,0x79,0x2c,0x20,0x30,0x2e, + 0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x3d,0x20, + 0x69,0x6e,0x2e,0x70,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75, + 0x74,0x2e,0x75,0x76,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f, + 0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x63,0x6f,0x6c, + 0x6f,0x72,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3d, + 0x20,0x69,0x6e,0x2e,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x7a,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x73,0x74,0x6f,0x70,0x31,0x32,0x20,0x3d, + 0x20,0x5f,0x31,0x39,0x2e,0x74,0x6d,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x6f,0x75,0x74,0x2e,0x73,0x74,0x6f,0x70,0x33,0x34,0x20,0x3d,0x20,0x5f,0x31,0x39, + 0x2e,0x74,0x6d,0x5b,0x31,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e, + 0x73,0x74,0x6f,0x70,0x35,0x36,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x74,0x6d,0x5b, + 0x32,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x6d,0x65,0x74,0x61, + 0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x74,0x6d,0x5b,0x33,0x5d,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x00, +}; +/* + #include + #include + + using namespace metal; + + struct gui_filter_vs_params + { + float4x4 mvp; + float4x4 tm; + }; + + struct main0_out + { + float2 uv [[user(locn0)]]; + float4 color [[user(locn1)]]; + float std_dev [[user(locn2)]]; + float4 gl_Position [[position]]; + }; + + struct main0_in + { + float3 position [[attribute(0)]]; + float2 texcoord0 [[attribute(1)]]; + float4 color0 [[attribute(2)]]; + }; + + vertex main0_out main0(main0_in in [[stage_in]], constant gui_filter_vs_params& _19 [[buffer(0)]]) + { + main0_out out = {}; + out.gl_Position = _19.mvp * float4(in.position.xy, 0.0, 1.0); + out.uv = in.texcoord0; + out.color = in.color0; + out.std_dev = _19.tm[0].x; + return out; + } + +*/ +static const uint8_t gui_filter_vs_source_metal_macos[732] = { + 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, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x67, + 0x75,0x69,0x5f,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x76,0x73,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x78,0x34,0x20,0x74,0x6d,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20, + 0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x64,0x5f,0x64, + 0x65,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,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,0x33,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20, + 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72, + 0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x5b,0x5b, + 0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x32,0x29,0x5d,0x5d,0x3b,0x0a, + 0x7d,0x3b,0x0a,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,0x67,0x75, + 0x69,0x5f,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61, + 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,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69, + 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,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,0x2e,0x78,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x75,0x76,0x20,0x3d,0x20, + 0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x6f,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x69,0x6e, + 0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x74, + 0x6d,0x5b,0x30,0x5d,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, + 0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #include + #include + + using namespace metal; + + struct gui_filter_sgl_vs_params + { + float4x4 mvp; + float4x4 tm; + }; + + struct main0_out + { + float2 uv [[user(locn0)]]; + float4 color [[user(locn1)]]; + float std_dev [[user(locn2)]]; + float4 gl_Position [[position]]; + float gl_PointSize [[point_size]]; + }; + + struct main0_in + { + float3 position [[attribute(0)]]; + float2 texcoord0 [[attribute(1)]]; + float4 color0 [[attribute(2)]]; + float psize [[attribute(3)]]; + }; + + vertex main0_out main0(main0_in in [[stage_in]], constant gui_filter_sgl_vs_params& _19 [[buffer(0)]]) + { + main0_out out = {}; + out.gl_Position = _19.mvp * float4(in.position.xy, 0.0, 1.0); + out.gl_PointSize = in.psize; + out.uv = in.texcoord0; + out.color = in.color0; + out.std_dev = _19.tm[0].x; + return out; + } + +*/ +static const uint8_t gui_filter_sgl_vs_source_metal_macos[846] = { + 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, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x67, + 0x75,0x69,0x5f,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x67,0x6c,0x5f,0x76,0x73, + 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,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x74,0x6d,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,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,0x63,0x6f, + 0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31, + 0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73, + 0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f, + 0x63,0x6e,0x32,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,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x69,0x6e,0x74,0x53, + 0x69,0x7a,0x65,0x20,0x5b,0x5b,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65, + 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,0x33,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, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f, + 0x6f,0x72,0x64,0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65, + 0x28,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69, + 0x62,0x75,0x74,0x65,0x28,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x73,0x69,0x7a,0x65,0x20,0x5b,0x5b,0x61,0x74,0x74, + 0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a, + 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,0x67,0x75,0x69,0x5f,0x66, + 0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x67,0x6c,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72, + 0x61,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,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73, + 0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,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,0x2e,0x78,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e, + 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50, + 0x6f,0x69,0x6e,0x74,0x53,0x69,0x7a,0x65,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x73, + 0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x75,0x76,0x20, + 0x3d,0x20,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f, + 0x75,0x74,0x2e,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x3d,0x20,0x5f,0x31,0x39, + 0x2e,0x74,0x6d,0x5b,0x30,0x5d,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #pragma clang diagnostic ignored "-Wmissing-prototypes" + + #include + #include + + using namespace metal; + + // Implementation of the GLSL mod() function, which is slightly different than Metal fmod() + template + inline Tx mod(Tx x, Ty y) + { + return x - y * floor(x / y); + } + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 uv [[user(locn0)]]; + float4 color [[user(locn1)]]; + float params [[user(locn2)]]; + }; + + static inline __attribute__((always_inline)) + float gui_unpack_radius(thread const float& packed_params) + { + return floor(packed_params * 0.000244140625) * 0.25; + } + + static inline __attribute__((always_inline)) + float gui_unpack_secondary(thread const float& packed_params) + { + return mod(packed_params, 4096.0) * 0.25; + } + + static inline __attribute__((always_inline)) + float gui_rounded_box_sdf(thread const float2& pos, thread const float2& half_size, thread const float& radius) + { + float2 _46 = (abs(pos) - half_size) + float2(radius); + return (length(fast::max(_46, float2(0.0))) + fast::min(fast::max(_46.x, _46.y), 0.0)) - radius; + } + + static inline __attribute__((always_inline)) + float gui_normalized_sdf_alpha(thread float& d) + { + d /= fast::max(length(float2(dfdx(d), dfdy(d))), 0.001000000047497451305389404296875); + return 1.0 - smoothstep(-0.589999973773956298828125, 0.589999973773956298828125, d); + } + + fragment main0_out main0(main0_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) + { + main0_out out = {}; + float param = in.params; + float param_1 = in.params; + float _95 = gui_unpack_secondary(param_1); + float2 _110 = float2(1.0) / (float2(fwidth(in.uv.x), fwidth(in.uv.y)) + float2(9.9999999747524270787835121154785e-07)); + float2 param_2 = in.uv * _110; + float2 param_3 = _110; + float param_4 = gui_unpack_radius(param); + float d = gui_rounded_box_sdf(param_2, param_3, param_4); + if (_95 > 0.0) + { + d = fma(-_95, 0.5, abs(fma(_95, 0.5, d))); + } + float param_5 = d; + float _142 = gui_normalized_sdf_alpha(param_5); + out.frag_color = float4(in.color.xyz, in.color.w * _142); + if (out.frag_color.w < 0.0) + { + out.frag_color += tex.sample(smp, in.uv); + } + return out; + } + +*/ +static const uint8_t gui_rounded_rect_fs_source_metal_macos[2299] = { + 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, + 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, + 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, + 0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,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,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e, + 0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a, + 0x0a,0x2f,0x2f,0x20,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69, + 0x6f,0x6e,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x47,0x4c,0x53,0x4c,0x20,0x6d, + 0x6f,0x64,0x28,0x29,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x77, + 0x68,0x69,0x63,0x68,0x20,0x69,0x73,0x20,0x73,0x6c,0x69,0x67,0x68,0x74,0x6c,0x79, + 0x20,0x64,0x69,0x66,0x66,0x65,0x72,0x65,0x6e,0x74,0x20,0x74,0x68,0x61,0x6e,0x20, + 0x4d,0x65,0x74,0x61,0x6c,0x20,0x66,0x6d,0x6f,0x64,0x28,0x29,0x0a,0x74,0x65,0x6d, + 0x70,0x6c,0x61,0x74,0x65,0x3c,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54, + 0x78,0x2c,0x20,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54,0x79,0x3e,0x0a, + 0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x54,0x78,0x20,0x6d,0x6f,0x64,0x28,0x54,0x78, + 0x20,0x78,0x2c,0x20,0x54,0x79,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75, + 0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5b, + 0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a, + 0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e, + 0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28, + 0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29, + 0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63, + 0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20, + 0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x70,0x61,0x63, + 0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x70, + 0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x2a,0x20,0x30, + 0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35,0x29,0x20,0x2a, + 0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, + 0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62, + 0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e, + 0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69, + 0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f,0x6e,0x64,0x61,0x72, + 0x79,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x26,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x6d,0x6f,0x64,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x2c,0x20,0x34,0x30,0x39,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x30, + 0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69, + 0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74, + 0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69, + 0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72, + 0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x74, + 0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x26,0x20,0x70,0x6f,0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20, + 0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x68,0x61, + 0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20, + 0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x72,0x61,0x64, + 0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x5f,0x34,0x36,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x70,0x6f,0x73, + 0x29,0x20,0x2d,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x29,0x20,0x2b, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6c,0x65,0x6e, + 0x67,0x74,0x68,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x34, + 0x36,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29, + 0x20,0x2b,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x66,0x61,0x73, + 0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x34,0x36,0x2e,0x78,0x2c,0x20,0x5f,0x34, + 0x36,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2d,0x20,0x72,0x61, + 0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, + 0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75, + 0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c, + 0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f, + 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x5f,0x73,0x64,0x66,0x5f,0x61, + 0x6c,0x70,0x68,0x61,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x26,0x20,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x64,0x20,0x2f,0x3d, + 0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x6c,0x65,0x6e,0x67,0x74, + 0x68,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x64,0x66,0x64,0x78,0x28,0x64,0x29, + 0x2c,0x20,0x64,0x66,0x64,0x79,0x28,0x64,0x29,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30, + 0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35, + 0x31,0x33,0x30,0x35,0x33,0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x31,0x2e, + 0x30,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x2d, + 0x30,0x2e,0x35,0x38,0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35, + 0x36,0x32,0x39,0x38,0x38,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x35,0x38, + 0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39,0x38, + 0x38,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x64,0x29,0x3b,0x0a,0x7d,0x0a,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,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61, + 0x74,0x3e,0x20,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65, + 0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x73, + 0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,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,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x69, + 0x6e,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x69,0x6e, + 0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x39,0x35,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70, + 0x61,0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f,0x6e,0x64,0x61,0x72,0x79,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x20,0x5f,0x31,0x31,0x30,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, + 0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x69,0x6e,0x2e,0x75,0x76,0x2e,0x78,0x29,0x2c, + 0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x69,0x6e,0x2e,0x75,0x76,0x2e,0x79,0x29, + 0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x39,0x2e,0x39,0x39,0x39, + 0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x35,0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37, + 0x38,0x33,0x35,0x31,0x32,0x31,0x31,0x35,0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x75,0x76,0x20,0x2a, + 0x20,0x5f,0x31,0x31,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x31,0x31,0x30, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x34,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b, + 0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x20,0x3d,0x20,0x67,0x75, + 0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64, + 0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x39,0x35,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64, + 0x20,0x3d,0x20,0x66,0x6d,0x61,0x28,0x2d,0x5f,0x39,0x35,0x2c,0x20,0x30,0x2e,0x35, + 0x2c,0x20,0x61,0x62,0x73,0x28,0x66,0x6d,0x61,0x28,0x5f,0x39,0x35,0x2c,0x20,0x30, + 0x2e,0x35,0x2c,0x20,0x64,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x35,0x20,0x3d,0x20,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x69,0x7a,0x65,0x64,0x5f,0x73,0x64,0x66,0x5f,0x61,0x6c,0x70,0x68,0x61, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f, + 0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x2e, + 0x78,0x79,0x7a,0x2c,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20, + 0x2a,0x20,0x5f,0x31,0x34,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, + 0x77,0x20,0x3c,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x75,0x76,0x29,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, +}; +/* + #pragma clang diagnostic ignored "-Wmissing-prototypes" + + #include + #include + + using namespace metal; + + // Implementation of the GLSL mod() function, which is slightly different than Metal fmod() + template + inline Tx mod(Tx x, Ty y) + { + return x - y * floor(x / y); + } + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 uv [[user(locn0)]]; + float4 color [[user(locn1)]]; + float params [[user(locn2)]]; + float2 offset [[user(locn3)]]; + }; + + static inline __attribute__((always_inline)) + float gui_unpack_radius(thread const float& packed_params) + { + return floor(packed_params * 0.000244140625) * 0.25; + } + + static inline __attribute__((always_inline)) + float gui_unpack_secondary(thread const float& packed_params) + { + return mod(packed_params, 4096.0) * 0.25; + } + + static inline __attribute__((always_inline)) + float gui_rounded_box_sdf(thread const float2& pos, thread const float2& half_size, thread const float& radius) + { + float2 _43 = (abs(pos) - half_size) + float2(radius); + return (length(fast::max(_43, float2(0.0))) + fast::min(fast::max(_43.x, _43.y), 0.0)) - radius; + } + + fragment main0_out main0(main0_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) + { + main0_out out = {}; + float param = in.params; + float _68 = gui_unpack_radius(param); + float param_1 = in.params; + float _72 = gui_unpack_secondary(param_1); + float2 _88 = float2(1.0) / (float2(fwidth(in.uv.x), fwidth(in.uv.y)) + float2(9.9999999747524270787835121154785e-07)); + float2 _101 = _88 - float2(1.5 * _72); + float2 param_2 = in.uv * _88; + float2 param_3 = _101; + float param_4 = _68; + float2 param_5 = fma(in.uv, _88, in.offset); + float2 param_6 = _101; + float param_7 = _68; + out.frag_color = float4(in.color.xyz, in.color.w * ((1.0 - smoothstep(0.0, fast::max(1.0, _72), gui_rounded_box_sdf(param_2, param_3, param_4))) * smoothstep(-1.0, 0.0, gui_rounded_box_sdf(param_5, param_6, param_7)))); + if (out.frag_color.w < 0.0) + { + out.frag_color += tex.sample(smp, in.uv); + } + return out; + } + +*/ +static const uint8_t gui_shadow_fs_source_metal_macos[2162] = { + 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, + 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, + 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, + 0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,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,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e, + 0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a, + 0x0a,0x2f,0x2f,0x20,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69, + 0x6f,0x6e,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x47,0x4c,0x53,0x4c,0x20,0x6d, + 0x6f,0x64,0x28,0x29,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x77, + 0x68,0x69,0x63,0x68,0x20,0x69,0x73,0x20,0x73,0x6c,0x69,0x67,0x68,0x74,0x6c,0x79, + 0x20,0x64,0x69,0x66,0x66,0x65,0x72,0x65,0x6e,0x74,0x20,0x74,0x68,0x61,0x6e,0x20, + 0x4d,0x65,0x74,0x61,0x6c,0x20,0x66,0x6d,0x6f,0x64,0x28,0x29,0x0a,0x74,0x65,0x6d, + 0x70,0x6c,0x61,0x74,0x65,0x3c,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54, + 0x78,0x2c,0x20,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54,0x79,0x3e,0x0a, + 0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x54,0x78,0x20,0x6d,0x6f,0x64,0x28,0x54,0x78, + 0x20,0x78,0x2c,0x20,0x54,0x79,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75, + 0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5b, + 0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x6f,0x66,0x66,0x73,0x65, + 0x74,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x33,0x29,0x5d, + 0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e, + 0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65, + 0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e, + 0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e, + 0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x74,0x68,0x72,0x65, + 0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20, + 0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f, + 0x72,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20, + 0x2a,0x20,0x30,0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35, + 0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61, + 0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74, + 0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73, + 0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f,0x6e, + 0x64,0x61,0x72,0x79,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73, + 0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x6d,0x6f,0x64,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x2c,0x20,0x34,0x30,0x39,0x36,0x2e,0x30,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69, + 0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69, + 0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69, + 0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75, + 0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64, + 0x66,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x70,0x6f,0x73,0x2c,0x20,0x74,0x68,0x72,0x65, + 0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, + 0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x74,0x68,0x72,0x65, + 0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20, + 0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x20,0x5f,0x34,0x33,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28, + 0x70,0x6f,0x73,0x29,0x20,0x2d,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65, + 0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x69,0x75, + 0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28, + 0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78, + 0x28,0x5f,0x34,0x33,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30, + 0x29,0x29,0x29,0x20,0x2b,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28, + 0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x34,0x33,0x2e,0x78,0x2c, + 0x20,0x5f,0x34,0x33,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2d, + 0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a,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,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20, + 0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29, + 0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x73,0x6d,0x70,0x20, + 0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,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,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x36,0x38,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63, + 0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x37,0x32,0x20,0x3d,0x20, + 0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f,0x6e, + 0x64,0x61,0x72,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x38,0x38,0x20,0x3d,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x28,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x28,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x69,0x6e,0x2e, + 0x75,0x76,0x2e,0x78,0x29,0x2c,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x69,0x6e, + 0x2e,0x75,0x76,0x2e,0x79,0x29,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x35,0x32,0x34, + 0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33,0x35,0x31,0x32,0x31,0x31,0x35,0x34,0x37, + 0x38,0x35,0x65,0x2d,0x30,0x37,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x30,0x31,0x20,0x3d,0x20,0x5f,0x38,0x38,0x20, + 0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x2e,0x35,0x20,0x2a,0x20,0x5f, + 0x37,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x75,0x76,0x20, + 0x2a,0x20,0x5f,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x31,0x30,0x31, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f,0x36,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20, + 0x66,0x6d,0x61,0x28,0x69,0x6e,0x2e,0x75,0x76,0x2c,0x20,0x5f,0x38,0x38,0x2c,0x20, + 0x69,0x6e,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d, + 0x20,0x5f,0x31,0x30,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x36,0x38,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x63, + 0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c, + 0x6f,0x72,0x2e,0x77,0x20,0x2a,0x20,0x28,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x73, + 0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x66, + 0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x31,0x2e,0x30,0x2c,0x20,0x5f,0x37, + 0x32,0x29,0x2c,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f, + 0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x34,0x29,0x29,0x29,0x20,0x2a,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65, + 0x70,0x28,0x2d,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x67,0x75,0x69, + 0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x29,0x29,0x29,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3c,0x20,0x30,0x2e,0x30,0x29,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75, + 0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20, + 0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20, + 0x69,0x6e,0x2e,0x75,0x76,0x29,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, +}; +/* + #pragma clang diagnostic ignored "-Wmissing-prototypes" + + #include + #include + + using namespace metal; + + // Implementation of the GLSL mod() function, which is slightly different than Metal fmod() + template + inline Tx mod(Tx x, Ty y) + { + return x - y * floor(x / y); + } + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 uv [[user(locn0)]]; + float4 color [[user(locn1)]]; + float params [[user(locn2)]]; + }; + + static inline __attribute__((always_inline)) + float gui_unpack_radius(thread const float& packed_params) + { + return floor(packed_params * 0.000244140625) * 0.25; + } + + static inline __attribute__((always_inline)) + float gui_unpack_secondary(thread const float& packed_params) + { + return mod(packed_params, 4096.0) * 0.25; + } + + static inline __attribute__((always_inline)) + float gui_rounded_box_sdf(thread const float2& pos, thread const float2& half_size, thread const float& radius) + { + float2 _43 = (abs(pos) - half_size) + float2(radius); + return (length(fast::max(_43, float2(0.0))) + fast::min(fast::max(_43.x, _43.y), 0.0)) - radius; + } + + fragment main0_out main0(main0_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) + { + main0_out out = {}; + float param = in.params; + float param_1 = in.params; + float _72 = gui_unpack_secondary(param_1); + float2 _88 = float2(1.0) / (float2(fwidth(in.uv.x), fwidth(in.uv.y)) + float2(9.9999999747524270787835121154785e-07)); + float2 param_2 = in.uv * _88; + float2 param_3 = _88 - float2(1.5 * _72); + float param_4 = gui_unpack_radius(param); + out.frag_color = float4(in.color.xyz, in.color.w * (1.0 - smoothstep(-_72, _72, gui_rounded_box_sdf(param_2, param_3, param_4)))); + if (out.frag_color.w < 0.0) + { + out.frag_color += tex.sample(smp, in.uv); + } + return out; + } + +*/ +static const uint8_t gui_blur_fs_source_metal_macos[1892] = { + 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, + 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, + 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, + 0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,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,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e, + 0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a, + 0x0a,0x2f,0x2f,0x20,0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69, + 0x6f,0x6e,0x20,0x6f,0x66,0x20,0x74,0x68,0x65,0x20,0x47,0x4c,0x53,0x4c,0x20,0x6d, + 0x6f,0x64,0x28,0x29,0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x77, + 0x68,0x69,0x63,0x68,0x20,0x69,0x73,0x20,0x73,0x6c,0x69,0x67,0x68,0x74,0x6c,0x79, + 0x20,0x64,0x69,0x66,0x66,0x65,0x72,0x65,0x6e,0x74,0x20,0x74,0x68,0x61,0x6e,0x20, + 0x4d,0x65,0x74,0x61,0x6c,0x20,0x66,0x6d,0x6f,0x64,0x28,0x29,0x0a,0x74,0x65,0x6d, + 0x70,0x6c,0x61,0x74,0x65,0x3c,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54, + 0x78,0x2c,0x20,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54,0x79,0x3e,0x0a, + 0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x54,0x78,0x20,0x6d,0x6f,0x64,0x28,0x54,0x78, + 0x20,0x78,0x2c,0x20,0x54,0x79,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75, + 0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5b, + 0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a, + 0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e, + 0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28, + 0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29, + 0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63, + 0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20, + 0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x70,0x61,0x63, + 0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x70, + 0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x2a,0x20,0x30, + 0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35,0x29,0x20,0x2a, + 0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, + 0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62, + 0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e, + 0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69, + 0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65,0x63,0x6f,0x6e,0x64,0x61,0x72, + 0x79,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x26,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x6d,0x6f,0x64,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x2c,0x20,0x34,0x30,0x39,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x30, + 0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69, + 0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74, + 0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69, + 0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72, + 0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x74, + 0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x26,0x20,0x70,0x6f,0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20, + 0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x68,0x61, + 0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20, + 0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x72,0x61,0x64, + 0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x20,0x5f,0x34,0x33,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x70,0x6f,0x73, + 0x29,0x20,0x2d,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x29,0x20,0x2b, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6c,0x65,0x6e, + 0x67,0x74,0x68,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x34, + 0x33,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29, + 0x20,0x2b,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x66,0x61,0x73, + 0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x34,0x33,0x2e,0x78,0x2c,0x20,0x5f,0x34, + 0x33,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2d,0x20,0x72,0x61, + 0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a,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,0x74,0x65,0x78,0x74, + 0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65,0x78, + 0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c, + 0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73, + 0x61,0x6d,0x70,0x6c,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x37,0x32, + 0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x73,0x65, + 0x63,0x6f,0x6e,0x64,0x61,0x72,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x38,0x38, + 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x2e,0x30,0x29,0x20,0x2f, + 0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x66,0x77,0x69,0x64,0x74,0x68,0x28, + 0x69,0x6e,0x2e,0x75,0x76,0x2e,0x78,0x29,0x2c,0x20,0x66,0x77,0x69,0x64,0x74,0x68, + 0x28,0x69,0x6e,0x2e,0x75,0x76,0x2e,0x79,0x29,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x28,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37, + 0x35,0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33,0x35,0x31,0x32,0x31,0x31, + 0x35,0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20, + 0x3d,0x20,0x69,0x6e,0x2e,0x75,0x76,0x20,0x2a,0x20,0x5f,0x38,0x38,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x33,0x20,0x3d,0x20,0x5f,0x38,0x38,0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x31,0x2e,0x35,0x20,0x2a,0x20,0x5f,0x37,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d, + 0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69, + 0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f, + 0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x2e, + 0x78,0x79,0x7a,0x2c,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20, + 0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73, + 0x74,0x65,0x70,0x28,0x2d,0x5f,0x37,0x32,0x2c,0x20,0x5f,0x37,0x32,0x2c,0x20,0x67, + 0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73, + 0x64,0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x29,0x29,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x6f,0x75,0x74,0x2e,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3c,0x20,0x30,0x2e,0x30, + 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b, + 0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70, + 0x2c,0x20,0x69,0x6e,0x2e,0x75,0x76,0x29,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, +}; +/* + #pragma clang diagnostic ignored "-Wmissing-prototypes" + #pragma clang diagnostic ignored "-Wmissing-braces" + + #include + #include + + using namespace metal; + + template + struct spvUnsafeArray + { + T elements[Num ? Num : 1]; + + thread T& operator [] (size_t pos) thread + { + return elements[pos]; + } + constexpr const thread T& operator [] (size_t pos) const thread + { + return elements[pos]; + } + + device T& operator [] (size_t pos) device + { + return elements[pos]; + } + constexpr const device T& operator [] (size_t pos) const device + { + return elements[pos]; + } + + constexpr const constant T& operator [] (size_t pos) const constant + { + return elements[pos]; + } + + threadgroup T& operator [] (size_t pos) threadgroup + { + return elements[pos]; + } + constexpr const threadgroup T& operator [] (size_t pos) const threadgroup + { + return elements[pos]; + } + }; + + // Implementation of the GLSL mod() function, which is slightly different than Metal fmod() + template + inline Tx mod(Tx x, Ty y) + { + return x - y * floor(x / y); + } + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 uv [[user(locn0)]]; + float4 color [[user(locn1)]]; + float params [[user(locn2)]]; + float4 stop12 [[user(locn3)]]; + float4 stop34 [[user(locn4)]]; + float4 stop56 [[user(locn5)]]; + float4 meta [[user(locn6)]]; + }; + + static inline __attribute__((always_inline)) + float gui_unpack_radius(thread const float& packed_params) + { + return floor(packed_params * 0.000244140625) * 0.25; + } + + static inline __attribute__((always_inline)) + float gui_rounded_box_sdf(thread const float2& pos, thread const float2& half_size, thread const float& radius) + { + float2 _48 = (abs(pos) - half_size) + float2(radius); + return (length(fast::max(_48, float2(0.0))) + fast::min(fast::max(_48.x, _48.y), 0.0)) - radius; + } + + static inline __attribute__((always_inline)) + void gui_unpack_gradient_data(thread const float& val1, thread const float& val2, thread float4& c, thread float& p) + { + p = floor(val2 * 0.00390625) * 9.9999997473787516355514526367188e-05; + c = float4(mod(val1, 256.0) * 0.0039215688593685626983642578125, mod(floor(val1 * 0.00390625), 256.0) * 0.0039215688593685626983642578125, floor(val1 * 1.52587890625e-05) * 0.0039215688593685626983642578125, mod(val2, 256.0) * 0.0039215688593685626983642578125); + } + + static inline __attribute__((always_inline)) + float gui_random(thread const float2& coords) + { + return fract(sin(dot(coords, float2(12.98980045318603515625, 78.233001708984375))) * 43758.546875); + } + + fragment main0_out main0(main0_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]], float4 gl_FragCoord [[position]]) + { + main0_out out = {}; + float param = in.params; + int _135 = int(in.meta.w); + float2 _142 = float2(in.meta.x, in.meta.y); + float2 _143 = in.uv * _142; + float2 param_1 = _143; + float2 param_2 = _142; + float param_3 = gui_unpack_radius(param); + float t; + if (in.meta.z > 0.5) + { + t = length(_143) / in.stop56.w; + } + else + { + t = fma(dot(in.uv, float2(in.stop56.z, in.stop56.w)), 0.5, 0.5); + } + t = fast::clamp(t, 0.0, 1.0); + float param_4 = in.stop12.x; + float param_5 = in.stop12.y; + float4 param_6; + float param_7; + gui_unpack_gradient_data(param_4, param_5, param_6, param_7); + spvUnsafeArray stop_colors; + stop_colors[0] = param_6; + spvUnsafeArray stop_positions; + stop_positions[0] = param_7; + float param_8 = in.stop12.z; + float param_9 = in.stop12.w; + float4 param_10; + float param_11; + gui_unpack_gradient_data(param_8, param_9, param_10, param_11); + stop_colors[1] = param_10; + stop_positions[1] = param_11; + float param_12 = in.stop34.x; + float param_13 = in.stop34.y; + float4 param_14; + float param_15; + gui_unpack_gradient_data(param_12, param_13, param_14, param_15); + stop_colors[2] = param_14; + stop_positions[2] = param_15; + float param_16 = in.stop34.z; + float param_17 = in.stop34.w; + float4 param_18; + float param_19; + gui_unpack_gradient_data(param_16, param_17, param_18, param_19); + stop_colors[3] = param_18; + stop_positions[3] = param_19; + float param_20 = in.stop56.x; + float param_21 = in.stop56.y; + float4 param_22; + float param_23; + gui_unpack_gradient_data(param_20, param_21, param_22, param_23); + stop_colors[4] = param_22; + stop_positions[4] = param_23; + stop_colors[5] = stop_colors[4]; + stop_positions[5] = stop_positions[4]; + float4 c1 = stop_colors[0]; + float4 c2 = stop_colors[0]; + float p1 = stop_positions[0]; + float p2 = stop_positions[0]; + for (int i = 1; i < 6; i++) + { + if (i >= _135) + { + break; + } + if (t <= stop_positions[i]) + { + c2 = stop_colors[i]; + p2 = stop_positions[i]; + int _314 = i - 1; + c1 = stop_colors[_314]; + p1 = stop_positions[_314]; + break; + } + if (i == (_135 - 1)) + { + c1 = stop_colors[i]; + c2 = stop_colors[i]; + p1 = stop_positions[i]; + p2 = stop_positions[i]; + } + } + float _347 = (t - p1) / fast::max(p2 - p1, 9.9999997473787516355514526367188e-05); + float _374 = mix(c1.w, c2.w, _347); + float4 gradient_color = float4(mix(c1.xyz * c1.w, c2.xyz * c2.w, float3(_347)) / float3(fast::max(_374, 9.9999997473787516355514526367188e-05)), _374); + float2 param_24 = gl_FragCoord.xy; + float4 _398 = gradient_color; + float3 _400 = _398.xyz + float3((gui_random(param_24) - 0.5) * 0.0039215688593685626983642578125); + float _402 = _400.x; + float4 _448 = _398; + _448.x = _402; + _448.y = _400.y; + _448.z = _400.z; + gradient_color = _448; + out.frag_color = float4(_402, _400.yz, (_398.w * (1.0 - smoothstep(-0.5, 0.5, gui_rounded_box_sdf(param_1, param_2, param_3)))) * in.color.w); + if (out.frag_color.w < 0.0) + { + out.frag_color += tex.sample(smp, in.uv); + } + return out; + } + +*/ +static const uint8_t gui_gradient_fs_source_metal_macos[6264] = { + 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, + 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, + 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, + 0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20, + 0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63, + 0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64,0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73, + 0x69,0x6e,0x67,0x2d,0x62,0x72,0x61,0x63,0x65,0x73,0x22,0x0a,0x0a,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,0x75,0x73,0x69, + 0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74, + 0x61,0x6c,0x3b,0x0a,0x0a,0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,0x3c,0x74,0x79, + 0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54,0x2c,0x20,0x73,0x69,0x7a,0x65,0x5f,0x74, + 0x20,0x4e,0x75,0x6d,0x3e,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x73,0x70,0x76, + 0x55,0x6e,0x73,0x61,0x66,0x65,0x41,0x72,0x72,0x61,0x79,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x54,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x4e,0x75,0x6d, + 0x20,0x3f,0x20,0x4e,0x75,0x6d,0x20,0x3a,0x20,0x31,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x0a,0x20,0x20,0x20,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x54,0x26,0x20, + 0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a, + 0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f, + 0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f, + 0x6e,0x73,0x74,0x65,0x78,0x70,0x72,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x74,0x68, + 0x72,0x65,0x61,0x64,0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72, + 0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x0a,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, + 0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x0a,0x20,0x20,0x20, + 0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61, + 0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70, + 0x6f,0x73,0x29,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, + 0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x73,0x74,0x65,0x78, + 0x70,0x72,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20, + 0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28, + 0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x63,0x6f,0x6e,0x73, + 0x74,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x65,0x6c, + 0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x73, + 0x74,0x65,0x78,0x70,0x72,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x63,0x6f,0x6e,0x73, + 0x74,0x61,0x6e,0x74,0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72, + 0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f, + 0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x0a,0x20, + 0x20,0x20,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x67,0x72,0x6f,0x75,0x70,0x20,0x54, + 0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28,0x73, + 0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x74,0x68,0x72,0x65,0x61, + 0x64,0x67,0x72,0x6f,0x75,0x70,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d, + 0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x73,0x74,0x65,0x78,0x70,0x72,0x20,0x63, + 0x6f,0x6e,0x73,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x67,0x72,0x6f,0x75,0x70, + 0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20, + 0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x63,0x6f,0x6e, + 0x73,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x67,0x72,0x6f,0x75,0x70,0x0a,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73, + 0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x3b,0x0a,0x0a,0x2f,0x2f,0x20, + 0x49,0x6d,0x70,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x20,0x6f, + 0x66,0x20,0x74,0x68,0x65,0x20,0x47,0x4c,0x53,0x4c,0x20,0x6d,0x6f,0x64,0x28,0x29, + 0x20,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x77,0x68,0x69,0x63,0x68, + 0x20,0x69,0x73,0x20,0x73,0x6c,0x69,0x67,0x68,0x74,0x6c,0x79,0x20,0x64,0x69,0x66, + 0x66,0x65,0x72,0x65,0x6e,0x74,0x20,0x74,0x68,0x61,0x6e,0x20,0x4d,0x65,0x74,0x61, + 0x6c,0x20,0x66,0x6d,0x6f,0x64,0x28,0x29,0x0a,0x74,0x65,0x6d,0x70,0x6c,0x61,0x74, + 0x65,0x3c,0x74,0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54,0x78,0x2c,0x20,0x74, + 0x79,0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54,0x79,0x3e,0x0a,0x69,0x6e,0x6c,0x69, + 0x6e,0x65,0x20,0x54,0x78,0x20,0x6d,0x6f,0x64,0x28,0x54,0x78,0x20,0x78,0x2c,0x20, + 0x54,0x79,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, + 0x72,0x6e,0x20,0x78,0x20,0x2d,0x20,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x6f,0x72, + 0x28,0x78,0x20,0x2f,0x20,0x79,0x29,0x3b,0x0a,0x7d,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,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,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28, + 0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65, + 0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x31,0x32,0x20,0x5b,0x5b, + 0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f,0x70,0x33,0x34, + 0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x34,0x29,0x5d,0x5d, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x74,0x6f, + 0x70,0x35,0x36,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x35, + 0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x6d,0x65,0x74,0x61,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e, + 0x36,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, + 0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62, + 0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e, + 0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69, + 0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x74, + 0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x26,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30, + 0x36,0x32,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f, + 0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77, + 0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62, + 0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f, + 0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x70,0x6f,0x73,0x2c, + 0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x26,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x2c, + 0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x26,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20, + 0x28,0x61,0x62,0x73,0x28,0x70,0x6f,0x73,0x29,0x20,0x2d,0x20,0x68,0x61,0x6c,0x66, + 0x5f,0x73,0x69,0x7a,0x65,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, + 0x72,0x61,0x64,0x69,0x75,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x28,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x66,0x61,0x73,0x74, + 0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x34,0x38,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x20,0x2b,0x20,0x66,0x61,0x73,0x74,0x3a, + 0x3a,0x6d,0x69,0x6e,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f, + 0x34,0x38,0x2e,0x78,0x2c,0x20,0x5f,0x34,0x38,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e, + 0x30,0x29,0x29,0x20,0x2d,0x20,0x72,0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f, + 0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c, + 0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x76,0x6f, + 0x69,0x64,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72, + 0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x74,0x68,0x72,0x65, + 0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20, + 0x76,0x61,0x6c,0x31,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e, + 0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x76,0x61,0x6c,0x32,0x2c,0x20, + 0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x26,0x20,0x63, + 0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20, + 0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x70,0x20,0x3d,0x20,0x66,0x6c,0x6f, + 0x6f,0x72,0x28,0x76,0x61,0x6c,0x32,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39, + 0x30,0x36,0x32,0x35,0x29,0x20,0x2a,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39, + 0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34, + 0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x63,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x6d,0x6f, + 0x64,0x28,0x76,0x61,0x6c,0x31,0x2c,0x20,0x32,0x35,0x36,0x2e,0x30,0x29,0x20,0x2a, + 0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33, + 0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31, + 0x32,0x35,0x2c,0x20,0x6d,0x6f,0x64,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x76,0x61, + 0x6c,0x31,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x29, + 0x2c,0x20,0x32,0x35,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33, + 0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36, + 0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x66,0x6c, + 0x6f,0x6f,0x72,0x28,0x76,0x61,0x6c,0x31,0x20,0x2a,0x20,0x31,0x2e,0x35,0x32,0x35, + 0x38,0x37,0x38,0x39,0x30,0x36,0x32,0x35,0x65,0x2d,0x30,0x35,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36, + 0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32, + 0x35,0x2c,0x20,0x6d,0x6f,0x64,0x28,0x76,0x61,0x6c,0x32,0x2c,0x20,0x32,0x35,0x36, + 0x2e,0x30,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36, + 0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34, + 0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61, + 0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74, + 0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73, + 0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x67,0x75,0x69,0x5f,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x28,0x74,0x68,0x72,0x65,0x61, + 0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20, + 0x63,0x6f,0x6f,0x72,0x64,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x73,0x69,0x6e,0x28,0x64, + 0x6f,0x74,0x28,0x63,0x6f,0x6f,0x72,0x64,0x73,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x28,0x31,0x32,0x2e,0x39,0x38,0x39,0x38,0x30,0x30,0x34,0x35,0x33,0x31,0x38, + 0x36,0x30,0x33,0x35,0x31,0x35,0x36,0x32,0x35,0x2c,0x20,0x37,0x38,0x2e,0x32,0x33, + 0x33,0x30,0x30,0x31,0x37,0x30,0x38,0x39,0x38,0x34,0x33,0x37,0x35,0x29,0x29,0x29, + 0x20,0x2a,0x20,0x34,0x33,0x37,0x35,0x38,0x2e,0x35,0x34,0x36,0x38,0x37,0x35,0x29, + 0x3b,0x0a,0x7d,0x0a,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,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32, + 0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x72,0x20,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x70, + 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x33,0x35,0x20,0x3d, + 0x20,0x69,0x6e,0x74,0x28,0x69,0x6e,0x2e,0x6d,0x65,0x74,0x61,0x2e,0x77,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x34,0x32, + 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x69,0x6e,0x2e,0x6d,0x65,0x74, + 0x61,0x2e,0x78,0x2c,0x20,0x69,0x6e,0x2e,0x6d,0x65,0x74,0x61,0x2e,0x79,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x34,0x33, + 0x20,0x3d,0x20,0x69,0x6e,0x2e,0x75,0x76,0x20,0x2a,0x20,0x5f,0x31,0x34,0x32,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x31,0x34,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d, + 0x20,0x5f,0x31,0x34,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75, + 0x6e,0x70,0x61,0x63,0x6b,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x74, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x69,0x6e,0x2e,0x6d,0x65,0x74, + 0x61,0x2e,0x7a,0x20,0x3e,0x20,0x30,0x2e,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x20,0x3d,0x20,0x6c,0x65,0x6e, + 0x67,0x74,0x68,0x28,0x5f,0x31,0x34,0x33,0x29,0x20,0x2f,0x20,0x69,0x6e,0x2e,0x73, + 0x74,0x6f,0x70,0x35,0x36,0x2e,0x77,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,0x74,0x20,0x3d,0x20,0x66,0x6d,0x61,0x28,0x64,0x6f, + 0x74,0x28,0x69,0x6e,0x2e,0x75,0x76,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, + 0x69,0x6e,0x2e,0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x7a,0x2c,0x20,0x69,0x6e,0x2e, + 0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x77,0x29,0x29,0x2c,0x20,0x30,0x2e,0x35,0x2c, + 0x20,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, + 0x20,0x74,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70, + 0x28,0x74,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34, + 0x20,0x3d,0x20,0x69,0x6e,0x2e,0x73,0x74,0x6f,0x70,0x31,0x32,0x2e,0x78,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x35,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x73,0x74,0x6f,0x70,0x31,0x32,0x2e,0x79,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x75,0x69,0x5f, + 0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f, + 0x64,0x61,0x74,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x2c,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x70, + 0x76,0x55,0x6e,0x73,0x61,0x66,0x65,0x41,0x72,0x72,0x61,0x79,0x3c,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x2c,0x20,0x36,0x3e,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x70,0x76,0x55,0x6e,0x73,0x61,0x66,0x65, + 0x41,0x72,0x72,0x61,0x79,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x2c,0x20,0x36,0x3e,0x20, + 0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,0x73,0x5b,0x30,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x38,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x73,0x74,0x6f,0x70,0x31,0x32,0x2e,0x7a, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x39,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x73,0x74,0x6f,0x70,0x31,0x32,0x2e, + 0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69, + 0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b, + 0x31,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, + 0x73,0x5b,0x31,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x32,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x73,0x74,0x6f,0x70,0x33,0x34,0x2e, + 0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x33,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x73,0x74,0x6f,0x70,0x33, + 0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x35,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61, + 0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x73,0x5b,0x32,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69, + 0x74,0x69,0x6f,0x6e,0x73,0x5b,0x32,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x36,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x73,0x74,0x6f, + 0x70,0x33,0x34,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x37,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x73, + 0x74,0x6f,0x70,0x33,0x34,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x39, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b, + 0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61,0x74,0x61,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x38,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x33,0x5d,0x20,0x3d,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f, + 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x33,0x5d,0x20,0x3d,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x30,0x20,0x3d,0x20,0x69,0x6e, + 0x2e,0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x31,0x20,0x3d,0x20, + 0x69,0x6e,0x2e,0x73,0x74,0x6f,0x70,0x35,0x36,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x32, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x32,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e, + 0x70,0x61,0x63,0x6b,0x5f,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x64,0x61, + 0x74,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x30,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x32,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x32,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x34,0x5d,0x20,0x3d, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73, + 0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x34,0x5d, + 0x20,0x3d,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x33,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x35,0x5d,0x20, + 0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x34,0x5d, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x73,0x5b,0x35,0x5d,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70, + 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x34,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f, + 0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f, + 0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70, + 0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x30,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x32,0x20,0x3d,0x20,0x73,0x74, + 0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x30,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20, + 0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20,0x36,0x3b,0x20,0x69,0x2b,0x2b,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x69,0x20,0x3e,0x3d,0x20,0x5f,0x31,0x33,0x35,0x29,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,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,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x74,0x20,0x3c,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, + 0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x73,0x5b, + 0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x70,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x31,0x34,0x20,0x3d,0x20,0x69, + 0x20,0x2d,0x20,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x63,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x73,0x5b,0x5f,0x33,0x31,0x34,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f, + 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x5f,0x33,0x31,0x34,0x5d,0x3b, + 0x0a,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,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x69,0x20,0x3d,0x3d,0x20,0x28, + 0x5f,0x31,0x33,0x35,0x20,0x2d,0x20,0x31,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x63,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x63,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x70,0x31,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70,0x5f,0x70,0x6f,0x73, + 0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x32,0x20,0x3d,0x20,0x73,0x74,0x6f,0x70, + 0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x73,0x5b,0x69,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x34,0x37,0x20,0x3d,0x20, + 0x28,0x74,0x20,0x2d,0x20,0x70,0x31,0x29,0x20,0x2f,0x20,0x66,0x61,0x73,0x74,0x3a, + 0x3a,0x6d,0x61,0x78,0x28,0x70,0x32,0x20,0x2d,0x20,0x70,0x31,0x2c,0x20,0x39,0x2e, + 0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36, + 0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65, + 0x2d,0x30,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x33,0x37,0x34,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x63,0x31,0x2e,0x77,0x2c, + 0x20,0x63,0x32,0x2e,0x77,0x2c,0x20,0x5f,0x33,0x34,0x37,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e, + 0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x28,0x6d,0x69,0x78,0x28,0x63,0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x31, + 0x2e,0x77,0x2c,0x20,0x63,0x32,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x32,0x2e, + 0x77,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x34,0x37,0x29,0x29, + 0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a, + 0x6d,0x61,0x78,0x28,0x5f,0x33,0x37,0x34,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39, + 0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35, + 0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29, + 0x29,0x2c,0x20,0x5f,0x33,0x37,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x34,0x20,0x3d,0x20, + 0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x33,0x39,0x38, + 0x20,0x3d,0x20,0x67,0x72,0x61,0x64,0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34, + 0x30,0x30,0x20,0x3d,0x20,0x5f,0x33,0x39,0x38,0x2e,0x78,0x79,0x7a,0x20,0x2b,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x28,0x67,0x75,0x69,0x5f,0x72,0x61,0x6e,0x64, + 0x6f,0x6d,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x34,0x29,0x20,0x2d,0x20,0x30, + 0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36, + 0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34, + 0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x34,0x30,0x32,0x20,0x3d,0x20,0x5f,0x34,0x30,0x30,0x2e, + 0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x34, + 0x34,0x38,0x20,0x3d,0x20,0x5f,0x33,0x39,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f, + 0x34,0x34,0x38,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x34,0x30,0x32,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x5f,0x34,0x34,0x38,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x34,0x30,0x30,0x2e, + 0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x34,0x34,0x38,0x2e,0x7a,0x20,0x3d,0x20, + 0x5f,0x34,0x30,0x30,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x72,0x61,0x64, + 0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x34,0x34, + 0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f, + 0x34,0x30,0x32,0x2c,0x20,0x5f,0x34,0x30,0x30,0x2e,0x79,0x7a,0x2c,0x20,0x28,0x5f, + 0x33,0x39,0x38,0x2e,0x77,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x73, + 0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x2d,0x30,0x2e,0x35,0x2c,0x20, + 0x30,0x2e,0x35,0x2c,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64, + 0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x33,0x29,0x29,0x29,0x29,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f, + 0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x6f,0x75, + 0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3c, + 0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x20,0x2b,0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x75,0x76,0x29,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, +}; +/* + #pragma clang diagnostic ignored "-Wmissing-prototypes" + + #include + #include + + using namespace metal; + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 uv [[user(locn0)]]; + float params [[user(locn2)]]; + }; + + static inline __attribute__((always_inline)) + float gui_unpack_radius(thread const float& packed_params) + { + return floor(packed_params * 0.000244140625) * 0.25; + } + + static inline __attribute__((always_inline)) + float gui_rounded_box_sdf(thread const float2& pos, thread const float2& half_size, thread const float& radius) + { + float2 _38 = (abs(pos) - half_size) + float2(radius); + return (length(fast::max(_38, float2(0.0))) + fast::min(fast::max(_38.x, _38.y), 0.0)) - radius; + } + + static inline __attribute__((always_inline)) + float gui_normalized_sdf_alpha(thread float& d) + { + d /= fast::max(length(float2(dfdx(d), dfdy(d))), 0.001000000047497451305389404296875); + return 1.0 - smoothstep(-0.589999973773956298828125, 0.589999973773956298828125, d); + } + + fragment main0_out main0(main0_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) + { + main0_out out = {}; + float param = in.params; + float2 _98 = float2(1.0) / (float2(fwidth(in.uv.x), fwidth(in.uv.y)) + float2(9.9999999747524270787835121154785e-07)); + float2 param_1 = in.uv * _98; + float2 param_2 = _98; + float param_3 = gui_unpack_radius(param); + float param_4 = gui_rounded_box_sdf(param_1, param_2, param_3); + float _116 = gui_normalized_sdf_alpha(param_4); + float4 _137 = tex.sample(smp, ((in.uv * 0.5) + float2(0.5))); + out.frag_color = float4(_137.xyz, _137.w * _116); + return out; + } + +*/ +static const uint8_t gui_image_clip_fs_source_metal_macos[1700] = { + 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, + 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, + 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, + 0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,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,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e, + 0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,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,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,0x20,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5b,0x5b, + 0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x7d, + 0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65, + 0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28, + 0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b, + 0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63, + 0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x70,0x61,0x63,0x6b, + 0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x70,0x61, + 0x63,0x6b,0x65,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x2a,0x20,0x30,0x2e, + 0x30,0x30,0x30,0x32,0x34,0x34,0x31,0x34,0x30,0x36,0x32,0x35,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x32,0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, + 0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75, + 0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c, + 0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69,0x5f, + 0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f,0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28, + 0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x26,0x20,0x70,0x6f,0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x68, + 0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x72,0x61, + 0x64,0x69,0x75,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x20,0x5f,0x33,0x38,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x70,0x6f, + 0x73,0x29,0x20,0x2d,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x29,0x20, + 0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x69,0x75,0x73,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6c,0x65, + 0x6e,0x67,0x74,0x68,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f, + 0x33,0x38,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x29,0x29, + 0x29,0x20,0x2b,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x66,0x61, + 0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x38,0x2e,0x78,0x2c,0x20,0x5f, + 0x33,0x38,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2d,0x20,0x72, + 0x61,0x64,0x69,0x75,0x73,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, + 0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62, + 0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e, + 0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x75,0x69, + 0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x64,0x5f,0x73,0x64,0x66,0x5f, + 0x61,0x6c,0x70,0x68,0x61,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x26,0x20,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x64,0x20,0x2f, + 0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x6c,0x65,0x6e,0x67, + 0x74,0x68,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x64,0x66,0x64,0x78,0x28,0x64, + 0x29,0x2c,0x20,0x64,0x66,0x64,0x79,0x28,0x64,0x29,0x29,0x29,0x2c,0x20,0x30,0x2e, + 0x30,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34, + 0x35,0x31,0x33,0x30,0x35,0x33,0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37, + 0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x31, + 0x2e,0x30,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28, + 0x2d,0x30,0x2e,0x35,0x38,0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39, + 0x35,0x36,0x32,0x39,0x38,0x38,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x35, + 0x38,0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39, + 0x38,0x38,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x64,0x29,0x3b,0x0a,0x7d,0x0a,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,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f, + 0x61,0x74,0x3e,0x20,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20, + 0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,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,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20, + 0x69,0x6e,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x39,0x38,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x28,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x28,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x69,0x6e,0x2e,0x75,0x76,0x2e,0x78, + 0x29,0x2c,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x69,0x6e,0x2e,0x75,0x76,0x2e, + 0x79,0x29,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x39,0x2e,0x39, + 0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x35,0x32,0x34,0x32,0x37,0x30,0x37, + 0x38,0x37,0x38,0x33,0x35,0x31,0x32,0x31,0x31,0x35,0x34,0x37,0x38,0x35,0x65,0x2d, + 0x30,0x37,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x75,0x76, + 0x20,0x2a,0x20,0x5f,0x39,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x39,0x38, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x33,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x75,0x6e,0x70,0x61,0x63,0x6b, + 0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x34,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x65,0x64,0x5f, + 0x62,0x6f,0x78,0x5f,0x73,0x64,0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31, + 0x31,0x36,0x20,0x3d,0x20,0x67,0x75,0x69,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69, + 0x7a,0x65,0x64,0x5f,0x73,0x64,0x66,0x5f,0x61,0x6c,0x70,0x68,0x61,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x5f,0x31,0x33,0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x28,0x28,0x69,0x6e,0x2e,0x75, + 0x76,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x28,0x30,0x2e,0x35,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75, + 0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x31,0x33,0x37,0x2e,0x78,0x79,0x7a,0x2c,0x20, + 0x5f,0x31,0x33,0x37,0x2e,0x77,0x20,0x2a,0x20,0x5f,0x31,0x31,0x36,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x00, +}; +/* + #pragma clang diagnostic ignored "-Wmissing-prototypes" + #pragma clang diagnostic ignored "-Wmissing-braces" + + #include + #include + + using namespace metal; + + template + struct spvUnsafeArray + { + T elements[Num ? Num : 1]; + + thread T& operator [] (size_t pos) thread + { + return elements[pos]; + } + constexpr const thread T& operator [] (size_t pos) const thread + { + return elements[pos]; + } + + device T& operator [] (size_t pos) device + { + return elements[pos]; + } + constexpr const device T& operator [] (size_t pos) const device + { + return elements[pos]; + } + + constexpr const constant T& operator [] (size_t pos) const constant + { + return elements[pos]; + } + + threadgroup T& operator [] (size_t pos) threadgroup + { + return elements[pos]; + } + constexpr const threadgroup T& operator [] (size_t pos) const threadgroup + { + return elements[pos]; + } + }; + + constant spvUnsafeArray _19 = spvUnsafeArray({ 0.19946999847888946533203125, 0.17602999508380889892578125, 0.120980001986026763916015625, 0.0647599995136260986328125, 0.02700000070035457611083984375, 0.0087700001895427703857421875, 0.00221999990753829479217529296875 }); + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 uv [[user(locn0)]]; + float std_dev [[user(locn2)]]; + }; + + fragment main0_out main0(main0_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) + { + main0_out out = {}; + float _47 = in.std_dev / float2(int2(tex.get_width(), tex.get_height())).x; + out.frag_color = tex.sample(smp, in.uv) * _19[0]; + for (int i = 1; i < 7; i++) + { + float2 _84 = float2(float(i) * _47, 0.0); + out.frag_color += (tex.sample(smp, (in.uv + _84)) * _19[i]); + out.frag_color += (tex.sample(smp, (in.uv - _84)) * _19[i]); + } + return out; + } + +*/ +static const uint8_t gui_filter_blur_h_fs_source_metal_macos[1988] = { + 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, + 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, + 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, + 0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20, + 0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63, + 0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64,0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73, + 0x69,0x6e,0x67,0x2d,0x62,0x72,0x61,0x63,0x65,0x73,0x22,0x0a,0x0a,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,0x75,0x73,0x69, + 0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74, + 0x61,0x6c,0x3b,0x0a,0x0a,0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,0x3c,0x74,0x79, + 0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54,0x2c,0x20,0x73,0x69,0x7a,0x65,0x5f,0x74, + 0x20,0x4e,0x75,0x6d,0x3e,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x73,0x70,0x76, + 0x55,0x6e,0x73,0x61,0x66,0x65,0x41,0x72,0x72,0x61,0x79,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x54,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x4e,0x75,0x6d, + 0x20,0x3f,0x20,0x4e,0x75,0x6d,0x20,0x3a,0x20,0x31,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x0a,0x20,0x20,0x20,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x54,0x26,0x20, + 0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a, + 0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f, + 0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f, + 0x6e,0x73,0x74,0x65,0x78,0x70,0x72,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x74,0x68, + 0x72,0x65,0x61,0x64,0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72, + 0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x0a,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, + 0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x0a,0x20,0x20,0x20, + 0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61, + 0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70, + 0x6f,0x73,0x29,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, + 0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x73,0x74,0x65,0x78, + 0x70,0x72,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20, + 0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28, + 0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x63,0x6f,0x6e,0x73, + 0x74,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x65,0x6c, + 0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x73, + 0x74,0x65,0x78,0x70,0x72,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x63,0x6f,0x6e,0x73, + 0x74,0x61,0x6e,0x74,0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72, + 0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f, + 0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x0a,0x20, + 0x20,0x20,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x67,0x72,0x6f,0x75,0x70,0x20,0x54, + 0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28,0x73, + 0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x74,0x68,0x72,0x65,0x61, + 0x64,0x67,0x72,0x6f,0x75,0x70,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d, + 0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x73,0x74,0x65,0x78,0x70,0x72,0x20,0x63, + 0x6f,0x6e,0x73,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x67,0x72,0x6f,0x75,0x70, + 0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20, + 0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x63,0x6f,0x6e, + 0x73,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x67,0x72,0x6f,0x75,0x70,0x0a,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73, + 0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x3b,0x0a,0x0a,0x63,0x6f,0x6e, + 0x73,0x74,0x61,0x6e,0x74,0x20,0x73,0x70,0x76,0x55,0x6e,0x73,0x61,0x66,0x65,0x41, + 0x72,0x72,0x61,0x79,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x2c,0x20,0x37,0x3e,0x20,0x5f, + 0x31,0x39,0x20,0x3d,0x20,0x73,0x70,0x76,0x55,0x6e,0x73,0x61,0x66,0x65,0x41,0x72, + 0x72,0x61,0x79,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x2c,0x20,0x37,0x3e,0x28,0x7b,0x20, + 0x30,0x2e,0x31,0x39,0x39,0x34,0x36,0x39,0x39,0x39,0x38,0x34,0x37,0x38,0x38,0x38, + 0x39,0x34,0x36,0x35,0x33,0x33,0x32,0x30,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e, + 0x31,0x37,0x36,0x30,0x32,0x39,0x39,0x39,0x35,0x30,0x38,0x33,0x38,0x30,0x38,0x38, + 0x39,0x38,0x39,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x31,0x32, + 0x30,0x39,0x38,0x30,0x30,0x30,0x31,0x39,0x38,0x36,0x30,0x32,0x36,0x37,0x36,0x33, + 0x39,0x31,0x36,0x30,0x31,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x36,0x34, + 0x37,0x35,0x39,0x39,0x39,0x39,0x35,0x31,0x33,0x36,0x32,0x36,0x30,0x39,0x38,0x36, + 0x33,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x32,0x37,0x30,0x30,0x30, + 0x30,0x30,0x30,0x37,0x30,0x30,0x33,0x35,0x34,0x35,0x37,0x36,0x31,0x31,0x30,0x38, + 0x33,0x39,0x38,0x34,0x33,0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x38,0x37,0x37, + 0x30,0x30,0x30,0x30,0x31,0x38,0x39,0x35,0x34,0x32,0x37,0x37,0x30,0x33,0x38,0x35, + 0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x32,0x32,0x31, + 0x39,0x39,0x39,0x39,0x39,0x30,0x37,0x35,0x33,0x38,0x32,0x39,0x34,0x37,0x39,0x32, + 0x31,0x37,0x35,0x32,0x39,0x32,0x39,0x36,0x38,0x37,0x35,0x20,0x7d,0x29,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,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,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x5b, + 0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a, + 0x7d,0x3b,0x0a,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,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64, + 0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65, + 0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x72,0x20,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x37,0x20, + 0x3d,0x20,0x69,0x6e,0x2e,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x2f,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x28,0x69,0x6e,0x74,0x32,0x28,0x74,0x65,0x78,0x2e,0x67, + 0x65,0x74,0x5f,0x77,0x69,0x64,0x74,0x68,0x28,0x29,0x2c,0x20,0x74,0x65,0x78,0x2e, + 0x67,0x65,0x74,0x5f,0x68,0x65,0x69,0x67,0x68,0x74,0x28,0x29,0x29,0x29,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x75,0x76,0x29,0x20,0x2a,0x20, + 0x5f,0x31,0x39,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20, + 0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20, + 0x37,0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x38,0x34, + 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28, + 0x69,0x29,0x20,0x2a,0x20,0x5f,0x34,0x37,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x28,0x74,0x65,0x78,0x2e,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x75, + 0x76,0x20,0x2b,0x20,0x5f,0x38,0x34,0x29,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x5b, + 0x69,0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x28, + 0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20, + 0x28,0x69,0x6e,0x2e,0x75,0x76,0x20,0x2d,0x20,0x5f,0x38,0x34,0x29,0x29,0x20,0x2a, + 0x20,0x5f,0x31,0x39,0x5b,0x69,0x5d,0x29,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, +}; +/* + #pragma clang diagnostic ignored "-Wmissing-prototypes" + #pragma clang diagnostic ignored "-Wmissing-braces" + + #include + #include + + using namespace metal; + + template + struct spvUnsafeArray + { + T elements[Num ? Num : 1]; + + thread T& operator [] (size_t pos) thread + { + return elements[pos]; + } + constexpr const thread T& operator [] (size_t pos) const thread + { + return elements[pos]; + } + + device T& operator [] (size_t pos) device + { + return elements[pos]; + } + constexpr const device T& operator [] (size_t pos) const device + { + return elements[pos]; + } + + constexpr const constant T& operator [] (size_t pos) const constant + { + return elements[pos]; + } + + threadgroup T& operator [] (size_t pos) threadgroup + { + return elements[pos]; + } + constexpr const threadgroup T& operator [] (size_t pos) const threadgroup + { + return elements[pos]; + } + }; + + constant spvUnsafeArray _19 = spvUnsafeArray({ 0.19946999847888946533203125, 0.17602999508380889892578125, 0.120980001986026763916015625, 0.0647599995136260986328125, 0.02700000070035457611083984375, 0.0087700001895427703857421875, 0.00221999990753829479217529296875 }); + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 uv [[user(locn0)]]; + float std_dev [[user(locn2)]]; + }; + + fragment main0_out main0(main0_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) + { + main0_out out = {}; + float _47 = in.std_dev / float2(int2(tex.get_width(), tex.get_height())).y; + out.frag_color = tex.sample(smp, in.uv) * _19[0]; + for (int i = 1; i < 7; i++) + { + float2 _84 = float2(0.0, float(i) * _47); + out.frag_color += (tex.sample(smp, (in.uv + _84)) * _19[i]); + out.frag_color += (tex.sample(smp, (in.uv - _84)) * _19[i]); + } + return out; + } + +*/ +static const uint8_t gui_filter_blur_v_fs_source_metal_macos[1988] = { + 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, + 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, + 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, + 0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20, + 0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63, + 0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64,0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73, + 0x69,0x6e,0x67,0x2d,0x62,0x72,0x61,0x63,0x65,0x73,0x22,0x0a,0x0a,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,0x75,0x73,0x69, + 0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74, + 0x61,0x6c,0x3b,0x0a,0x0a,0x74,0x65,0x6d,0x70,0x6c,0x61,0x74,0x65,0x3c,0x74,0x79, + 0x70,0x65,0x6e,0x61,0x6d,0x65,0x20,0x54,0x2c,0x20,0x73,0x69,0x7a,0x65,0x5f,0x74, + 0x20,0x4e,0x75,0x6d,0x3e,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x73,0x70,0x76, + 0x55,0x6e,0x73,0x61,0x66,0x65,0x41,0x72,0x72,0x61,0x79,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x54,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x4e,0x75,0x6d, + 0x20,0x3f,0x20,0x4e,0x75,0x6d,0x20,0x3a,0x20,0x31,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x0a,0x20,0x20,0x20,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x54,0x26,0x20, + 0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a, + 0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f, + 0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f, + 0x6e,0x73,0x74,0x65,0x78,0x70,0x72,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x74,0x68, + 0x72,0x65,0x61,0x64,0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72, + 0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x0a,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, + 0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x0a,0x20,0x20,0x20, + 0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61, + 0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70, + 0x6f,0x73,0x29,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, + 0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x73,0x74,0x65,0x78, + 0x70,0x72,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20, + 0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28, + 0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x63,0x6f,0x6e,0x73, + 0x74,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x65,0x6c, + 0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x73, + 0x74,0x65,0x78,0x70,0x72,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x63,0x6f,0x6e,0x73, + 0x74,0x61,0x6e,0x74,0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72, + 0x20,0x5b,0x5d,0x20,0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f, + 0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x0a,0x20, + 0x20,0x20,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x67,0x72,0x6f,0x75,0x70,0x20,0x54, + 0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20,0x28,0x73, + 0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x74,0x68,0x72,0x65,0x61, + 0x64,0x67,0x72,0x6f,0x75,0x70,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d, + 0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6e,0x73,0x74,0x65,0x78,0x70,0x72,0x20,0x63, + 0x6f,0x6e,0x73,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x67,0x72,0x6f,0x75,0x70, + 0x20,0x54,0x26,0x20,0x6f,0x70,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x5b,0x5d,0x20, + 0x28,0x73,0x69,0x7a,0x65,0x5f,0x74,0x20,0x70,0x6f,0x73,0x29,0x20,0x63,0x6f,0x6e, + 0x73,0x74,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x67,0x72,0x6f,0x75,0x70,0x0a,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x65,0x6c,0x65,0x6d,0x65,0x6e,0x74,0x73,0x5b,0x70,0x6f,0x73, + 0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x3b,0x0a,0x0a,0x63,0x6f,0x6e, + 0x73,0x74,0x61,0x6e,0x74,0x20,0x73,0x70,0x76,0x55,0x6e,0x73,0x61,0x66,0x65,0x41, + 0x72,0x72,0x61,0x79,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x2c,0x20,0x37,0x3e,0x20,0x5f, + 0x31,0x39,0x20,0x3d,0x20,0x73,0x70,0x76,0x55,0x6e,0x73,0x61,0x66,0x65,0x41,0x72, + 0x72,0x61,0x79,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x2c,0x20,0x37,0x3e,0x28,0x7b,0x20, + 0x30,0x2e,0x31,0x39,0x39,0x34,0x36,0x39,0x39,0x39,0x38,0x34,0x37,0x38,0x38,0x38, + 0x39,0x34,0x36,0x35,0x33,0x33,0x32,0x30,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e, + 0x31,0x37,0x36,0x30,0x32,0x39,0x39,0x39,0x35,0x30,0x38,0x33,0x38,0x30,0x38,0x38, + 0x39,0x38,0x39,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x31,0x32, + 0x30,0x39,0x38,0x30,0x30,0x30,0x31,0x39,0x38,0x36,0x30,0x32,0x36,0x37,0x36,0x33, + 0x39,0x31,0x36,0x30,0x31,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x36,0x34, + 0x37,0x35,0x39,0x39,0x39,0x39,0x35,0x31,0x33,0x36,0x32,0x36,0x30,0x39,0x38,0x36, + 0x33,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x32,0x37,0x30,0x30,0x30, + 0x30,0x30,0x30,0x37,0x30,0x30,0x33,0x35,0x34,0x35,0x37,0x36,0x31,0x31,0x30,0x38, + 0x33,0x39,0x38,0x34,0x33,0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x38,0x37,0x37, + 0x30,0x30,0x30,0x30,0x31,0x38,0x39,0x35,0x34,0x32,0x37,0x37,0x30,0x33,0x38,0x35, + 0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x32,0x32,0x31, + 0x39,0x39,0x39,0x39,0x39,0x30,0x37,0x35,0x33,0x38,0x32,0x39,0x34,0x37,0x39,0x32, + 0x31,0x37,0x35,0x32,0x39,0x32,0x39,0x36,0x38,0x37,0x35,0x20,0x7d,0x29,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,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,0x20,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x5b, + 0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a, + 0x7d,0x3b,0x0a,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,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64, + 0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65, + 0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x72,0x20,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,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,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x37,0x20, + 0x3d,0x20,0x69,0x6e,0x2e,0x73,0x74,0x64,0x5f,0x64,0x65,0x76,0x20,0x2f,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x28,0x69,0x6e,0x74,0x32,0x28,0x74,0x65,0x78,0x2e,0x67, + 0x65,0x74,0x5f,0x77,0x69,0x64,0x74,0x68,0x28,0x29,0x2c,0x20,0x74,0x65,0x78,0x2e, + 0x67,0x65,0x74,0x5f,0x68,0x65,0x69,0x67,0x68,0x74,0x28,0x29,0x29,0x29,0x2e,0x79, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x75,0x76,0x29,0x20,0x2a,0x20, + 0x5f,0x31,0x39,0x5b,0x30,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20, + 0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x31,0x3b,0x20,0x69,0x20,0x3c,0x20, + 0x37,0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x38,0x34, + 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x28,0x69,0x29,0x20,0x2a,0x20,0x5f,0x34,0x37,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x28,0x74,0x65,0x78,0x2e,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x75, + 0x76,0x20,0x2b,0x20,0x5f,0x38,0x34,0x29,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x5b, + 0x69,0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2b,0x3d,0x20,0x28, + 0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20, + 0x28,0x69,0x6e,0x2e,0x75,0x76,0x20,0x2d,0x20,0x5f,0x38,0x34,0x29,0x29,0x20,0x2a, + 0x20,0x5f,0x31,0x39,0x5b,0x69,0x5d,0x29,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, +}; +/* + #include + #include + + using namespace metal; + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float4 color [[user(locn1)]]; + }; + + fragment main0_out main0(main0_in in [[stage_in]]) + { + main0_out out = {}; + out.frag_color = in.color; + return out; + } + +*/ +static const uint8_t gui_filter_color_fs_source_metal_macos[315] = { + 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, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,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,0x34,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63, + 0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,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,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,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x69,0x6e,0x2e, + 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +}; +/* + #include + #include + + using namespace metal; + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 uv [[user(locn0)]]; + float4 color [[user(locn1)]]; + }; + + fragment main0_out main0(main0_in in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) + { + main0_out out = {}; + out.frag_color = tex.sample(smp, in.uv) * in.color; + return out; + } + +*/ +static const uint8_t gui_filter_texture_fs_source_metal_macos[436] = { + 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, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,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, + 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,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e, + 0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,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,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65, + 0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d, + 0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x73,0x6d,0x70,0x20,0x5b,0x5b, + 0x73,0x61,0x6d,0x70,0x6c,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,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78, + 0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e, + 0x75,0x76,0x29,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x00, +}; +static inline const sg_shader_desc* gui_blur_shader_desc(sg_backend backend) { + if (backend == SG_BACKEND_GLCORE) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].name = "position"; + desc.attrs[1].name = "texcoord0"; + desc.attrs[2].name = "color0"; + desc.attrs[3].name = "psize"; + desc.vs.source = (const char*)gui_shadow_vs_source_glsl410; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.vs.uniform_blocks[0].uniforms[0].name = "gui_shadow_vs_params"; + desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; + desc.vs.uniform_blocks[0].uniforms[0].array_count = 8; + desc.fs.source = (const char*)gui_blur_fs_source_glsl410; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp"; + desc.label = "gui_blur_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_D3D11) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].sem_name = "TEXCOORD"; + desc.attrs[0].sem_index = 0; + desc.attrs[1].sem_name = "TEXCOORD"; + desc.attrs[1].sem_index = 1; + desc.attrs[2].sem_name = "TEXCOORD"; + desc.attrs[2].sem_index = 2; + desc.attrs[3].sem_name = "TEXCOORD"; + desc.attrs[3].sem_index = 3; + desc.vs.source = (const char*)gui_shadow_vs_source_hlsl4; + desc.vs.d3d11_target = "vs_4_0"; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_blur_fs_source_hlsl4; + desc.fs.d3d11_target = "ps_4_0"; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_blur_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_METAL_MACOS) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.vs.source = (const char*)gui_shadow_vs_source_metal_macos; + desc.vs.entry = "main0"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_blur_fs_source_metal_macos; + desc.fs.entry = "main0"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_blur_shader"; + } + return &desc; + } + return 0; +} +static inline const sg_shader_desc* gui_filter_blur_h_shader_desc(sg_backend backend) { + if (backend == SG_BACKEND_GLCORE) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].name = "position"; + desc.attrs[1].name = "texcoord0"; + desc.attrs[2].name = "color0"; + desc.vs.source = (const char*)gui_filter_vs_source_glsl410; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.vs.uniform_blocks[0].uniforms[0].name = "gui_filter_vs_params"; + desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; + desc.vs.uniform_blocks[0].uniforms[0].array_count = 8; + desc.fs.source = (const char*)gui_filter_blur_h_fs_source_glsl410; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp"; + desc.label = "gui_filter_blur_h_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_D3D11) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].sem_name = "TEXCOORD"; + desc.attrs[0].sem_index = 0; + desc.attrs[1].sem_name = "TEXCOORD"; + desc.attrs[1].sem_index = 1; + desc.attrs[2].sem_name = "TEXCOORD"; + desc.attrs[2].sem_index = 2; + desc.vs.source = (const char*)gui_filter_vs_source_hlsl4; + desc.vs.d3d11_target = "vs_4_0"; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_filter_blur_h_fs_source_hlsl4; + desc.fs.d3d11_target = "ps_4_0"; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_filter_blur_h_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_METAL_MACOS) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.vs.source = (const char*)gui_filter_vs_source_metal_macos; + desc.vs.entry = "main0"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_filter_blur_h_fs_source_metal_macos; + desc.fs.entry = "main0"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_filter_blur_h_shader"; + } + return &desc; + } + return 0; +} +static inline const sg_shader_desc* gui_filter_blur_v_shader_desc(sg_backend backend) { + if (backend == SG_BACKEND_GLCORE) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].name = "position"; + desc.attrs[1].name = "texcoord0"; + desc.attrs[2].name = "color0"; + desc.vs.source = (const char*)gui_filter_vs_source_glsl410; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.vs.uniform_blocks[0].uniforms[0].name = "gui_filter_vs_params"; + desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; + desc.vs.uniform_blocks[0].uniforms[0].array_count = 8; + desc.fs.source = (const char*)gui_filter_blur_v_fs_source_glsl410; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp"; + desc.label = "gui_filter_blur_v_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_D3D11) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].sem_name = "TEXCOORD"; + desc.attrs[0].sem_index = 0; + desc.attrs[1].sem_name = "TEXCOORD"; + desc.attrs[1].sem_index = 1; + desc.attrs[2].sem_name = "TEXCOORD"; + desc.attrs[2].sem_index = 2; + desc.vs.source = (const char*)gui_filter_vs_source_hlsl4; + desc.vs.d3d11_target = "vs_4_0"; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_filter_blur_v_fs_source_hlsl4; + desc.fs.d3d11_target = "ps_4_0"; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_filter_blur_v_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_METAL_MACOS) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.vs.source = (const char*)gui_filter_vs_source_metal_macos; + desc.vs.entry = "main0"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_filter_blur_v_fs_source_metal_macos; + desc.fs.entry = "main0"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_filter_blur_v_shader"; + } + return &desc; + } + return 0; +} +static inline const sg_shader_desc* gui_filter_color_shader_desc(sg_backend backend) { + if (backend == SG_BACKEND_GLCORE) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].name = "position"; + desc.attrs[1].name = "texcoord0"; + desc.attrs[2].name = "color0"; + desc.vs.source = (const char*)gui_filter_vs_source_glsl410; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.vs.uniform_blocks[0].uniforms[0].name = "gui_filter_vs_params"; + desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; + desc.vs.uniform_blocks[0].uniforms[0].array_count = 8; + desc.fs.source = (const char*)gui_filter_color_fs_source_glsl410; + desc.fs.entry = "main"; + desc.label = "gui_filter_color_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_D3D11) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].sem_name = "TEXCOORD"; + desc.attrs[0].sem_index = 0; + desc.attrs[1].sem_name = "TEXCOORD"; + desc.attrs[1].sem_index = 1; + desc.attrs[2].sem_name = "TEXCOORD"; + desc.attrs[2].sem_index = 2; + desc.vs.source = (const char*)gui_filter_vs_source_hlsl4; + desc.vs.d3d11_target = "vs_4_0"; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_filter_color_fs_source_hlsl4; + desc.fs.d3d11_target = "ps_4_0"; + desc.fs.entry = "main"; + desc.label = "gui_filter_color_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_METAL_MACOS) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.vs.source = (const char*)gui_filter_vs_source_metal_macos; + desc.vs.entry = "main0"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_filter_color_fs_source_metal_macos; + desc.fs.entry = "main0"; + desc.label = "gui_filter_color_shader"; + } + return &desc; + } + return 0; +} +static inline const sg_shader_desc* gui_filter_texture_shader_desc(sg_backend backend) { + if (backend == SG_BACKEND_GLCORE) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].name = "position"; + desc.attrs[1].name = "texcoord0"; + desc.attrs[2].name = "color0"; + desc.attrs[3].name = "psize"; + desc.vs.source = (const char*)gui_filter_sgl_vs_source_glsl410; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.vs.uniform_blocks[0].uniforms[0].name = "gui_filter_sgl_vs_params"; + desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; + desc.vs.uniform_blocks[0].uniforms[0].array_count = 8; + desc.fs.source = (const char*)gui_filter_texture_fs_source_glsl410; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp"; + desc.label = "gui_filter_texture_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_D3D11) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].sem_name = "TEXCOORD"; + desc.attrs[0].sem_index = 0; + desc.attrs[1].sem_name = "TEXCOORD"; + desc.attrs[1].sem_index = 1; + desc.attrs[2].sem_name = "TEXCOORD"; + desc.attrs[2].sem_index = 2; + desc.attrs[3].sem_name = "TEXCOORD"; + desc.attrs[3].sem_index = 3; + desc.vs.source = (const char*)gui_filter_sgl_vs_source_hlsl4; + desc.vs.d3d11_target = "vs_4_0"; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_filter_texture_fs_source_hlsl4; + desc.fs.d3d11_target = "ps_4_0"; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_filter_texture_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_METAL_MACOS) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.vs.source = (const char*)gui_filter_sgl_vs_source_metal_macos; + desc.vs.entry = "main0"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_filter_texture_fs_source_metal_macos; + desc.fs.entry = "main0"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_filter_texture_shader"; + } + return &desc; + } + return 0; +} +static inline const sg_shader_desc* gui_gradient_shader_desc(sg_backend backend) { + if (backend == SG_BACKEND_GLCORE) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].name = "position"; + desc.attrs[1].name = "texcoord0"; + desc.attrs[2].name = "color0"; + desc.attrs[3].name = "psize"; + desc.vs.source = (const char*)gui_gradient_vs_source_glsl410; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.vs.uniform_blocks[0].uniforms[0].name = "gui_gradient_vs_params"; + desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; + desc.vs.uniform_blocks[0].uniforms[0].array_count = 8; + desc.fs.source = (const char*)gui_gradient_fs_source_glsl410; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp"; + desc.label = "gui_gradient_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_D3D11) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].sem_name = "TEXCOORD"; + desc.attrs[0].sem_index = 0; + desc.attrs[1].sem_name = "TEXCOORD"; + desc.attrs[1].sem_index = 1; + desc.attrs[2].sem_name = "TEXCOORD"; + desc.attrs[2].sem_index = 2; + desc.attrs[3].sem_name = "TEXCOORD"; + desc.attrs[3].sem_index = 3; + desc.vs.source = (const char*)gui_gradient_vs_source_hlsl4; + desc.vs.d3d11_target = "vs_4_0"; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_gradient_fs_source_hlsl4; + desc.fs.d3d11_target = "ps_4_0"; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_gradient_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_METAL_MACOS) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.vs.source = (const char*)gui_gradient_vs_source_metal_macos; + desc.vs.entry = "main0"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_gradient_fs_source_metal_macos; + desc.fs.entry = "main0"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_gradient_shader"; + } + return &desc; + } + return 0; +} +static inline const sg_shader_desc* gui_image_clip_shader_desc(sg_backend backend) { + if (backend == SG_BACKEND_GLCORE) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].name = "position"; + desc.attrs[1].name = "texcoord0"; + desc.attrs[2].name = "color0"; + desc.attrs[3].name = "psize"; + desc.vs.source = (const char*)gui_rect_vs_source_glsl410; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.vs.uniform_blocks[0].uniforms[0].name = "gui_rect_vs_params"; + desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; + desc.vs.uniform_blocks[0].uniforms[0].array_count = 8; + desc.fs.source = (const char*)gui_image_clip_fs_source_glsl410; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp"; + desc.label = "gui_image_clip_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_D3D11) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].sem_name = "TEXCOORD"; + desc.attrs[0].sem_index = 0; + desc.attrs[1].sem_name = "TEXCOORD"; + desc.attrs[1].sem_index = 1; + desc.attrs[2].sem_name = "TEXCOORD"; + desc.attrs[2].sem_index = 2; + desc.attrs[3].sem_name = "TEXCOORD"; + desc.attrs[3].sem_index = 3; + desc.vs.source = (const char*)gui_rect_vs_source_hlsl4; + desc.vs.d3d11_target = "vs_4_0"; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_image_clip_fs_source_hlsl4; + desc.fs.d3d11_target = "ps_4_0"; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_image_clip_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_METAL_MACOS) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.vs.source = (const char*)gui_rect_vs_source_metal_macos; + desc.vs.entry = "main0"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_image_clip_fs_source_metal_macos; + desc.fs.entry = "main0"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_image_clip_shader"; + } + return &desc; + } + return 0; +} +static inline const sg_shader_desc* gui_rounded_rect_shader_desc(sg_backend backend) { + if (backend == SG_BACKEND_GLCORE) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].name = "position"; + desc.attrs[1].name = "texcoord0"; + desc.attrs[2].name = "color0"; + desc.attrs[3].name = "psize"; + desc.vs.source = (const char*)gui_rect_vs_source_glsl410; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.vs.uniform_blocks[0].uniforms[0].name = "gui_rect_vs_params"; + desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; + desc.vs.uniform_blocks[0].uniforms[0].array_count = 8; + desc.fs.source = (const char*)gui_rounded_rect_fs_source_glsl410; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp"; + desc.label = "gui_rounded_rect_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_D3D11) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].sem_name = "TEXCOORD"; + desc.attrs[0].sem_index = 0; + desc.attrs[1].sem_name = "TEXCOORD"; + desc.attrs[1].sem_index = 1; + desc.attrs[2].sem_name = "TEXCOORD"; + desc.attrs[2].sem_index = 2; + desc.attrs[3].sem_name = "TEXCOORD"; + desc.attrs[3].sem_index = 3; + desc.vs.source = (const char*)gui_rect_vs_source_hlsl4; + desc.vs.d3d11_target = "vs_4_0"; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_rounded_rect_fs_source_hlsl4; + desc.fs.d3d11_target = "ps_4_0"; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_rounded_rect_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_METAL_MACOS) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.vs.source = (const char*)gui_rect_vs_source_metal_macos; + desc.vs.entry = "main0"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_rounded_rect_fs_source_metal_macos; + desc.fs.entry = "main0"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_rounded_rect_shader"; + } + return &desc; + } + return 0; +} +static inline const sg_shader_desc* gui_shadow_shader_desc(sg_backend backend) { + if (backend == SG_BACKEND_GLCORE) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].name = "position"; + desc.attrs[1].name = "texcoord0"; + desc.attrs[2].name = "color0"; + desc.attrs[3].name = "psize"; + desc.vs.source = (const char*)gui_shadow_vs_source_glsl410; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.vs.uniform_blocks[0].uniforms[0].name = "gui_shadow_vs_params"; + desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; + desc.vs.uniform_blocks[0].uniforms[0].array_count = 8; + desc.fs.source = (const char*)gui_shadow_fs_source_glsl410; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp"; + desc.label = "gui_shadow_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_D3D11) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.attrs[0].sem_name = "TEXCOORD"; + desc.attrs[0].sem_index = 0; + desc.attrs[1].sem_name = "TEXCOORD"; + desc.attrs[1].sem_index = 1; + desc.attrs[2].sem_name = "TEXCOORD"; + desc.attrs[2].sem_index = 2; + desc.attrs[3].sem_name = "TEXCOORD"; + desc.attrs[3].sem_index = 3; + desc.vs.source = (const char*)gui_shadow_vs_source_hlsl4; + desc.vs.d3d11_target = "vs_4_0"; + desc.vs.entry = "main"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_shadow_fs_source_hlsl4; + desc.fs.d3d11_target = "ps_4_0"; + desc.fs.entry = "main"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_shadow_shader"; + } + return &desc; + } + if (backend == SG_BACKEND_METAL_MACOS) { + static sg_shader_desc desc; + static bool valid; + if (!valid) { + valid = true; + desc.vs.source = (const char*)gui_shadow_vs_source_metal_macos; + desc.vs.entry = "main0"; + desc.vs.uniform_blocks[0].size = 128; + desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; + desc.fs.source = (const char*)gui_shadow_fs_source_metal_macos; + desc.fs.entry = "main0"; + desc.fs.images[0].used = true; + desc.fs.images[0].multisampled = false; + desc.fs.images[0].image_type = SG_IMAGETYPE_2D; + desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; + desc.fs.samplers[0].used = true; + desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; + desc.fs.image_sampler_pairs[0].used = true; + desc.fs.image_sampler_pairs[0].image_slot = 0; + desc.fs.image_sampler_pairs[0].sampler_slot = 0; + desc.label = "gui_shadow_shader"; + } + return &desc; + } + return 0; +} diff --git a/shaders_generated.c.v b/shaders_generated.c.v new file mode 100644 index 0000000..f2da693 --- /dev/null +++ b/shaders_generated.c.v @@ -0,0 +1,15 @@ +module gui + +import sokol.gfx + +#include "@VMODROOT/shaders/gui_builtin.h" + +fn C.gui_rounded_rect_shader_desc(gfx.Backend) &gfx.ShaderDesc +fn C.gui_shadow_shader_desc(gfx.Backend) &gfx.ShaderDesc +fn C.gui_blur_shader_desc(gfx.Backend) &gfx.ShaderDesc +fn C.gui_gradient_shader_desc(gfx.Backend) &gfx.ShaderDesc +fn C.gui_image_clip_shader_desc(gfx.Backend) &gfx.ShaderDesc +fn C.gui_filter_blur_h_shader_desc(gfx.Backend) &gfx.ShaderDesc +fn C.gui_filter_blur_v_shader_desc(gfx.Backend) &gfx.ShaderDesc +fn C.gui_filter_color_shader_desc(gfx.Backend) &gfx.ShaderDesc +fn C.gui_filter_texture_shader_desc(gfx.Backend) &gfx.ShaderDesc diff --git a/shaders_glsl.v b/shaders_glsl.v index 88bbee4..ce4d6e2 100644 --- a/shaders_glsl.v +++ b/shaders_glsl.v @@ -1,330 +1,6 @@ module gui -// --- GLSL Shader Sources (OpenGL 3.3) --- - -const vs_glsl = ' - #version 330 - layout(location=0) in vec3 position; - layout(location=1) in vec2 texcoord0; - layout(location=2) in vec4 color0; - - uniform mat4 mvp; - - out vec2 uv; - out vec4 color; - out float params; // z stores packed radius and thickness - - void main() { - gl_Position = mvp * vec4(position.xy, 0.0, 1.0); - uv = texcoord0; - color = color0; - // Pass unpacked z-coordinate as "params" to fragment shader. - // Rasterizer will interpolate this, but since it is constant per quad, - // it acts as a flat uniform per-primitive. - params = position.z; - } -' - -const fs_glsl = ' - #version 330 - uniform sampler2D tex; - in vec2 uv; - in vec4 color; - in float params; - - out vec4 frag_color; - - void main() { - // Unpack 12-bit fixed-point radius/thickness (quarter-pixel precision). - float radius = floor(params / 4096.0) / 4.0; - float thickness = mod(params, 4096.0) / 4.0; - - // UV and Pixel Conversion - // fwidth() calculates the rate of change of the UV coordinates relative to screen pixels. - // fwidth(uv.x) gives the change in u per horizontal pixel step. - // Inverse of this value yields the number of pixels per UV unit. - vec2 uv_to_px = 1.0 / (vec2(fwidth(uv.x), fwidth(uv.y)) + 1e-6); - vec2 half_size = uv_to_px; // Since UV is -1..1, the total size is 2.0 UV units. half-size in UV = 1.0. 1.0 UV * uv_to_px = half size in pixels. - vec2 pos = uv * half_size; // Map current UV to pixel coordinates relative to center (0,0). - - // SDF (Signed Distance Field) Calculation for Rounded Box - // q calculates the vector from the corner "core" (inner rectangle for the rounded corners). - // abs(pos) folds all 4 quadrants into one. - // - half_size + radius: shifts origin to the corner center. - vec2 q = abs(pos) - half_size + vec2(radius); - - // d is the distance to the rounded edge. - // length(max(q, 0.0)): Distance from the corner center to the query point (for outside corner). - // min(max(q.x, q.y), 0.0): inner distance correction. - // - radius: Subtract radius to get surface distance. - float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; - - if (thickness > 0.0) { - d = abs(d + thickness * 0.5) - thickness * 0.5; - } - - // Normalize by gradient length for uniform anti-aliasing - float grad_len = length(vec2(dFdx(d), dFdy(d))); - d = d / max(grad_len, 0.001); - float alpha = 1.0 - smoothstep(-0.59, 0.59, d); - frag_color = vec4(color.rgb, color.a * alpha); - - // sgl workaround: dummy texture sample - // sgl.h always binds a texture/sampler, so we must declare them to avoid validation errors. - // We use a condition that is always false (alpha < 0.0) to ensure the sample is never - // actually executed while preventing the compiler from optimizing away the bindings. - if (frag_color.a < 0.0) { - frag_color += texture(tex, uv); - } - } -' - -const vs_shadow_glsl = ' - #version 330 - layout(location=0) in vec3 position; - layout(location=1) in vec2 texcoord0; - layout(location=2) in vec4 color0; - - uniform mat4 mvp; - uniform mat4 tm; // Texture matrix - - out vec2 uv; - out vec4 color; - out float params; // z stores packed radius and blur - out vec2 offset; - - void main() { - gl_Position = mvp * vec4(position.xy, 0.0, 1.0); - uv = texcoord0; - color = color0; - params = position.z; - offset = (tm * vec4(0,0,0,1)).xy; // Extract translation - } -' - -const fs_shadow_glsl = ' - #version 330 - uniform sampler2D tex; - in vec2 uv; - in vec4 color; - in float params; - in vec2 offset; - - out vec4 frag_color; - - void main() { - float radius = floor(params / 4096.0) / 4.0; - float blur = mod(params, 4096.0) / 4.0; - - vec2 uv_to_px = 1.0 / (vec2(fwidth(uv.x), fwidth(uv.y)) + 1e-6); - vec2 half_size = uv_to_px; - vec2 pos = uv * half_size; - - // SDF for rounded box - vec2 q = abs(pos) - half_size + vec2(radius + 1.5 * blur); - float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; - - // SDF for casting box (using offset) - vec2 q_c = abs(pos + offset) - half_size + vec2(radius + 1.5 * blur); - float d_c = length(max(q_c, 0.0)) + min(max(q_c.x, q_c.y), 0.0) - radius; - - // Shadow logic: - // alpha_falloff: Smooth transition from 0 (inside) to blur radius (outside). - // Inverted (1.0 - ...) so opacity is 1 inside the shadow and 0 outside. - float alpha_falloff = 1.0 - smoothstep(0.0, max(1.0, blur), d); - - // alpha_clip: The shadow should not be visible *under* the casting object. - // d_c < 0 means the fragment is inside the casting box. - // Shadow fades out where d_c < 0 (inside casting box). - float alpha_clip = smoothstep(-1.0, 0.0, d_c); // Hard fade at casting edge - - float alpha = alpha_falloff * alpha_clip; - - frag_color = vec4(color.rgb, color.a * alpha); - - if (frag_color.a < 0.0) { - frag_color += texture(tex, uv); - } - } -' - -const fs_blur_glsl = ' - #version 330 - uniform sampler2D tex; - in vec2 uv; - in vec4 color; - in float params; - in vec2 offset; - - out vec4 frag_color; - - void main() { - float radius = floor(params / 4096.0) / 4.0; - float blur = mod(params, 4096.0) / 4.0; - - vec2 uv_to_px = 1.0 / (vec2(fwidth(uv.x), fwidth(uv.y)) + 1e-6); - vec2 half_size = uv_to_px; - vec2 pos = uv * half_size; - - vec2 q = abs(pos) - half_size + vec2(radius + 1.5 * blur); - float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; - - float alpha = 1.0 - smoothstep(-blur, blur, d); - - frag_color = vec4(color.rgb, color.a * alpha); - - if (frag_color.a < 0.0) { - frag_color += texture(tex, uv); - } - } -' - -const vs_gradient_glsl = ' - #version 330 - layout(location=0) in vec3 position; - layout(location=1) in vec2 texcoord0; - layout(location=2) in vec4 color0; - - uniform mat4 mvp; - uniform mat4 tm; - - out vec2 uv; - out vec4 color; - out float params; - out vec4 stop12; - out vec4 stop34; - out vec4 stop56; - out vec4 meta; - - void main() { - gl_Position = mvp * vec4(position.xy, 0.0, 1.0); - uv = texcoord0; - color = color0; - params = position.z; - stop12 = tm[0]; - stop34 = tm[1]; - stop56 = tm[2]; - meta = tm[3]; - } -' - -const fs_gradient_glsl = ' - #version 330 - uniform sampler2D tex; - in vec2 uv; - in vec4 color; - in float params; - in vec4 stop12; - in vec4 stop34; - in vec4 stop56; - in vec4 meta; - - out vec4 frag_color; - - float random(vec2 coords) { - return fract(sin(dot(coords.xy, vec2(12.9898,78.233))) * 43758.5453); - } - - void unpack_gradient_data(float val1, float val2, out vec4 c, out float p) { - float r = mod(val1, 256.0); - float g = mod(floor(val1 / 256.0), 256.0); - float b = floor(val1 / 65536.0); - - float a = mod(val2, 256.0); - p = floor(val2 / 256.0) / 10000.0; - - c = vec4(r/255.0, g/255.0, b/255.0, a/255.0); - } - - void main() { - float radius = floor(params / 4096.0) / 4.0; - - // Metadata extraction - float hw = meta.x; - float hh = meta.y; - float grad_type = meta.z; - int stop_count = int(meta.w); - - // Pixel-based position from UV - vec2 pos = uv * vec2(hw, hh); - - // SDF clipping for rounded rect (using passed dimensions) - vec2 q = abs(pos) - vec2(hw, hh) + vec2(radius); - float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; - - // Anti-aliasing (d is already in pixel units) - float sdf_alpha = 1.0 - smoothstep(-0.5, 0.5, d); - - // Unified gradient t calculation - float t; - if (grad_type > 0.5) { - float target_radius = stop56.w; // Packed in tm_data[11] - t = length(pos) / target_radius; - } else { - vec2 stop_dir = vec2(stop56.z, stop56.w); // tm_data[10, 11] - t = dot(uv, stop_dir) * 0.5 + 0.5; - } - t = clamp(t, 0.0, 1.0); - - // Unpack stops (up to 5 fully supported with metadata packing) - vec4 stop_colors[6]; - float stop_positions[6]; - - unpack_gradient_data(stop12.x, stop12.y, stop_colors[0], stop_positions[0]); - unpack_gradient_data(stop12.z, stop12.w, stop_colors[1], stop_positions[1]); - unpack_gradient_data(stop34.x, stop34.y, stop_colors[2], stop_positions[2]); - unpack_gradient_data(stop34.z, stop34.w, stop_colors[3], stop_positions[3]); - unpack_gradient_data(stop56.x, stop56.y, stop_colors[4], stop_positions[4]); - // Stop 6 slot partially used for metadata, but we only have 5 stops in demo - stop_colors[5] = stop_colors[4]; stop_positions[5] = stop_positions[4]; - - // Multi-stop interpolation loop - vec4 c1 = stop_colors[0]; - vec4 c2 = c1; - float p1 = stop_positions[0]; - float p2 = p1; - - for (int i = 1; i < 6; i++) { - if (i >= stop_count) break; - if (t <= stop_positions[i]) { - c2 = stop_colors[i]; - p2 = stop_positions[i]; - c1 = stop_colors[i-1]; - p1 = stop_positions[i-1]; - break; - } - if (i == stop_count - 1) { - c1 = stop_colors[i]; - c2 = c1; - p1 = stop_positions[i]; - p2 = p1; - } - } - - float local_t = (t - p1) / max(p2 - p1, 0.0001); - - // Premultiplied alpha interpolation (CSS spec) - vec3 c1_pre = c1.rgb * c1.a; - vec3 c2_pre = c2.rgb * c2.a; - vec3 rgb_pre = mix(c1_pre, c2_pre, local_t); - float alpha = mix(c1.a, c2.a, local_t); - vec3 rgb = rgb_pre / max(alpha, 0.0001); - vec4 gradient_color = vec4(rgb, alpha); - - // Add dithering to prevent color banding - float dither = (random(gl_FragCoord.xy) - 0.5) / 255.0; - gradient_color.rgb += vec3(dither); - - // Combine gradient with SDF clipping and vertex opacity - frag_color = vec4(gradient_color.rgb, gradient_color.a * sdf_alpha * color.a); - - // sgl workaround: dummy texture sample - if (frag_color.a < 0.0) { - frag_color += texture(tex, uv); - } - } -' - +// GLSL vertex source used by the runtime custom Shader API. const vs_custom_glsl = ' #version 330 layout(location=0) in vec3 position; @@ -353,136 +29,3 @@ const vs_custom_glsl = ' p3 = tm[3]; } ' - -// --- Offscreen Gaussian blur shaders for SVG filters --- - -const vs_filter_blur_glsl = ' - #version 330 - layout(location=0) in vec3 position; - layout(location=1) in vec2 texcoord0; - layout(location=2) in vec4 color0; - - uniform mat4 mvp; - uniform mat4 tm; - - out vec2 uv; - out vec4 color; - out float std_dev; - - void main() { - gl_Position = mvp * vec4(position.xy, 0.0, 1.0); - uv = texcoord0; - color = color0; - std_dev = tm[0][0]; - } -' - -const fs_filter_blur_h_glsl = ' - #version 330 - uniform sampler2D tex_smp; - in vec2 uv; - in vec4 color; - in float std_dev; - - out vec4 frag_color; - - void main() { - // Normalized Gaussian weights for sigma=1, 13 taps - float w[7] = float[7](0.19947, 0.17603, 0.12098, 0.06476, 0.02700, 0.00877, 0.00222); - vec2 tex_size = vec2(textureSize(tex_smp, 0)); - float step_size = std_dev / tex_size.x; - - frag_color = texture(tex_smp, uv) * w[0]; - for (int i = 1; i < 7; i++) { - float off = float(i) * step_size; - frag_color += texture(tex_smp, uv + vec2(off, 0.0)) * w[i]; - frag_color += texture(tex_smp, uv - vec2(off, 0.0)) * w[i]; - } - } -' - -const fs_filter_blur_v_glsl = ' - #version 330 - uniform sampler2D tex_smp; - in vec2 uv; - in vec4 color; - in float std_dev; - - out vec4 frag_color; - - void main() { - float w[7] = float[7](0.19947, 0.17603, 0.12098, 0.06476, 0.02700, 0.00877, 0.00222); - vec2 tex_size = vec2(textureSize(tex_smp, 0)); - float step_size = std_dev / tex_size.y; - - frag_color = texture(tex_smp, uv) * w[0]; - for (int i = 1; i < 7; i++) { - float off = float(i) * step_size; - frag_color += texture(tex_smp, uv + vec2(0.0, off)) * w[i]; - frag_color += texture(tex_smp, uv - vec2(0.0, off)) * w[i]; - } - } -' - -// Color pass-through for offscreen content (no texture). -const fs_filter_color_glsl = ' - #version 330 - in vec2 uv; - in vec4 color; - in float std_dev; - - out vec4 frag_color; - - void main() { - frag_color = color; - } -' - -// Image clip fragment shader: samples texture and applies SDF -// rounded-rect alpha mask. UV is -1..1 (from draw_quad), same -// as rounded_rect. Texture sampled at remapped 0..1 coords. -const fs_image_clip_glsl = ' - #version 330 - uniform sampler2D tex; - in vec2 uv; - in vec4 color; - in float params; - - out vec4 frag_color; - - void main() { - float radius = floor(params / 4096.0) / 4.0; - - // SDF rounded rect — identical to rounded_rect shader - // (UVs are -1..1 from draw_quad) - vec2 uv_to_px = 1.0 / (vec2(fwidth(uv.x), fwidth(uv.y)) + 1e-6); - vec2 half_size = uv_to_px; - vec2 pos = uv * half_size; - - vec2 q = abs(pos) - half_size + vec2(radius); - float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; - - float grad_len = length(vec2(dFdx(d), dFdy(d))); - d = d / max(grad_len, 0.001); - float alpha = 1.0 - smoothstep(-0.59, 0.59, d); - - // Remap -1..1 to 0..1 for texture sampling - vec2 tex_uv = uv * 0.5 + 0.5; - vec4 tex_color = texture(tex, tex_uv); - frag_color = vec4(tex_color.rgb, tex_color.a * alpha); - } -' - -const fs_filter_texture_glsl = ' - #version 330 - uniform sampler2D tex_smp; - in vec2 uv; - in vec4 color; - in float std_dev; - - out vec4 frag_color; - - void main() { - frag_color = texture(tex_smp, uv) * color; - } -' diff --git a/shaders_metal.v b/shaders_metal.v index 0326a2b..35bc421 100644 --- a/shaders_metal.v +++ b/shaders_metal.v @@ -1,370 +1,6 @@ module gui -// --- Metal Shader Sources (MSL) --- - -const vs_metal = ' -#include -using namespace metal; - -struct VertexIn { - float3 position [[attribute(0)]]; - float2 texcoord0 [[attribute(1)]]; - float4 color0 [[attribute(2)]]; -}; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float params; -}; - -struct Uniforms { - float4x4 mvp; - float4x4 tm; -}; - - -vertex VertexOut vs_main(VertexIn in [[stage_in]], constant Uniforms &uniforms [[buffer(0)]]) { - VertexOut out; - out.position = uniforms.mvp * float4(in.position.xy, 0.0, 1.0); - out.uv = in.texcoord0; - out.color = in.color0; - out.params = in.position.z; - return out; -} -' - -const fs_metal = ' -#include -using namespace metal; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float params; -}; - -fragment float4 fs_main(VertexOut in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) { - // Unpack 12-bit fixed-point radius/thickness (quarter-pixel precision). - float radius = floor(in.params / 4096.0) / 4.0; - float thickness = fmod(in.params, 4096.0) / 4.0; - - // Pixel-independent coordinate system: - // fwidth gives the change in texture coordinates per pixel. - // Inverse of this gives pixels per texture coordinate unit. - float2 width_inv = float2(fwidth(in.uv.x), fwidth(in.uv.y)); - float2 half_size = 1.0 / (width_inv + 1e-6); - float2 pos = in.uv * half_size; - - // SDF Calculation: - // Calculate distance to the rounded box boundary. - float2 q = abs(pos) - half_size + float2(radius); - float2 max_q = max(q, float2(0.0)); - float d = length(max_q) + min(max(q.x, q.y), 0.0) - radius; - - if (thickness > 0.0) { - d = abs(d + thickness * 0.5) - thickness * 0.5; - } - - // Normalize by gradient length for uniform anti-aliasing - float grad_len = length(float2(dfdx(d), dfdy(d))); - d = d / max(grad_len, 0.001); - float alpha = 1.0 - smoothstep(-0.59, 0.59, d); - float4 frag_color = float4(in.color.rgb, in.color.a * alpha); - - // sgl workaround: dummy texture sample - // sgl.h always binds a texture/sampler, so we must declare them to avoid validation errors. - // We use a condition that is always false (alpha < 0.0) to ensure the sample is never - // actually executed while preventing the compiler from optimizing away the bindings. - if (frag_color.a < 0.0) { - frag_color += tex.sample(smp, in.uv); - } - return frag_color; -} -' - -const vs_shadow_metal = ' -#include -using namespace metal; - -struct VertexIn { - float3 position [[attribute(0)]]; - float2 texcoord0 [[attribute(1)]]; - float4 color0 [[attribute(2)]]; -}; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float params; - float2 offset; -}; - -struct Uniforms { - float4x4 mvp; - float4x4 tm; -}; - - -vertex VertexOut vs_main(VertexIn in [[stage_in]], constant Uniforms &uniforms [[buffer(0)]]) { - VertexOut out; - out.position = uniforms.mvp * float4(in.position.xy, 0.0, 1.0); - out.uv = in.texcoord0; - out.color = in.color0; - out.params = in.position.z; - out.offset = uniforms.tm[3].xy; - return out; -} -' - -const fs_shadow_metal = ' -#include -using namespace metal; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float params; - float2 offset; -}; - -fragment float4 fs_main(VertexOut in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) { - float radius = floor(in.params / 4096.0) / 4.0; - float blur = fmod(in.params, 4096.0) / 4.0; - - float2 width_inv = float2(fwidth(in.uv.x), fwidth(in.uv.y)); - float2 half_size = 1.0 / (width_inv + 1e-6); - float2 pos = in.uv * half_size; - - // SDF for rounded box - // q: Distance vector from the "corner center" - float2 q = abs(pos) - half_size + float2(radius + 1.5 * blur); - float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; - - // Casting box SDF (clipped shadow region): - // The casting box is offset by `in.offset` relative to the shadow. - // This computation masks out the shadow that lies BENEATH the object casting it. - float2 q_c = abs(pos + in.offset) - half_size + float2(radius + 1.5 * blur); - float d_c = length(max(q_c, 0.0)) + min(max(q_c.x, q_c.y), 0.0) - radius; - - // Shadow logic: - // Clip inner shadow (d < 0) regarding casting box to prevent bleeding. - float alpha_falloff = 1.0 - smoothstep(0.0, max(1.0, blur), d); - float alpha_clip = smoothstep(-1.0, 0.0, d_c); // Hard fade at casting edge - - float alpha = alpha_falloff * alpha_clip; - - float4 frag_color = float4(in.color.rgb, in.color.a * alpha); - - if (frag_color.a < 0.0) { - frag_color += tex.sample(smp, in.uv); - } - return frag_color; -} -' - -const fs_blur_metal = ' -#include -using namespace metal; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float params; - float2 offset; -}; - -fragment float4 fs_main(VertexOut in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) { - float radius = floor(in.params / 4096.0) / 4.0; - float blur = fmod(in.params, 4096.0) / 4.0; - - float2 width_inv = float2(fwidth(in.uv.x), fwidth(in.uv.y)); - float2 half_size = 1.0 / (width_inv + 1e-6); - float2 pos = in.uv * half_size; - - // SDF for rounded box - float2 q = abs(pos) - half_size + float2(radius + 1.5 * blur); - float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; - - float alpha = 1.0 - smoothstep(-blur, blur, d); - - float4 frag_color = float4(in.color.rgb, in.color.a * alpha); - - if (frag_color.a < 0.0) { - frag_color += tex.sample(smp, in.uv); - } - return frag_color; -} -' - -const vs_gradient_metal = ' -#include -using namespace metal; - -struct VertexIn { - float3 position [[attribute(0)]]; - float2 texcoord0 [[attribute(1)]]; - float4 color0 [[attribute(2)]]; -}; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float params; - float4 stop12; - float4 stop34; - float4 stop56; - float4 meta; -}; - -struct Uniforms { - float4x4 mvp; - float4x4 tm; -}; - - -vertex VertexOut vs_main(VertexIn in [[stage_in]], constant Uniforms &uniforms [[buffer(0)]]) { - VertexOut out; - out.position = uniforms.mvp * float4(in.position.xy, 0.0, 1.0); - out.uv = in.texcoord0; - out.color = in.color0; - out.params = in.position.z; - // Pass packed gradient data to FS via varyings - out.stop12 = uniforms.tm[0]; - out.stop34 = uniforms.tm[1]; - out.stop56 = uniforms.tm[2]; - out.meta = uniforms.tm[3]; - return out; -} -' - -const fs_gradient_metal = ' -#include -using namespace metal; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float params; - float4 stop12; - float4 stop34; - float4 stop56; - float4 meta; -}; - -float random(float2 coords) { - return fract(sin(dot(coords, float2(12.9898, 78.233))) * 43758.5453); -} - -void unpack_gradient_data(float val1, float val2, thread float4& c, thread float& p) { - float r = fmod(val1, 256.0); - float g = fmod(floor(val1 / 256.0), 256.0); - float b = floor(val1 / 65536.0); - - float a = fmod(val2, 256.0); - p = floor(val2 / 256.0) / 10000.0; - - c = float4(r/255.0, g/255.0, b/255.0, a/255.0); -} - -fragment float4 fs_main(VertexOut in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) { - float radius = floor(in.params / 4096.0) / 4.0; - - // Metadata extraction - float hw = in.meta.x; - float hh = in.meta.y; - float grad_type = in.meta.z; - int stop_count = int(in.meta.w); - - // Pixel-based position from UV - float2 pos = in.uv * float2(hw, hh); - - // SDF clipping for rounded rect (using passed dimensions) - float2 q = abs(pos) - float2(hw, hh) + float2(radius); - float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; - - float grad_len = length(float2(dfdx(d), dfdy(d))); - d = d / max(grad_len, 0.001); - float sdf_alpha = 1.0 - smoothstep(-0.59, 0.59, d); - - // Unified gradient t calculation - float t; - if (grad_type > 0.5) { - float target_radius = in.stop56.w; // Packed in tm_data[11] - t = length(pos) / target_radius; - } else { - float2 stop_dir = float2(in.stop56.z, in.stop56.w); // tm_data[10, 11] - t = dot(in.uv, stop_dir) * 0.5 + 0.5; - } - t = clamp(t, 0.0, 1.0); - - // Unpack stops (up to 5 fully supported with metadata packing) - float4 stop_colors[6]; - float stop_positions[6]; - - unpack_gradient_data(in.stop12.x, in.stop12.y, stop_colors[0], stop_positions[0]); - unpack_gradient_data(in.stop12.z, in.stop12.w, stop_colors[1], stop_positions[1]); - unpack_gradient_data(in.stop34.x, in.stop34.y, stop_colors[2], stop_positions[2]); - unpack_gradient_data(in.stop34.z, in.stop34.w, stop_colors[3], stop_positions[3]); - unpack_gradient_data(in.stop56.x, in.stop56.y, stop_colors[4], stop_positions[4]); - // Stop 6 slot partially used for metadata - stop_colors[5] = stop_colors[4]; stop_positions[5] = stop_positions[4]; - - // Multi-stop interpolation loop - float4 c1 = stop_colors[0]; - float4 c2 = c1; - float p1 = stop_positions[0]; - float p2 = p1; - - for (int i = 1; i < 6; i++) { - if (i >= stop_count) break; - if (t <= stop_positions[i]) { - c2 = stop_colors[i]; - p2 = stop_positions[i]; - c1 = stop_colors[i-1]; - p1 = stop_positions[i-1]; - break; - } - if (i == stop_count - 1) { - c1 = stop_colors[i]; - c2 = c1; - p1 = stop_positions[i]; - p2 = p1; - } - } - - float local_t = (t - p1) / max(p2 - p1, 0.0001f); - - // Premultiplied alpha interpolation (CSS spec) - float3 c1_pre = c1.rgb * c1.a; - float3 c2_pre = c2.rgb * c2.a; - float3 rgb_pre = mix(c1_pre, c2_pre, local_t); - float alpha = mix(c1.a, c2.a, local_t); - float3 rgb = rgb_pre / max(alpha, 0.0001f); - float4 gradient_color = float4(rgb, alpha); - - // Add dithering to prevent color banding - float dither = (random(in.position.xy) - 0.5) / 255.0; - gradient_color.rgb += float3(dither); - - // Combine gradient with SDF clipping and vertex opacity - float4 frag_color = float4(gradient_color.rgb, gradient_color.a * sdf_alpha * in.color.a); - - // sgl workaround: dummy texture sample - if (frag_color.a < 0.0) { - frag_color += tex.sample(smp, in.uv); - } - return frag_color; -} -' - +// Metal vertex source used by the runtime custom Shader API. const vs_custom_metal = ' #include using namespace metal; @@ -405,165 +41,3 @@ vertex VertexOut vs_main(VertexIn in [[stage_in]], constant Uniforms &uniforms [ return out; } ' - -// --- Offscreen Gaussian blur shaders for SVG filters --- - -// Passthrough vertex shader for texture-based blur passes. -// UVs map 0..1 for texture sampling. tm[0][0] carries stdDeviation. -const vs_filter_blur_metal = ' -#include -using namespace metal; - -struct VertexIn { - float3 position [[attribute(0)]]; - float2 texcoord0 [[attribute(1)]]; - float4 color0 [[attribute(2)]]; -}; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float std_dev; -}; - -struct Uniforms { - float4x4 mvp; - float4x4 tm; -}; - -vertex VertexOut vs_main(VertexIn in [[stage_in]], constant Uniforms &uniforms [[buffer(0)]]) { - VertexOut out; - out.position = uniforms.mvp * float4(in.position.xy, 0.0, 1.0); - out.uv = in.texcoord0; - out.color = in.color0; - out.std_dev = uniforms.tm[0][0]; - return out; -} -' - -// 13-tap horizontal Gaussian blur fragment shader. -// Weights precomputed for sigma=1, scaled by stdDeviation via step size. -const fs_filter_blur_h_metal = ' -#include -using namespace metal; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float std_dev; -}; - -fragment float4 fs_main(VertexOut in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) { - // Normalized Gaussian weights for sigma=1, 13 taps - const float w[7] = { 0.19947, 0.17603, 0.12098, 0.06476, 0.02700, 0.00877, 0.00222 }; - float step = in.std_dev / float(tex.get_width()); - - float4 c = tex.sample(smp, in.uv) * w[0]; - for (int i = 1; i < 7; i++) { - float off = float(i) * step; - c += tex.sample(smp, in.uv + float2(off, 0.0)) * w[i]; - c += tex.sample(smp, in.uv - float2(off, 0.0)) * w[i]; - } - return c; -} -' - -// 13-tap vertical Gaussian blur fragment shader. -const fs_filter_blur_v_metal = ' -#include -using namespace metal; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float std_dev; -}; - -fragment float4 fs_main(VertexOut in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) { - const float w[7] = { 0.19947, 0.17603, 0.12098, 0.06476, 0.02700, 0.00877, 0.00222 }; - float step = in.std_dev / float(tex.get_height()); - - float4 c = tex.sample(smp, in.uv) * w[0]; - for (int i = 1; i < 7; i++) { - float off = float(i) * step; - c += tex.sample(smp, in.uv + float2(0.0, off)) * w[i]; - c += tex.sample(smp, in.uv - float2(0.0, off)) * w[i]; - } - return c; -} -' - -// Simple color pass-through shader for rendering SVG content -// to offscreen texture (no texture sampling). -const fs_filter_color_metal = ' -#include -using namespace metal; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float std_dev; -}; - -fragment float4 fs_main(VertexOut in [[stage_in]]) { - return in.color; -} -' - -// Image clip fragment shader (Metal): samples texture and applies -// SDF rounded-rect alpha mask. UV is -1..1 (from draw_quad), -// same as rounded_rect. Texture sampled at remapped 0..1 coords. -const fs_image_clip_metal = ' -#include -using namespace metal; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float params; -}; - -fragment float4 fs_main(VertexOut in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) { - float radius = floor(in.params / 4096.0) / 4.0; - - // SDF rounded rect — identical to rounded_rect shader - // (UVs are -1..1 from draw_quad) - float2 width_inv = float2(fwidth(in.uv.x), fwidth(in.uv.y)); - float2 half_size = 1.0 / (width_inv + 1e-6); - float2 pos = in.uv * half_size; - - float2 q = abs(pos) - half_size + float2(radius); - float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; - - float grad_len = length(float2(dfdx(d), dfdy(d))); - d = d / max(grad_len, 0.001); - float alpha = 1.0 - smoothstep(-0.59, 0.59, d); - - // Remap -1..1 to 0..1 for texture sampling - float2 tex_uv = in.uv * 0.5 + 0.5; - float4 tex_color = tex.sample(smp, tex_uv); - return float4(tex_color.rgb, tex_color.a * alpha); -} -' - -// Simple texture sampling shader for compositing blurred result. -const fs_filter_texture_metal = ' -#include -using namespace metal; - -struct VertexOut { - float4 position [[position]]; - float2 uv; - float4 color; - float std_dev; -}; - -fragment float4 fs_main(VertexOut in [[stage_in]], texture2d tex [[texture(0)]], sampler smp [[sampler(0)]]) { - return tex.sample(smp, in.uv) * in.color; -} -' diff --git a/sokol_formats.v b/sokol_formats.v new file mode 100644 index 0000000..07d11cb --- /dev/null +++ b/sokol_formats.v @@ -0,0 +1,17 @@ +module gui + +import sokol.gfx +import sokol.sapp + +struct GuiRenderTargetFormats { + color gfx.PixelFormat + depth gfx.PixelFormat +} + +fn gui_render_target_formats() GuiRenderTargetFormats { + defaults := sapp.glue_environment().defaults + return GuiRenderTargetFormats{ + color: defaults.color_format + depth: defaults.depth_format + } +}