Last active
October 26, 2024 21:49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see https://github.com/floooh/sokol/issues/633 for history | |
// | |
// @darkuranium | |
// - initial version | |
// | |
// @zeromake | |
// - sampler support | |
// - additional changes | |
// | |
// @void256 24.10.2024 | |
// - inline shaders | |
// - fix partial texture updates (and with it text rendering) | |
// - optional debug trace logging | |
// | |
// @void256 25.10.2024 | |
// - embedded original .glsl files and awk command to extract them to single files | |
// - clean up sgnvg__renderUpdateTexture and fix issues when x0 is not 0 | |
// | |
// @void256 26.10.2024 | |
// - don't call sg_update_image() when creating texture in sgnvg__renderCreateTexture() | |
// - renamed debug trace logging macros and added "SGNVG_" prefix there as well | |
// | |
#ifndef NANOVG_SOKOL_H | |
#define NANOVG_SOKOL_H | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
#include <nanovg.h> | |
#include <sokol_gfx.h> | |
// struct sg_image; | |
// Create flags | |
enum NVGcreateFlags { | |
// Flag indicating if geometry based anti-aliasing is used (may not be needed when using MSAA). | |
NVG_ANTIALIAS = 1<<0, | |
// Flag indicating if strokes should be drawn using stencil buffer. The rendering will be a little | |
// slower, but path overlaps (i.e. self-intersecting or sharp turns) will be drawn just once. | |
NVG_STENCIL_STROKES = 1<<1, | |
// Flag indicating that additional debug checks are done. | |
NVG_DEBUG = 1<<2, | |
}; | |
NVGcontext* nvgCreateSokol(int flags); | |
void nvgDeleteSokol(NVGcontext* ctx); | |
int nvsgCreateImageFromHandleSokol(NVGcontext* ctx, sg_image imageSokol, sg_sampler samplerSokol, int type, int w, int h, int flags); | |
struct sg_image nvsgImageHandleSokol(NVGcontext* ctx, int image); | |
// These are additional flags on top of NVGimageFlags. | |
enum NVGimageFlagsGL { | |
NVG_IMAGE_NODELETE = 1<<16, // Do not delete Sokol image. | |
}; | |
#ifdef __cplusplus | |
} | |
#endif | |
#endif /* NANOVG_SOKOL_H */ | |
#ifdef NANOVG_SOKOL_IMPLEMENTATION | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
#include <assert.h> | |
/* | |
Embedded source code compiled with: | |
sokol-shdc --input shd.glsl --output shd.glsl.h --slang glsl410:glsl300es:hlsl4:metal_macos:metal_ios:metal_sim:wgsl --ifdef | |
sokol-shdc --input shd.aa.glsl --output shd.aa.glsl.h --defines=EDGE_AA --slang glsl410:glsl300es:hlsl4:metal_macos:metal_ios:metal_sim:wgsl --ifdef | |
shd.glsl and shd.aa.glsl both @include the internal_shd.fs.glsl and internal_shd.vs.glsl | |
All four files are included below for convenience. | |
To extract the shader source code and get back the 4 files use the following | |
awk command: | |
awk '/^8< / {out_file=$2; print "// " out_file > out_file; next} /^>8/ {out_file=""; next} {if (out_file) print $0 >> out_file}' nanovg_sokol.h | |
8< internal_shd.fs.glsl | |
precision highp float; | |
#if defined(_HLSL5_) && !defined(USE_SOKOL) | |
uniform frag { | |
mat4 _scissorMat; | |
vec4 _scissorExt; | |
vec4 _scissorScale; | |
mat4 _paintMat; | |
vec4 _extent; | |
vec4 _radius; | |
vec4 _feather; | |
vec4 innerCol; | |
vec4 outerCol; | |
vec4 _strokeMult; | |
int texType; | |
int type; | |
}; | |
#define scissorMat mat3(_scissorMat) | |
#define scissorExt _scissorExt.xy | |
#define scissorScale _scissorScale.xy | |
#define paintMat mat3(_paintMat) | |
#define extent _extent.xy | |
#define radius _radius.x | |
#define feather _feather.x | |
#define strokeMult _strokeMult.x | |
#define strokeThr _strokeMult.y | |
#else | |
#ifdef USE_UNIFORMBUFFER | |
layout(std140,binding=1) uniform frag { | |
mat3 scissorMat; | |
mat3 paintMat; | |
vec4 innerCol; | |
vec4 outerCol; | |
vec2 scissorExt; | |
vec2 scissorScale; | |
vec2 extent; | |
float radius; | |
float feather; | |
float strokeMult; | |
float strokeThr; | |
int texType; | |
int type; | |
}; | |
#else | |
layout(std140,binding=1) uniform frag { | |
vec4 dummy[11]; | |
}; | |
#define scissorMat mat3(dummy[0].xyz, dummy[1].xyz, dummy[2].xyz) | |
#define paintMat mat3(dummy[3].xyz, dummy[4].xyz, dummy[5].xyz) | |
#define innerCol dummy[6] | |
#define outerCol dummy[7] | |
#define scissorExt dummy[8].xy | |
#define scissorScale dummy[8].zw | |
#define extent dummy[9].xy | |
#define radius dummy[9].z | |
#define feather dummy[9].w | |
#define strokeMult dummy[10].x | |
#define strokeThr dummy[10].y | |
#define texType int(dummy[10].z) | |
#define type int(dummy[10].w) | |
#endif | |
#endif | |
layout(binding=2) uniform texture2D tex; | |
layout(binding=3) uniform sampler smp; | |
layout(location = 0) in vec2 ftcoord; | |
layout(location = 1) in vec2 fpos; | |
layout(location = 0) out vec4 outColor; | |
float sdroundrect(vec2 pt, vec2 ext, float rad) { | |
vec2 ext2 = ext - vec2(rad,rad); | |
vec2 d = abs(pt) - ext2; | |
return min(max(d.x,d.y),0.0) + length(max(d,0.0)) - rad; | |
} | |
// Scissoring | |
float scissorMask(vec2 p) { | |
vec2 sc = (abs((scissorMat * vec3(p,1.0)).xy) - scissorExt); | |
sc = vec2(0.5,0.5) - sc * scissorScale; | |
return clamp(sc.x,0.0,1.0) * clamp(sc.y,0.0,1.0); | |
} | |
#ifdef EDGE_AA | |
// Stroke - from [0..1] to clipped pyramid, where the slope is 1px. | |
float strokeMask() { | |
return min(1.0, (1.0-abs(ftcoord.x*2.0-1.0))*strokeMult) * min(1.0, ftcoord.y); | |
} | |
#endif | |
void main(void) { | |
vec4 result; | |
#ifdef EDGE_AA | |
float strokeAlpha = strokeMask(); | |
// #ifdef _HLSL5_ | |
// #endif | |
if (strokeAlpha < strokeThr) discard; | |
#else | |
float strokeAlpha = 1.0; | |
#endif | |
float scissor = scissorMask(fpos); | |
if (scissor == 0) { | |
return; | |
} | |
if (type == 0) { // Gradient | |
// Calculate gradient color using box gradient | |
vec2 pt = (paintMat * vec3(fpos,1.0)).xy; | |
float d = clamp((sdroundrect(pt, extent, radius) + feather*0.5) / feather, 0.0, 1.0); | |
vec4 color = mix(innerCol,outerCol,d); | |
// Combine alpha | |
color *= strokeAlpha * scissor; | |
result = color; | |
} else if (type == 1) {// Image | |
// Calculate color fron texture | |
vec2 pt = (paintMat * vec3(fpos,1.0)).xy / extent; | |
vec4 color = texture(sampler2D(tex, smp), pt); | |
if (texType == 1) color = vec4(color.xyz*color.w,color.w); | |
if (texType == 2) color = vec4(color.x); | |
// stencil support | |
if (texType == 3 && color.a == 1.0) discard; | |
// Apply color tint and alpha. | |
color *= innerCol; | |
// Combine alpha | |
color *= strokeAlpha * scissor; | |
result = color; | |
} else if (type == 2) {// Stencil fill | |
result = vec4(1,1,1,1); | |
} else if (type == 3) {// Textured tris | |
vec4 color = texture(sampler2D(tex, smp), ftcoord); | |
if (texType == 1) color = vec4(color.xyz*color.w,color.w); | |
if (texType == 2) color = vec4(color.x); | |
result = color * scissor * innerCol; | |
} | |
outColor = result; | |
} | |
>8 | |
8< internal_shd.vs.glsl | |
layout (binding = 0) uniform viewSize { | |
#if defined(_HLSL5_) && !defined(USE_SOKOL) | |
mat4 dummy; | |
#endif | |
vec4 _viewSize; | |
}; | |
layout (location = 0) in vec2 vertex; | |
layout (location = 1) in vec2 tcoord; | |
layout (location = 0) out vec2 ftcoord; | |
layout (location = 1) out vec2 fpos; | |
void main(void) { | |
ftcoord = tcoord; | |
fpos = vertex; | |
float x = 2.0 * vertex.x / _viewSize.x - 1.0; | |
float y = 1.0 - 2.0 * vertex.y / _viewSize.y; | |
gl_Position = vec4( | |
x, | |
y, | |
0, | |
1 | |
); | |
} | |
>8 | |
8< shd.glsl | |
@module nanovg | |
@vs vs | |
@include internal_shd.vs.glsl | |
@end | |
@fs fs | |
@include internal_shd.fs.glsl | |
@end | |
@program sg vs fs | |
>8 | |
8< shd.aa.glsl | |
@module nanovg_aa | |
@vs vs_aa | |
@include internal_shd.vs.glsl | |
@end | |
@fs fs_aa | |
@include internal_shd.fs.glsl | |
@end | |
@program sg vs_aa fs_aa | |
>8 | |
*/ | |
//////////////////////////////////////////////////////////////////////////////// | |
// #include "shd.glsl.h" | |
//////////////////////////////////////////////////////////////////////////////// | |
/* | |
#version:1# (machine generated, don't edit!) | |
Generated by sokol-shdc (https://github.com/floooh/sokol-tools) | |
Cmdline: | |
sokol-shdc --input shd.glsl --output shd.glsl.h --slang glsl410:glsl300es:hlsl4:metal_macos:metal_ios:metal_sim:wgsl --ifdef | |
Overview: | |
========= | |
Shader program: 'sg': | |
Get shader desc: nanovg_sg_shader_desc(sg_query_backend()); | |
Vertex shader: vs | |
Attributes: | |
ATTR_nanovg_vs_vertex => 0 | |
ATTR_nanovg_vs_tcoord => 1 | |
Uniform block 'viewSize': | |
C struct: nanovg_viewSize_t | |
Bind slot: SLOT_nanovg_viewSize => 0 | |
Fragment shader: fs | |
Uniform block 'frag': | |
C struct: nanovg_frag_t | |
Bind slot: SLOT_nanovg_frag => 0 | |
Image 'tex': | |
Image type: SG_IMAGETYPE_2D | |
Sample type: SG_IMAGESAMPLETYPE_FLOAT | |
Multisampled: false | |
Bind slot: SLOT_nanovg_tex => 0 | |
Sampler 'smp': | |
Type: SG_SAMPLERTYPE_FILTERING | |
Bind slot: SLOT_nanovg_smp => 0 | |
Image Sampler Pair 'tex_smp': | |
Image: tex | |
Sampler: smp | |
*/ | |
#if !defined(SOKOL_GFX_INCLUDED) | |
#error "Please include sokol_gfx.h before shd.glsl.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_nanovg_vs_vertex (0) | |
#define ATTR_nanovg_vs_tcoord (1) | |
#define SLOT_nanovg_viewSize (0) | |
#define SLOT_nanovg_frag (0) | |
#define SLOT_nanovg_tex (0) | |
#define SLOT_nanovg_smp (0) | |
#pragma pack(push,1) | |
SOKOL_SHDC_ALIGN(16) typedef struct nanovg_viewSize_t { | |
float _viewSize[4]; | |
} nanovg_viewSize_t; | |
#pragma pack(pop) | |
#pragma pack(push,1) | |
SOKOL_SHDC_ALIGN(16) typedef struct nanovg_frag_t { | |
float dummy[11][4]; | |
} nanovg_frag_t; | |
#pragma pack(pop) | |
/* | |
#version 410 | |
uniform vec4 viewSize[1]; | |
layout(location = 0) out vec2 ftcoord; | |
layout(location = 1) in vec2 tcoord; | |
layout(location = 1) out vec2 fpos; | |
layout(location = 0) in vec2 vertex; | |
void main() | |
{ | |
ftcoord = tcoord; | |
fpos = vertex; | |
gl_Position = vec4(((2.0 * vertex.x) / viewSize[0].x) - 1.0, 1.0 - ((2.0 * vertex.y) / viewSize[0].y), 0.0, 1.0); | |
} | |
*/ | |
#if defined(SOKOL_GLCORE) | |
static const uint8_t nanovg_vs_source_glsl410[367] = { | |
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,0x76,0x69,0x65,0x77,0x53, | |
0x69,0x7a,0x65,0x5b,0x31,0x5d,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x63,0x6f,0x6f, | |
0x72,0x64,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, | |
0x32,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, | |
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20, | |
0x76,0x65,0x63,0x32,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x3b,0x0a,0x0a,0x76,0x6f, | |
0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x70,0x6f,0x73,0x20,0x3d,0x20,0x76,0x65,0x72, | |
0x74,0x65,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69, | |
0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x28,0x28,0x32,0x2e, | |
0x30,0x20,0x2a,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x2e,0x78,0x29,0x20,0x2f,0x20, | |
0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2d, | |
0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x28,0x32,0x2e, | |
0x30,0x20,0x2a,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x2e,0x79,0x29,0x20,0x2f,0x20, | |
0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x2c,0x20, | |
0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#version 410 | |
uniform vec4 frag[11]; | |
uniform sampler2D tex_smp; | |
layout(location = 1) in vec2 fpos; | |
layout(location = 0) in vec2 ftcoord; | |
layout(location = 0) out vec4 outColor; | |
float scissorMask(vec2 p) | |
{ | |
vec2 _106 = fma(-(abs((mat3(vec3(frag[0].xyz), vec3(frag[1].xyz), vec3(frag[2].xyz)) * vec3(p, 1.0)).xy) - frag[8].xy), frag[8].zw, vec2(0.5)); | |
return clamp(_106.x, 0.0, 1.0) * clamp(_106.y, 0.0, 1.0); | |
} | |
float sdroundrect(vec2 pt, vec2 ext, float rad) | |
{ | |
vec2 _30 = abs(pt) - (ext - vec2(rad, rad)); | |
return (min(max(_30.x, _30.y), 0.0) + length(max(_30, vec2(0.0)))) - rad; | |
} | |
void main() | |
{ | |
vec2 param = fpos; | |
float _122 = scissorMask(param); | |
if (_122 == 0.0) | |
{ | |
return; | |
} | |
int _134 = int(frag[10].w); | |
vec4 result; | |
if (_134 == 0) | |
{ | |
vec2 param_1 = (mat3(vec3(frag[3].xyz), vec3(frag[4].xyz), vec3(frag[5].xyz)) * vec3(fpos, 1.0)).xy; | |
vec2 param_2 = frag[9].xy; | |
float param_3 = frag[9].z; | |
result = mix(frag[6], frag[7], vec4(clamp(fma(frag[9].w, 0.5, sdroundrect(param_1, param_2, param_3)) / frag[9].w, 0.0, 1.0))) * _122; | |
} | |
else | |
{ | |
if (_134 == 1) | |
{ | |
vec4 color = texture(tex_smp, (mat3(vec3(frag[3].xyz), vec3(frag[4].xyz), vec3(frag[5].xyz)) * vec3(fpos, 1.0)).xy / frag[9].xy); | |
int _264 = int(frag[10].z); | |
if (_264 == 1) | |
{ | |
color = vec4(color.xyz * color.w, color.w); | |
} | |
if (_264 == 2) | |
{ | |
color = vec4(color.x); | |
} | |
bool _291 = _264 == 3; | |
bool _297; | |
if (_291) | |
{ | |
_297 = color.w == 1.0; | |
} | |
else | |
{ | |
_297 = _291; | |
} | |
if (_297) | |
{ | |
discard; | |
} | |
vec4 _303 = color; | |
vec4 _309 = (_303 * frag[6]) * _122; | |
color = _309; | |
result = _309; | |
} | |
else | |
{ | |
if (_134 == 2) | |
{ | |
result = vec4(1.0); | |
} | |
else | |
{ | |
if (_134 == 3) | |
{ | |
vec4 color_1 = texture(tex_smp, ftcoord); | |
int _335 = int(frag[10].z); | |
if (_335 == 1) | |
{ | |
color_1 = vec4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_335 == 2) | |
{ | |
color_1 = vec4(color_1.x); | |
} | |
result = (color_1 * _122) * frag[6]; | |
} | |
} | |
} | |
} | |
outColor = result; | |
} | |
*/ | |
#if defined(SOKOL_GLCORE) | |
static const uint8_t nanovg_fs_source_glsl410[2724] = { | |
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,0x66,0x72,0x61,0x67,0x5b, | |
0x31,0x31,0x5d,0x3b,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,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x66,0x70, | |
0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74, | |
0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32, | |
0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72, | |
0x3b,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72, | |
0x4d,0x61,0x73,0x6b,0x28,0x76,0x65,0x63,0x32,0x20,0x70,0x29,0x0a,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x31,0x30,0x36,0x20,0x3d,0x20,0x66, | |
0x6d,0x61,0x28,0x2d,0x28,0x61,0x62,0x73,0x28,0x28,0x6d,0x61,0x74,0x33,0x28,0x76, | |
0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x29, | |
0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x31,0x5d,0x2e,0x78, | |
0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x32, | |
0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x70, | |
0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x29,0x20,0x2d,0x20,0x66,0x72, | |
0x61,0x67,0x5b,0x38,0x5d,0x2e,0x78,0x79,0x29,0x2c,0x20,0x66,0x72,0x61,0x67,0x5b, | |
0x38,0x5d,0x2e,0x7a,0x77,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x6c, | |
0x61,0x6d,0x70,0x28,0x5f,0x31,0x30,0x36,0x2e,0x78,0x2c,0x20,0x30,0x2e,0x30,0x2c, | |
0x20,0x31,0x2e,0x30,0x29,0x20,0x2a,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x36,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b, | |
0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e, | |
0x64,0x72,0x65,0x63,0x74,0x28,0x76,0x65,0x63,0x32,0x20,0x70,0x74,0x2c,0x20,0x76, | |
0x65,0x63,0x32,0x20,0x65,0x78,0x74,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72, | |
0x61,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f, | |
0x33,0x30,0x20,0x3d,0x20,0x61,0x62,0x73,0x28,0x70,0x74,0x29,0x20,0x2d,0x20,0x28, | |
0x65,0x78,0x74,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x28,0x72,0x61,0x64,0x2c,0x20, | |
0x72,0x61,0x64,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, | |
0x6e,0x20,0x28,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x30,0x2e,0x78, | |
0x2c,0x20,0x5f,0x33,0x30,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x20,0x2b, | |
0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x30,0x2c, | |
0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x29,0x20,0x2d,0x20, | |
0x72,0x61,0x64,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69, | |
0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70, | |
0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x32,0x32,0x20,0x3d,0x20,0x73,0x63, | |
0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x32,0x20,0x3d, | |
0x3d,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x33,0x34,0x20, | |
0x3d,0x20,0x69,0x6e,0x74,0x28,0x66,0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x77, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x72,0x65,0x73,0x75, | |
0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34, | |
0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, | |
0x31,0x20,0x3d,0x20,0x28,0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x66, | |
0x72,0x61,0x67,0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63, | |
0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20, | |
0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a, | |
0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x70,0x6f,0x73,0x2c,0x20, | |
0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d, | |
0x20,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, | |
0x5f,0x33,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x7a,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d, | |
0x20,0x6d,0x69,0x78,0x28,0x66,0x72,0x61,0x67,0x5b,0x36,0x5d,0x2c,0x20,0x66,0x72, | |
0x61,0x67,0x5b,0x37,0x5d,0x2c,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6c,0x61,0x6d, | |
0x70,0x28,0x66,0x6d,0x61,0x28,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x77,0x2c, | |
0x20,0x30,0x2e,0x35,0x2c,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63, | |
0x74,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,0x20,0x2f,0x20, | |
0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20, | |
0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, | |
0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x76,0x65,0x63,0x34,0x20,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,0x28, | |
0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x33, | |
0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61, | |
0x67,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28, | |
0x66,0x72,0x61,0x67,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x76,0x65,0x63,0x33,0x28,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29, | |
0x2e,0x78,0x79,0x20,0x2f,0x20,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x78,0x79, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, | |
0x6e,0x74,0x20,0x5f,0x32,0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x66,0x72, | |
0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x36,0x34,0x20, | |
0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34, | |
0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c, | |
0x6f,0x72,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32, | |
0x36,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76, | |
0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x39, | |
0x31,0x20,0x3d,0x20,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20, | |
0x5f,0x32,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x31,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x39,0x37,0x20,0x3d, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32, | |
0x39,0x37,0x20,0x3d,0x20,0x5f,0x32,0x39,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x37,0x29,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73, | |
0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x30,0x33,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76, | |
0x65,0x63,0x34,0x20,0x5f,0x33,0x30,0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x30,0x33, | |
0x20,0x2a,0x20,0x66,0x72,0x61,0x67,0x5b,0x36,0x5d,0x29,0x20,0x2a,0x20,0x5f,0x31, | |
0x32,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x30,0x39,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74, | |
0x20,0x3d,0x20,0x5f,0x33,0x30,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d, | |
0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x76,0x65,0x63,0x34, | |
0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20, | |
0x33,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, | |
0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x33,0x35,0x20, | |
0x3d,0x20,0x69,0x6e,0x74,0x28,0x66,0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x7a, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x35,0x20, | |
0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65, | |
0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x31,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x35,0x20,0x3d,0x3d,0x20,0x32,0x29, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x28,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x29,0x20,0x2a,0x20, | |
0x66,0x72,0x61,0x67,0x5b,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, | |
0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a, | |
0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#version 300 es | |
uniform vec4 viewSize[1]; | |
out vec2 ftcoord; | |
layout(location = 1) in vec2 tcoord; | |
out vec2 fpos; | |
layout(location = 0) in vec2 vertex; | |
void main() | |
{ | |
ftcoord = tcoord; | |
fpos = vertex; | |
gl_Position = vec4(((2.0 * vertex.x) / viewSize[0].x) - 1.0, 1.0 - ((2.0 * vertex.y) / viewSize[0].y), 0.0, 1.0); | |
} | |
*/ | |
#if defined(SOKOL_GLES3) | |
static const uint8_t nanovg_vs_source_glsl300es[328] = { | |
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, | |
0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x69, | |
0x65,0x77,0x53,0x69,0x7a,0x65,0x5b,0x31,0x5d,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76, | |
0x65,0x63,0x32,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x63,0x6f,0x6f,0x72,0x64, | |
0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x66,0x70,0x6f,0x73,0x3b, | |
0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, | |
0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x76,0x65, | |
0x72,0x74,0x65,0x78,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e, | |
0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x20,0x3d,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, | |
0x70,0x6f,0x73,0x20,0x3d,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, | |
0x76,0x65,0x63,0x34,0x28,0x28,0x28,0x32,0x2e,0x30,0x20,0x2a,0x20,0x76,0x65,0x72, | |
0x74,0x65,0x78,0x2e,0x78,0x29,0x20,0x2f,0x20,0x76,0x69,0x65,0x77,0x53,0x69,0x7a, | |
0x65,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31, | |
0x2e,0x30,0x20,0x2d,0x20,0x28,0x28,0x32,0x2e,0x30,0x20,0x2a,0x20,0x76,0x65,0x72, | |
0x74,0x65,0x78,0x2e,0x79,0x29,0x20,0x2f,0x20,0x76,0x69,0x65,0x77,0x53,0x69,0x7a, | |
0x65,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e, | |
0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#version 300 es | |
precision mediump float; | |
precision highp int; | |
uniform highp vec4 frag[11]; | |
uniform highp sampler2D tex_smp; | |
in highp vec2 fpos; | |
in highp vec2 ftcoord; | |
layout(location = 0) out highp vec4 outColor; | |
highp float scissorMask(highp vec2 p) | |
{ | |
highp vec2 _106 = (-(abs((mat3(vec3(frag[0].xyz), vec3(frag[1].xyz), vec3(frag[2].xyz)) * vec3(p, 1.0)).xy) - frag[8].xy)) * frag[8].zw + vec2(0.5); | |
return clamp(_106.x, 0.0, 1.0) * clamp(_106.y, 0.0, 1.0); | |
} | |
highp float sdroundrect(highp vec2 pt, highp vec2 ext, highp float rad) | |
{ | |
highp vec2 _30 = abs(pt) - (ext - vec2(rad, rad)); | |
return (min(max(_30.x, _30.y), 0.0) + length(max(_30, vec2(0.0)))) - rad; | |
} | |
void main() | |
{ | |
highp vec2 param = fpos; | |
highp float _122 = scissorMask(param); | |
if (_122 == 0.0) | |
{ | |
return; | |
} | |
int _134 = int(frag[10].w); | |
highp vec4 result; | |
if (_134 == 0) | |
{ | |
highp vec2 param_1 = (mat3(vec3(frag[3].xyz), vec3(frag[4].xyz), vec3(frag[5].xyz)) * vec3(fpos, 1.0)).xy; | |
highp vec2 param_2 = frag[9].xy; | |
highp float param_3 = frag[9].z; | |
result = mix(frag[6], frag[7], vec4(clamp((frag[9].w * 0.5 + sdroundrect(param_1, param_2, param_3)) / frag[9].w, 0.0, 1.0))) * _122; | |
} | |
else | |
{ | |
if (_134 == 1) | |
{ | |
highp vec4 color = texture(tex_smp, (mat3(vec3(frag[3].xyz), vec3(frag[4].xyz), vec3(frag[5].xyz)) * vec3(fpos, 1.0)).xy / frag[9].xy); | |
int _264 = int(frag[10].z); | |
if (_264 == 1) | |
{ | |
color = vec4(color.xyz * color.w, color.w); | |
} | |
if (_264 == 2) | |
{ | |
color = vec4(color.x); | |
} | |
bool _291 = _264 == 3; | |
bool _297; | |
if (_291) | |
{ | |
_297 = color.w == 1.0; | |
} | |
else | |
{ | |
_297 = _291; | |
} | |
if (_297) | |
{ | |
discard; | |
} | |
highp vec4 _303 = color; | |
highp vec4 _309 = (_303 * frag[6]) * _122; | |
color = _309; | |
result = _309; | |
} | |
else | |
{ | |
if (_134 == 2) | |
{ | |
result = vec4(1.0); | |
} | |
else | |
{ | |
if (_134 == 3) | |
{ | |
highp vec4 color_1 = texture(tex_smp, ftcoord); | |
int _335 = int(frag[10].z); | |
if (_335 == 1) | |
{ | |
color_1 = vec4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_335 == 2) | |
{ | |
color_1 = vec4(color_1.x); | |
} | |
result = (color_1 * _122) * frag[6]; | |
} | |
} | |
} | |
} | |
outColor = result; | |
} | |
*/ | |
#if defined(SOKOL_GLES3) | |
static const uint8_t nanovg_fs_source_glsl300es[2867] = { | |
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, | |
0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, | |
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, | |
0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75, | |
0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, | |
0x34,0x20,0x66,0x72,0x61,0x67,0x5b,0x31,0x31,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66, | |
0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65, | |
0x72,0x32,0x44,0x20,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x69,0x6e, | |
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x66,0x70,0x6f,0x73, | |
0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20, | |
0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x6f,0x75,0x74, | |
0x43,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28, | |
0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x29,0x0a,0x7b,0x0a, | |
0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x5f, | |
0x31,0x30,0x36,0x20,0x3d,0x20,0x28,0x2d,0x28,0x61,0x62,0x73,0x28,0x28,0x6d,0x61, | |
0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x30,0x5d,0x2e, | |
0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b, | |
0x31,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72, | |
0x61,0x67,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x76,0x65, | |
0x63,0x33,0x28,0x70,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x29,0x20, | |
0x2d,0x20,0x66,0x72,0x61,0x67,0x5b,0x38,0x5d,0x2e,0x78,0x79,0x29,0x29,0x20,0x2a, | |
0x20,0x66,0x72,0x61,0x67,0x5b,0x38,0x5d,0x2e,0x7a,0x77,0x20,0x2b,0x20,0x76,0x65, | |
0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, | |
0x75,0x72,0x6e,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31,0x30,0x36,0x2e,0x78, | |
0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20,0x2a,0x20,0x63,0x6c, | |
0x61,0x6d,0x70,0x28,0x5f,0x31,0x30,0x36,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c, | |
0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63, | |
0x74,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x74,0x2c, | |
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x65,0x78,0x74,0x2c, | |
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64, | |
0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, | |
0x63,0x32,0x20,0x5f,0x33,0x30,0x20,0x3d,0x20,0x61,0x62,0x73,0x28,0x70,0x74,0x29, | |
0x20,0x2d,0x20,0x28,0x65,0x78,0x74,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x28,0x72, | |
0x61,0x64,0x2c,0x20,0x72,0x61,0x64,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, | |
0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f, | |
0x33,0x30,0x2e,0x78,0x2c,0x20,0x5f,0x33,0x30,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e, | |
0x30,0x29,0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28, | |
0x5f,0x33,0x30,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29, | |
0x29,0x20,0x2d,0x20,0x72,0x61,0x64,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64, | |
0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, | |
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d, | |
0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x32,0x32,0x20,0x3d,0x20,0x73,0x63, | |
0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x32,0x20,0x3d, | |
0x3d,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x33,0x34,0x20, | |
0x3d,0x20,0x69,0x6e,0x74,0x28,0x66,0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x77, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, | |
0x34,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, | |
0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20, | |
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, | |
0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, | |
0x28,0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b, | |
0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72, | |
0x61,0x67,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33, | |
0x28,0x66,0x72,0x61,0x67,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a, | |
0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29, | |
0x29,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69, | |
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32, | |
0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x66,0x72,0x61, | |
0x67,0x5b,0x39,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x66,0x72,0x61, | |
0x67,0x5b,0x36,0x5d,0x2c,0x20,0x66,0x72,0x61,0x67,0x5b,0x37,0x5d,0x2c,0x20,0x76, | |
0x65,0x63,0x34,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x66,0x72,0x61,0x67,0x5b, | |
0x39,0x5d,0x2e,0x77,0x20,0x2a,0x20,0x30,0x2e,0x35,0x20,0x2b,0x20,0x73,0x64,0x72, | |
0x6f,0x75,0x6e,0x64,0x72,0x65,0x63,0x74,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,0x20,0x2f,0x20,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x77, | |
0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20, | |
0x5f,0x31,0x32,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x31, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, | |
0x63,0x34,0x20,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,0x28,0x6d,0x61,0x74, | |
0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x33,0x5d,0x2e,0x78, | |
0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x34, | |
0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61, | |
0x67,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63, | |
0x33,0x28,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79, | |
0x20,0x2f,0x20,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20, | |
0x5f,0x32,0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x66,0x72,0x61,0x67,0x5b, | |
0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d,0x20, | |
0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f, | |
0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e, | |
0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x36,0x34,0x20, | |
0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34, | |
0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x39,0x31,0x20,0x3d, | |
0x20,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x39, | |
0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, | |
0x66,0x20,0x28,0x5f,0x32,0x39,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x39,0x37,0x20,0x3d,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x39,0x37,0x20, | |
0x3d,0x20,0x5f,0x32,0x39,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x37,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72, | |
0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67, | |
0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x30,0x33,0x20,0x3d,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x30, | |
0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x30,0x33,0x20,0x2a,0x20,0x66,0x72,0x61,0x67, | |
0x5b,0x36,0x5d,0x29,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, | |
0x20,0x5f,0x33,0x30,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x33,0x30,0x39, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, | |
0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75, | |
0x6c,0x74,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, | |
0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x33,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c, | |
0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x74, | |
0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x33,0x35,0x20,0x3d, | |
0x20,0x69,0x6e,0x74,0x28,0x66,0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x7a,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x35,0x20,0x3d, | |
0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63, | |
0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20, | |
0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x5f,0x31,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x35,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f,0x6c, | |
0x6f,0x72,0x5f,0x31,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x28,0x63,0x6f,0x6c, | |
0x6f,0x72,0x5f,0x31,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x29,0x20,0x2a,0x20,0x66, | |
0x72,0x61,0x67,0x5b,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x43, | |
0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x7d, | |
0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
cbuffer viewSize : register(b0) | |
{ | |
float4 _28_viewSize : packoffset(c0); | |
}; | |
static float4 gl_Position; | |
static float2 ftcoord; | |
static float2 tcoord; | |
static float2 fpos; | |
static float2 vertex; | |
struct SPIRV_Cross_Input | |
{ | |
float2 vertex : TEXCOORD0; | |
float2 tcoord : TEXCOORD1; | |
}; | |
struct SPIRV_Cross_Output | |
{ | |
float2 ftcoord : TEXCOORD0; | |
float2 fpos : TEXCOORD1; | |
float4 gl_Position : SV_Position; | |
}; | |
void vert_main() | |
{ | |
ftcoord = tcoord; | |
fpos = vertex; | |
gl_Position = float4(((2.0f * vertex.x) / _28_viewSize.x) - 1.0f, 1.0f - ((2.0f * vertex.y) / _28_viewSize.y), 0.0f, 1.0f); | |
} | |
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) | |
{ | |
tcoord = stage_input.tcoord; | |
vertex = stage_input.vertex; | |
vert_main(); | |
SPIRV_Cross_Output stage_output; | |
stage_output.gl_Position = gl_Position; | |
stage_output.ftcoord = ftcoord; | |
stage_output.fpos = fpos; | |
return stage_output; | |
} | |
*/ | |
#if defined(SOKOL_D3D11) | |
static const uint8_t nanovg_vs_source_hlsl4[926] = { | |
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65, | |
0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a, | |
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x38, | |
0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b, | |
0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a, | |
0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67, | |
0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74, | |
0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72, | |
0x64,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, | |
0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x73,0x74,0x61, | |
0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x65,0x72,0x74,0x65, | |
0x78,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,0x76,0x65,0x72,0x74,0x65,0x78, | |
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,0x63,0x6f,0x6f,0x72,0x64,0x20, | |
0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x66,0x70,0x6f,0x73,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,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,0x66,0x74,0x63,0x6f,0x6f, | |
0x72,0x64,0x20,0x3d,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x66,0x70,0x6f,0x73,0x20,0x3d,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20, | |
0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x32,0x2e,0x30,0x66,0x20, | |
0x2a,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x2e,0x78,0x29,0x20,0x2f,0x20,0x5f,0x32, | |
0x38,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e,0x78,0x29,0x20,0x2d,0x20, | |
0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x28,0x28,0x32, | |
0x2e,0x30,0x66,0x20,0x2a,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x2e,0x79,0x29,0x20, | |
0x2f,0x20,0x5f,0x32,0x38,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e,0x79, | |
0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,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, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, | |
0x6e,0x70,0x75,0x74,0x2e,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, | |
0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x66,0x74,0x63,0x6f,0x6f, | |
0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75, | |
0x74,0x70,0x75,0x74,0x2e,0x66,0x70,0x6f,0x73,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61, | |
0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, | |
}; | |
#endif | |
/* | |
cbuffer frag : register(b0) | |
{ | |
float4 _56_dummy[11] : packoffset(c0); | |
}; | |
Texture2D<float4> tex : register(t0); | |
SamplerState smp : register(s0); | |
static float2 fpos; | |
static float2 ftcoord; | |
static float4 outColor; | |
struct SPIRV_Cross_Input | |
{ | |
float2 ftcoord : TEXCOORD0; | |
float2 fpos : TEXCOORD1; | |
}; | |
struct SPIRV_Cross_Output | |
{ | |
float4 outColor : SV_Target0; | |
}; | |
float scissorMask(float2 p) | |
{ | |
float2 _106 = mad(-(abs(mul(float3(p, 1.0f), float3x3(float3(_56_dummy[0].xyz), float3(_56_dummy[1].xyz), float3(_56_dummy[2].xyz))).xy) - _56_dummy[8].xy), _56_dummy[8].zw, 0.5f.xx); | |
return clamp(_106.x, 0.0f, 1.0f) * clamp(_106.y, 0.0f, 1.0f); | |
} | |
float sdroundrect(float2 pt, float2 ext, float rad) | |
{ | |
float2 _30 = abs(pt) - (ext - float2(rad, rad)); | |
return (min(max(_30.x, _30.y), 0.0f) + length(max(_30, 0.0f.xx))) - rad; | |
} | |
void frag_main() | |
{ | |
float2 param = fpos; | |
float _122 = scissorMask(param); | |
if (_122 == 0.0f) | |
{ | |
return; | |
} | |
int _134 = int(_56_dummy[10].w); | |
float4 result; | |
if (_134 == 0) | |
{ | |
float2 param_1 = mul(float3(fpos, 1.0f), float3x3(float3(_56_dummy[3].xyz), float3(_56_dummy[4].xyz), float3(_56_dummy[5].xyz))).xy; | |
float2 param_2 = _56_dummy[9].xy; | |
float param_3 = _56_dummy[9].z; | |
result = lerp(_56_dummy[6], _56_dummy[7], clamp(mad(_56_dummy[9].w, 0.5f, sdroundrect(param_1, param_2, param_3)) / _56_dummy[9].w, 0.0f, 1.0f).xxxx) * _122; | |
} | |
else | |
{ | |
if (_134 == 1) | |
{ | |
float4 color = tex.Sample(smp, mul(float3(fpos, 1.0f), float3x3(float3(_56_dummy[3].xyz), float3(_56_dummy[4].xyz), float3(_56_dummy[5].xyz))).xy / _56_dummy[9].xy); | |
int _264 = int(_56_dummy[10].z); | |
if (_264 == 1) | |
{ | |
color = float4(color.xyz * color.w, color.w); | |
} | |
if (_264 == 2) | |
{ | |
color = color.x.xxxx; | |
} | |
bool _291 = _264 == 3; | |
bool _297; | |
if (_291) | |
{ | |
_297 = color.w == 1.0f; | |
} | |
else | |
{ | |
_297 = _291; | |
} | |
if (_297) | |
{ | |
discard; | |
} | |
float4 _303 = color; | |
float4 _309 = (_303 * _56_dummy[6]) * _122; | |
color = _309; | |
result = _309; | |
} | |
else | |
{ | |
if (_134 == 2) | |
{ | |
result = 1.0f.xxxx; | |
} | |
else | |
{ | |
if (_134 == 3) | |
{ | |
float4 color_1 = tex.Sample(smp, ftcoord); | |
int _335 = int(_56_dummy[10].z); | |
if (_335 == 1) | |
{ | |
color_1 = float4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_335 == 2) | |
{ | |
color_1 = color_1.x.xxxx; | |
} | |
result = (color_1 * _122) * _56_dummy[6]; | |
} | |
} | |
} | |
} | |
outColor = result; | |
} | |
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) | |
{ | |
fpos = stage_input.fpos; | |
ftcoord = stage_input.ftcoord; | |
frag_main(); | |
SPIRV_Cross_Output stage_output; | |
stage_output.outColor = outColor; | |
return stage_output; | |
} | |
*/ | |
#if defined(SOKOL_D3D11) | |
static const uint8_t nanovg_fs_source_hlsl4[3359] = { | |
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x66,0x72,0x61,0x67,0x20,0x3a,0x20,0x72, | |
0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x31,0x31,0x5d,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66, | |
0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,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,0x32,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a, | |
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75, | |
0x74,0x43,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,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x66, | |
0x70,0x6f,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,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,0x6f,0x75,0x74,0x43, | |
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,0x73,0x63,0x69, | |
0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20, | |
0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20, | |
0x5f,0x31,0x30,0x36,0x20,0x3d,0x20,0x6d,0x61,0x64,0x28,0x2d,0x28,0x61,0x62,0x73, | |
0x28,0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x70,0x2c,0x20,0x31, | |
0x2e,0x30,0x66,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66, | |
0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x30,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, | |
0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a, | |
0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x5f,0x64,0x75, | |
0x6d,0x6d,0x79,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x29,0x2e,0x78,0x79, | |
0x29,0x20,0x2d,0x20,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x38,0x5d, | |
0x2e,0x78,0x79,0x29,0x2c,0x20,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x38,0x5d,0x2e,0x7a,0x77,0x2c,0x20,0x30,0x2e,0x35,0x66,0x2e,0x78,0x78,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x6c,0x61,0x6d, | |
0x70,0x28,0x5f,0x31,0x30,0x36,0x2e,0x78,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20, | |
0x31,0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x36,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66, | |
0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x64,0x72,0x6f, | |
0x75,0x6e,0x64,0x72,0x65,0x63,0x74,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70, | |
0x74,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x65,0x78,0x74,0x2c,0x20,0x66, | |
0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x33,0x30,0x20,0x3d,0x20,0x61,0x62,0x73, | |
0x28,0x70,0x74,0x29,0x20,0x2d,0x20,0x28,0x65,0x78,0x74,0x20,0x2d,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x2c,0x20,0x72,0x61,0x64,0x29,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6d,0x69,0x6e, | |
0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x30,0x2e,0x78,0x2c,0x20,0x5f,0x33,0x30,0x2e, | |
0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67, | |
0x74,0x68,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x30,0x2c,0x20,0x30,0x2e,0x30,0x66, | |
0x2e,0x78,0x78,0x29,0x29,0x29,0x20,0x2d,0x20,0x72,0x61,0x64,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,0x32,0x20,0x70, | |
0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x32,0x32,0x20,0x3d,0x20,0x73,0x63, | |
0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x32,0x20,0x3d, | |
0x3d,0x20,0x30,0x2e,0x30,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x33,0x34, | |
0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x31,0x30,0x5d,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x6d,0x75, | |
0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31, | |
0x2e,0x30,0x66,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66, | |
0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, | |
0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a, | |
0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x5f,0x64,0x75, | |
0x6d,0x6d,0x79,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x29,0x2e,0x78,0x79, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, | |
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x35,0x36,0x5f,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, | |
0x33,0x20,0x3d,0x20,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d, | |
0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75, | |
0x6c,0x74,0x20,0x3d,0x20,0x6c,0x65,0x72,0x70,0x28,0x5f,0x35,0x36,0x5f,0x64,0x75, | |
0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x2c,0x20,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x37,0x5d,0x2c,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6d,0x61,0x64,0x28, | |
0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20, | |
0x30,0x2e,0x35,0x66,0x2c,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63, | |
0x74,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,0x20,0x2f,0x20, | |
0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20, | |
0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2e,0x78,0x78,0x78,0x78, | |
0x29,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20, | |
0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x2e,0x53, | |
0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x6d,0x75,0x6c,0x28,0x66, | |
0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x66, | |
0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61, | |
0x74,0x33,0x28,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d,0x2e, | |
0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36, | |
0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x29,0x2e,0x78,0x79,0x20,0x2f,0x20, | |
0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e, | |
0x74,0x20,0x5f,0x32,0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x36, | |
0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x32,0x36,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a, | |
0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x69,0x66,0x20,0x28,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c, | |
0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x2e,0x78,0x78,0x78, | |
0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f, | |
0x6c,0x20,0x5f,0x32,0x39,0x31,0x20,0x3d,0x20,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d, | |
0x20,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x31,0x29, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f, | |
0x32,0x39,0x37,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d, | |
0x20,0x31,0x2e,0x30,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x5f,0x32,0x39,0x37,0x20,0x3d,0x20,0x5f,0x32,0x39,0x31,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x32,0x39,0x37,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x33,0x30, | |
0x33,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x33, | |
0x30,0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x30,0x33,0x20,0x2a,0x20,0x5f,0x35,0x36, | |
0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x29,0x20,0x2a,0x20,0x5f,0x31,0x32, | |
0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x30,0x39,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20, | |
0x3d,0x20,0x5f,0x33,0x30,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d, | |
0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x31,0x2e,0x30,0x66,0x2e, | |
0x78,0x78,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x33, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x2e,0x53,0x61,0x6d, | |
0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x33,0x35,0x20, | |
0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, | |
0x5f,0x33,0x33,0x35,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e, | |
0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33, | |
0x35,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20, | |
0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x2e,0x78,0x78,0x78,0x78,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74, | |
0x20,0x3d,0x20,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x2a,0x20,0x5f,0x31, | |
0x32,0x32,0x29,0x20,0x2a,0x20,0x5f,0x35,0x36,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72, | |
0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,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,0x66,0x70,0x6f,0x73,0x20, | |
0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x70, | |
0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20, | |
0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x74, | |
0x63,0x6f,0x6f,0x72,0x64,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,0x6f,0x75, | |
0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6f,0x75,0x74,0x43,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, | |
}; | |
#endif | |
/* | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct viewSize | |
{ | |
float4 _viewSize; | |
}; | |
struct main0_out | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
float4 gl_Position [[position]]; | |
}; | |
struct main0_in | |
{ | |
float2 vertex0 [[attribute(0)]]; | |
float2 tcoord [[attribute(1)]]; | |
}; | |
vertex main0_out main0(main0_in in [[stage_in]], constant viewSize& _28 [[buffer(0)]]) | |
{ | |
main0_out out = {}; | |
out.ftcoord = in.tcoord; | |
out.fpos = in.vertex0; | |
out.gl_Position = float4(((2.0 * in.vertex0.x) / _28._viewSize.x) - 1.0, 1.0 - ((2.0 * in.vertex0.y) / _28._viewSize.y), 0.0, 1.0); | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_vs_source_metal_macos[665] = { | |
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,0x76, | |
0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x20,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,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,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, | |
0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b, | |
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, | |
0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x32,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x30,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,0x63,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b, | |
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,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,0x76,0x69, | |
0x65,0x77,0x53,0x69,0x7a,0x65,0x26,0x20,0x5f,0x32,0x38,0x20,0x5b,0x5b,0x62,0x75, | |
0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d, | |
0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x74,0x63, | |
0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x70,0x6f,0x73,0x20,0x3d, | |
0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x32,0x2e,0x30,0x20, | |
0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x2e,0x78,0x29,0x20, | |
0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e, | |
0x78,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20, | |
0x28,0x28,0x32,0x2e,0x30,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65, | |
0x78,0x30,0x2e,0x79,0x29,0x20,0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65, | |
0x77,0x53,0x69,0x7a,0x65,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, | |
0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, | |
0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#pragma clang diagnostic ignored "-Wmissing-prototypes" | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct frag | |
{ | |
float4 dummy[11]; | |
}; | |
struct main0_out | |
{ | |
float4 outColor [[color(0)]]; | |
}; | |
struct main0_in | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
}; | |
static inline __attribute__((always_inline)) | |
float scissorMask(thread const float2& p, constant frag& _56) | |
{ | |
float2 _106 = fma(-(abs((float3x3(float3(_56.dummy[0].xyz), float3(_56.dummy[1].xyz), float3(_56.dummy[2].xyz)) * float3(p, 1.0)).xy) - _56.dummy[8].xy), _56.dummy[8].zw, float2(0.5)); | |
return fast::clamp(_106.x, 0.0, 1.0) * fast::clamp(_106.y, 0.0, 1.0); | |
} | |
static inline __attribute__((always_inline)) | |
float sdroundrect(thread const float2& pt, thread const float2& ext, thread const float& rad) | |
{ | |
float2 _30 = abs(pt) - (ext - float2(rad, rad)); | |
return (fast::min(fast::max(_30.x, _30.y), 0.0) + length(fast::max(_30, float2(0.0)))) - rad; | |
} | |
fragment main0_out main0(main0_in in [[stage_in]], constant frag& _56 [[buffer(0)]], texture2d<float> tex [[texture(0)]], sampler smp [[sampler(0)]]) | |
{ | |
main0_out out = {}; | |
float2 param = in.fpos; | |
float _122 = scissorMask(param, _56); | |
if (_122 == 0.0) | |
{ | |
return out; | |
} | |
int _134 = int(_56.dummy[10].w); | |
float4 result; | |
if (_134 == 0) | |
{ | |
float2 param_1 = (float3x3(float3(_56.dummy[3].xyz), float3(_56.dummy[4].xyz), float3(_56.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy; | |
float2 param_2 = _56.dummy[9].xy; | |
float param_3 = _56.dummy[9].z; | |
result = mix(_56.dummy[6], _56.dummy[7], float4(fast::clamp(fma(_56.dummy[9].w, 0.5, sdroundrect(param_1, param_2, param_3)) / _56.dummy[9].w, 0.0, 1.0))) * _122; | |
} | |
else | |
{ | |
if (_134 == 1) | |
{ | |
float4 color = tex.sample(smp, ((float3x3(float3(_56.dummy[3].xyz), float3(_56.dummy[4].xyz), float3(_56.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy / _56.dummy[9].xy)); | |
int _264 = int(_56.dummy[10].z); | |
if (_264 == 1) | |
{ | |
color = float4(color.xyz * color.w, color.w); | |
} | |
if (_264 == 2) | |
{ | |
color = float4(color.x); | |
} | |
bool _291 = _264 == 3; | |
bool _297; | |
if (_291) | |
{ | |
_297 = color.w == 1.0; | |
} | |
else | |
{ | |
_297 = _291; | |
} | |
if (_297) | |
{ | |
discard_fragment(); | |
} | |
float4 _303 = color; | |
float4 _309 = (_303 * _56.dummy[6]) * _122; | |
color = _309; | |
result = _309; | |
} | |
else | |
{ | |
if (_134 == 2) | |
{ | |
result = float4(1.0); | |
} | |
else | |
{ | |
if (_134 == 3) | |
{ | |
float4 color_1 = tex.sample(smp, in.ftcoord); | |
int _335 = int(_56.dummy[10].z); | |
if (_335 == 1) | |
{ | |
color_1 = float4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_335 == 2) | |
{ | |
color_1 = float4(color_1.x); | |
} | |
result = (color_1 * _122) * _56.dummy[6]; | |
} | |
} | |
} | |
} | |
out.outColor = result; | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_fs_source_metal_macos[3473] = { | |
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,0x66,0x72,0x61,0x67,0x0a,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x31,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, | |
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75,0x74,0x43,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,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c, | |
0x6f,0x63,0x6e,0x31,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, | |
0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x70,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61, | |
0x67,0x26,0x20,0x5f,0x35,0x36,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x30,0x36,0x20,0x3d,0x20,0x66,0x6d,0x61,0x28, | |
0x2d,0x28,0x61,0x62,0x73,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x70,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e, | |
0x78,0x79,0x29,0x20,0x2d,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x38,0x5d,0x2e,0x78,0x79,0x29,0x2c,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x38,0x5d,0x2e,0x7a,0x77,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, | |
0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, | |
0x6e,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x36,0x2e,0x78,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20, | |
0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x36,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,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,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65, | |
0x63,0x74,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x70,0x74,0x2c,0x20,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x65,0x78,0x74,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,0x29,0x0a,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x33,0x30,0x20, | |
0x3d,0x20,0x61,0x62,0x73,0x28,0x70,0x74,0x29,0x20,0x2d,0x20,0x28,0x65,0x78,0x74, | |
0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x2c,0x20,0x72, | |
0x61,0x64,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, | |
0x20,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x66,0x61,0x73,0x74, | |
0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x30,0x2e,0x78,0x2c,0x20,0x5f,0x33,0x30, | |
0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67, | |
0x74,0x68,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x30, | |
0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x29, | |
0x20,0x2d,0x20,0x72,0x61,0x64,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,0x63,0x6f, | |
0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61,0x67,0x26,0x20,0x5f,0x35,0x36, | |
0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,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,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x69,0x6e, | |
0x2e,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x20,0x5f,0x31,0x32,0x32,0x20,0x3d,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d, | |
0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x5f,0x35,0x36,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x32,0x20,0x3d,0x3d, | |
0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31, | |
0x33,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, | |
0x6c,0x6f,0x61,0x74,0x34,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x30,0x29, | |
0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, | |
0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, | |
0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x35, | |
0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e, | |
0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x35,0x36, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, | |
0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x39,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, | |
0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x2c,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x37,0x5d,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x66,0x61, | |
0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x66,0x6d,0x61,0x28,0x5f,0x35, | |
0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e, | |
0x35,0x2c,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63,0x74,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,0x20,0x2f,0x20,0x5f,0x35,0x36, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e,0x30, | |
0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, | |
0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20, | |
0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70, | |
0x2c,0x20,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f, | |
0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d, | |
0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35, | |
0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x33,0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30, | |
0x29,0x29,0x2e,0x78,0x79,0x20,0x2f,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x36,0x34,0x20, | |
0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d,0x20, | |
0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28, | |
0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x36, | |
0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32, | |
0x39,0x31,0x20,0x3d,0x20,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c, | |
0x20,0x5f,0x32,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x31,0x29,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x39,0x37,0x20, | |
0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f, | |
0x32,0x39,0x37,0x20,0x3d,0x20,0x5f,0x32,0x39,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x37,0x29,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69, | |
0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x34,0x20,0x5f,0x33,0x30,0x33,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x20,0x5f,0x33,0x30,0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x30,0x33, | |
0x20,0x2a,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x29, | |
0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x30, | |
0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, | |
0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x33,0x30,0x39,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x33,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d, | |
0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c, | |
0x20,0x69,0x6e,0x2e,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x33,0x35,0x20,0x3d,0x20,0x69,0x6e,0x74, | |
0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x7a, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x35,0x20, | |
0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x79,0x7a, | |
0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x2c,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x35,0x20,0x3d,0x3d,0x20, | |
0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d, | |
0x20,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32, | |
0x29,0x20,0x2a,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x6f,0x75,0x74,0x43,0x6f,0x6c, | |
0x6f,0x72,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a, | |
0x00, | |
}; | |
#endif | |
/* | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct viewSize | |
{ | |
float4 _viewSize; | |
}; | |
struct main0_out | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
float4 gl_Position [[position]]; | |
}; | |
struct main0_in | |
{ | |
float2 vertex0 [[attribute(0)]]; | |
float2 tcoord [[attribute(1)]]; | |
}; | |
vertex main0_out main0(main0_in in [[stage_in]], constant viewSize& _28 [[buffer(0)]]) | |
{ | |
main0_out out = {}; | |
out.ftcoord = in.tcoord; | |
out.fpos = in.vertex0; | |
out.gl_Position = float4(((2.0 * in.vertex0.x) / _28._viewSize.x) - 1.0, 1.0 - ((2.0 * in.vertex0.y) / _28._viewSize.y), 0.0, 1.0); | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_vs_source_metal_ios[665] = { | |
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,0x76, | |
0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x20,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,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,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, | |
0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b, | |
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, | |
0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x32,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x30,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,0x63,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b, | |
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,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,0x76,0x69, | |
0x65,0x77,0x53,0x69,0x7a,0x65,0x26,0x20,0x5f,0x32,0x38,0x20,0x5b,0x5b,0x62,0x75, | |
0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d, | |
0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x74,0x63, | |
0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x70,0x6f,0x73,0x20,0x3d, | |
0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x32,0x2e,0x30,0x20, | |
0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x2e,0x78,0x29,0x20, | |
0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e, | |
0x78,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20, | |
0x28,0x28,0x32,0x2e,0x30,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65, | |
0x78,0x30,0x2e,0x79,0x29,0x20,0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65, | |
0x77,0x53,0x69,0x7a,0x65,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, | |
0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, | |
0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#pragma clang diagnostic ignored "-Wmissing-prototypes" | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct frag | |
{ | |
float4 dummy[11]; | |
}; | |
struct main0_out | |
{ | |
float4 outColor [[color(0)]]; | |
}; | |
struct main0_in | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
}; | |
static inline __attribute__((always_inline)) | |
float scissorMask(thread const float2& p, constant frag& _56) | |
{ | |
float2 _106 = fma(-(abs((float3x3(float3(_56.dummy[0].xyz), float3(_56.dummy[1].xyz), float3(_56.dummy[2].xyz)) * float3(p, 1.0)).xy) - _56.dummy[8].xy), _56.dummy[8].zw, float2(0.5)); | |
return fast::clamp(_106.x, 0.0, 1.0) * fast::clamp(_106.y, 0.0, 1.0); | |
} | |
static inline __attribute__((always_inline)) | |
float sdroundrect(thread const float2& pt, thread const float2& ext, thread const float& rad) | |
{ | |
float2 _30 = abs(pt) - (ext - float2(rad, rad)); | |
return (fast::min(fast::max(_30.x, _30.y), 0.0) + length(fast::max(_30, float2(0.0)))) - rad; | |
} | |
fragment main0_out main0(main0_in in [[stage_in]], constant frag& _56 [[buffer(0)]], texture2d<float> tex [[texture(0)]], sampler smp [[sampler(0)]]) | |
{ | |
main0_out out = {}; | |
float2 param = in.fpos; | |
float _122 = scissorMask(param, _56); | |
if (_122 == 0.0) | |
{ | |
return out; | |
} | |
int _134 = int(_56.dummy[10].w); | |
float4 result; | |
if (_134 == 0) | |
{ | |
float2 param_1 = (float3x3(float3(_56.dummy[3].xyz), float3(_56.dummy[4].xyz), float3(_56.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy; | |
float2 param_2 = _56.dummy[9].xy; | |
float param_3 = _56.dummy[9].z; | |
result = mix(_56.dummy[6], _56.dummy[7], float4(fast::clamp(fma(_56.dummy[9].w, 0.5, sdroundrect(param_1, param_2, param_3)) / _56.dummy[9].w, 0.0, 1.0))) * _122; | |
} | |
else | |
{ | |
if (_134 == 1) | |
{ | |
float4 color = tex.sample(smp, ((float3x3(float3(_56.dummy[3].xyz), float3(_56.dummy[4].xyz), float3(_56.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy / _56.dummy[9].xy)); | |
int _264 = int(_56.dummy[10].z); | |
if (_264 == 1) | |
{ | |
color = float4(color.xyz * color.w, color.w); | |
} | |
if (_264 == 2) | |
{ | |
color = float4(color.x); | |
} | |
bool _291 = _264 == 3; | |
bool _297; | |
if (_291) | |
{ | |
_297 = color.w == 1.0; | |
} | |
else | |
{ | |
_297 = _291; | |
} | |
if (_297) | |
{ | |
discard_fragment(); | |
} | |
float4 _303 = color; | |
float4 _309 = (_303 * _56.dummy[6]) * _122; | |
color = _309; | |
result = _309; | |
} | |
else | |
{ | |
if (_134 == 2) | |
{ | |
result = float4(1.0); | |
} | |
else | |
{ | |
if (_134 == 3) | |
{ | |
float4 color_1 = tex.sample(smp, in.ftcoord); | |
int _335 = int(_56.dummy[10].z); | |
if (_335 == 1) | |
{ | |
color_1 = float4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_335 == 2) | |
{ | |
color_1 = float4(color_1.x); | |
} | |
result = (color_1 * _122) * _56.dummy[6]; | |
} | |
} | |
} | |
} | |
out.outColor = result; | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_fs_source_metal_ios[3473] = { | |
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,0x66,0x72,0x61,0x67,0x0a,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x31,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, | |
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75,0x74,0x43,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,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c, | |
0x6f,0x63,0x6e,0x31,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, | |
0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x70,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61, | |
0x67,0x26,0x20,0x5f,0x35,0x36,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x30,0x36,0x20,0x3d,0x20,0x66,0x6d,0x61,0x28, | |
0x2d,0x28,0x61,0x62,0x73,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x70,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e, | |
0x78,0x79,0x29,0x20,0x2d,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x38,0x5d,0x2e,0x78,0x79,0x29,0x2c,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x38,0x5d,0x2e,0x7a,0x77,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, | |
0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, | |
0x6e,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x36,0x2e,0x78,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20, | |
0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x36,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,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,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65, | |
0x63,0x74,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x70,0x74,0x2c,0x20,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x65,0x78,0x74,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,0x29,0x0a,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x33,0x30,0x20, | |
0x3d,0x20,0x61,0x62,0x73,0x28,0x70,0x74,0x29,0x20,0x2d,0x20,0x28,0x65,0x78,0x74, | |
0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x2c,0x20,0x72, | |
0x61,0x64,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, | |
0x20,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x66,0x61,0x73,0x74, | |
0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x30,0x2e,0x78,0x2c,0x20,0x5f,0x33,0x30, | |
0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67, | |
0x74,0x68,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x30, | |
0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x29, | |
0x20,0x2d,0x20,0x72,0x61,0x64,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,0x63,0x6f, | |
0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61,0x67,0x26,0x20,0x5f,0x35,0x36, | |
0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,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,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x69,0x6e, | |
0x2e,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x20,0x5f,0x31,0x32,0x32,0x20,0x3d,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d, | |
0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x5f,0x35,0x36,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x32,0x20,0x3d,0x3d, | |
0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31, | |
0x33,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, | |
0x6c,0x6f,0x61,0x74,0x34,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x30,0x29, | |
0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, | |
0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, | |
0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x35, | |
0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e, | |
0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x35,0x36, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, | |
0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x39,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, | |
0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x2c,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x37,0x5d,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x66,0x61, | |
0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x66,0x6d,0x61,0x28,0x5f,0x35, | |
0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e, | |
0x35,0x2c,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63,0x74,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,0x20,0x2f,0x20,0x5f,0x35,0x36, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e,0x30, | |
0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, | |
0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20, | |
0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70, | |
0x2c,0x20,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f, | |
0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d, | |
0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35, | |
0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x33,0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30, | |
0x29,0x29,0x2e,0x78,0x79,0x20,0x2f,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x36,0x34,0x20, | |
0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d,0x20, | |
0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28, | |
0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x36, | |
0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32, | |
0x39,0x31,0x20,0x3d,0x20,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c, | |
0x20,0x5f,0x32,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x31,0x29,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x39,0x37,0x20, | |
0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f, | |
0x32,0x39,0x37,0x20,0x3d,0x20,0x5f,0x32,0x39,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x37,0x29,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69, | |
0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x34,0x20,0x5f,0x33,0x30,0x33,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x20,0x5f,0x33,0x30,0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x30,0x33, | |
0x20,0x2a,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x29, | |
0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x30, | |
0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, | |
0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x33,0x30,0x39,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x33,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d, | |
0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c, | |
0x20,0x69,0x6e,0x2e,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x33,0x35,0x20,0x3d,0x20,0x69,0x6e,0x74, | |
0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x7a, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x35,0x20, | |
0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x79,0x7a, | |
0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x2c,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x35,0x20,0x3d,0x3d,0x20, | |
0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d, | |
0x20,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32, | |
0x29,0x20,0x2a,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x6f,0x75,0x74,0x43,0x6f,0x6c, | |
0x6f,0x72,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a, | |
0x00, | |
}; | |
#endif | |
/* | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct viewSize | |
{ | |
float4 _viewSize; | |
}; | |
struct main0_out | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
float4 gl_Position [[position]]; | |
}; | |
struct main0_in | |
{ | |
float2 vertex0 [[attribute(0)]]; | |
float2 tcoord [[attribute(1)]]; | |
}; | |
vertex main0_out main0(main0_in in [[stage_in]], constant viewSize& _28 [[buffer(0)]]) | |
{ | |
main0_out out = {}; | |
out.ftcoord = in.tcoord; | |
out.fpos = in.vertex0; | |
out.gl_Position = float4(((2.0 * in.vertex0.x) / _28._viewSize.x) - 1.0, 1.0 - ((2.0 * in.vertex0.y) / _28._viewSize.y), 0.0, 1.0); | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_vs_source_metal_sim[665] = { | |
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,0x76, | |
0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x20,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,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,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, | |
0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b, | |
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, | |
0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x32,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x30,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,0x63,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b, | |
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,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,0x76,0x69, | |
0x65,0x77,0x53,0x69,0x7a,0x65,0x26,0x20,0x5f,0x32,0x38,0x20,0x5b,0x5b,0x62,0x75, | |
0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d, | |
0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x74,0x63, | |
0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x70,0x6f,0x73,0x20,0x3d, | |
0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x32,0x2e,0x30,0x20, | |
0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x2e,0x78,0x29,0x20, | |
0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e, | |
0x78,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20, | |
0x28,0x28,0x32,0x2e,0x30,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65, | |
0x78,0x30,0x2e,0x79,0x29,0x20,0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65, | |
0x77,0x53,0x69,0x7a,0x65,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, | |
0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, | |
0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#pragma clang diagnostic ignored "-Wmissing-prototypes" | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct frag | |
{ | |
float4 dummy[11]; | |
}; | |
struct main0_out | |
{ | |
float4 outColor [[color(0)]]; | |
}; | |
struct main0_in | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
}; | |
static inline __attribute__((always_inline)) | |
float scissorMask(thread const float2& p, constant frag& _56) | |
{ | |
float2 _106 = fma(-(abs((float3x3(float3(_56.dummy[0].xyz), float3(_56.dummy[1].xyz), float3(_56.dummy[2].xyz)) * float3(p, 1.0)).xy) - _56.dummy[8].xy), _56.dummy[8].zw, float2(0.5)); | |
return fast::clamp(_106.x, 0.0, 1.0) * fast::clamp(_106.y, 0.0, 1.0); | |
} | |
static inline __attribute__((always_inline)) | |
float sdroundrect(thread const float2& pt, thread const float2& ext, thread const float& rad) | |
{ | |
float2 _30 = abs(pt) - (ext - float2(rad, rad)); | |
return (fast::min(fast::max(_30.x, _30.y), 0.0) + length(fast::max(_30, float2(0.0)))) - rad; | |
} | |
fragment main0_out main0(main0_in in [[stage_in]], constant frag& _56 [[buffer(0)]], texture2d<float> tex [[texture(0)]], sampler smp [[sampler(0)]]) | |
{ | |
main0_out out = {}; | |
float2 param = in.fpos; | |
float _122 = scissorMask(param, _56); | |
if (_122 == 0.0) | |
{ | |
return out; | |
} | |
int _134 = int(_56.dummy[10].w); | |
float4 result; | |
if (_134 == 0) | |
{ | |
float2 param_1 = (float3x3(float3(_56.dummy[3].xyz), float3(_56.dummy[4].xyz), float3(_56.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy; | |
float2 param_2 = _56.dummy[9].xy; | |
float param_3 = _56.dummy[9].z; | |
result = mix(_56.dummy[6], _56.dummy[7], float4(fast::clamp(fma(_56.dummy[9].w, 0.5, sdroundrect(param_1, param_2, param_3)) / _56.dummy[9].w, 0.0, 1.0))) * _122; | |
} | |
else | |
{ | |
if (_134 == 1) | |
{ | |
float4 color = tex.sample(smp, ((float3x3(float3(_56.dummy[3].xyz), float3(_56.dummy[4].xyz), float3(_56.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy / _56.dummy[9].xy)); | |
int _264 = int(_56.dummy[10].z); | |
if (_264 == 1) | |
{ | |
color = float4(color.xyz * color.w, color.w); | |
} | |
if (_264 == 2) | |
{ | |
color = float4(color.x); | |
} | |
bool _291 = _264 == 3; | |
bool _297; | |
if (_291) | |
{ | |
_297 = color.w == 1.0; | |
} | |
else | |
{ | |
_297 = _291; | |
} | |
if (_297) | |
{ | |
discard_fragment(); | |
} | |
float4 _303 = color; | |
float4 _309 = (_303 * _56.dummy[6]) * _122; | |
color = _309; | |
result = _309; | |
} | |
else | |
{ | |
if (_134 == 2) | |
{ | |
result = float4(1.0); | |
} | |
else | |
{ | |
if (_134 == 3) | |
{ | |
float4 color_1 = tex.sample(smp, in.ftcoord); | |
int _335 = int(_56.dummy[10].z); | |
if (_335 == 1) | |
{ | |
color_1 = float4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_335 == 2) | |
{ | |
color_1 = float4(color_1.x); | |
} | |
result = (color_1 * _122) * _56.dummy[6]; | |
} | |
} | |
} | |
} | |
out.outColor = result; | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_fs_source_metal_sim[3473] = { | |
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,0x66,0x72,0x61,0x67,0x0a,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x31,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, | |
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75,0x74,0x43,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,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c, | |
0x6f,0x63,0x6e,0x31,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, | |
0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x70,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61, | |
0x67,0x26,0x20,0x5f,0x35,0x36,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x30,0x36,0x20,0x3d,0x20,0x66,0x6d,0x61,0x28, | |
0x2d,0x28,0x61,0x62,0x73,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x70,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e, | |
0x78,0x79,0x29,0x20,0x2d,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x38,0x5d,0x2e,0x78,0x79,0x29,0x2c,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x38,0x5d,0x2e,0x7a,0x77,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, | |
0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, | |
0x6e,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x36,0x2e,0x78,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20, | |
0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x36,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,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,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65, | |
0x63,0x74,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x70,0x74,0x2c,0x20,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x65,0x78,0x74,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,0x29,0x0a,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x33,0x30,0x20, | |
0x3d,0x20,0x61,0x62,0x73,0x28,0x70,0x74,0x29,0x20,0x2d,0x20,0x28,0x65,0x78,0x74, | |
0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x2c,0x20,0x72, | |
0x61,0x64,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, | |
0x20,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x66,0x61,0x73,0x74, | |
0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x30,0x2e,0x78,0x2c,0x20,0x5f,0x33,0x30, | |
0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67, | |
0x74,0x68,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x30, | |
0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x29, | |
0x20,0x2d,0x20,0x72,0x61,0x64,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,0x63,0x6f, | |
0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61,0x67,0x26,0x20,0x5f,0x35,0x36, | |
0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,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,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x69,0x6e, | |
0x2e,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x20,0x5f,0x31,0x32,0x32,0x20,0x3d,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d, | |
0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x5f,0x35,0x36,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x32,0x20,0x3d,0x3d, | |
0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31, | |
0x33,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, | |
0x6c,0x6f,0x61,0x74,0x34,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x30,0x29, | |
0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, | |
0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, | |
0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x35, | |
0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e, | |
0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x35,0x36, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, | |
0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x39,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, | |
0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x2c,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x37,0x5d,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x66,0x61, | |
0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x66,0x6d,0x61,0x28,0x5f,0x35, | |
0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e, | |
0x35,0x2c,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63,0x74,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,0x20,0x2f,0x20,0x5f,0x35,0x36, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e,0x30, | |
0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, | |
0x20,0x28,0x5f,0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20, | |
0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70, | |
0x2c,0x20,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f, | |
0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d, | |
0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35, | |
0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x33,0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30, | |
0x29,0x29,0x2e,0x78,0x79,0x20,0x2f,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x36,0x34,0x20, | |
0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d,0x20, | |
0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28, | |
0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x36, | |
0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32, | |
0x39,0x31,0x20,0x3d,0x20,0x5f,0x32,0x36,0x34,0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c, | |
0x20,0x5f,0x32,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x31,0x29,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x39,0x37,0x20, | |
0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f, | |
0x32,0x39,0x37,0x20,0x3d,0x20,0x5f,0x32,0x39,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x37,0x29,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69, | |
0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x34,0x20,0x5f,0x33,0x30,0x33,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x20,0x5f,0x33,0x30,0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x30,0x33, | |
0x20,0x2a,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x29, | |
0x20,0x2a,0x20,0x5f,0x31,0x32,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x30, | |
0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, | |
0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x33,0x30,0x39,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x31,0x33,0x34,0x20,0x3d,0x3d,0x20,0x33,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d, | |
0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c, | |
0x20,0x69,0x6e,0x2e,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x33,0x35,0x20,0x3d,0x20,0x69,0x6e,0x74, | |
0x28,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x7a, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x35,0x20, | |
0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x79,0x7a, | |
0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x2c,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x33,0x35,0x20,0x3d,0x3d,0x20, | |
0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d, | |
0x20,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x2a,0x20,0x5f,0x31,0x32,0x32, | |
0x29,0x20,0x2a,0x20,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x6f,0x75,0x74,0x43,0x6f,0x6c, | |
0x6f,0x72,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a, | |
0x00, | |
}; | |
#endif | |
/* | |
diagnostic(off, derivative_uniformity); | |
struct viewSize { | |
/_ @offset(0) _/ | |
x_viewSize : vec4f, | |
} | |
var<private> ftcoord : vec2f; | |
var<private> tcoord : vec2f; | |
var<private> fpos : vec2f; | |
var<private> vertex_1 : vec2f; | |
@group(0) @binding(0) var<uniform> x_28 : viewSize; | |
var<private> gl_Position : vec4f; | |
fn main_1() { | |
var x : f32; | |
var y : f32; | |
let x_12 : vec2f = tcoord; | |
ftcoord = x_12; | |
let x_15 : vec2f = vertex_1; | |
fpos = x_15; | |
let x_23 : f32 = vertex_1.x; | |
let x_33 : f32 = x_28.x_viewSize.x; | |
x = (((2.0f * x_23) / x_33) - 1.0f); | |
let x_40 : f32 = vertex_1.y; | |
let x_43 : f32 = x_28.x_viewSize.y; | |
y = (1.0f - ((2.0f * x_40) / x_43)); | |
let x_50 : f32 = x; | |
let x_51 : f32 = y; | |
gl_Position = vec4f(x_50, x_51, 0.0f, 1.0f); | |
return; | |
} | |
struct main_out { | |
@location(0) | |
ftcoord_1 : vec2f, | |
@location(1) | |
fpos_1 : vec2f, | |
@builtin(position) | |
gl_Position : vec4f, | |
} | |
@vertex | |
fn main(@location(1) tcoord_param : vec2f, @location(0) vertex_1_param : vec2f) -> main_out { | |
tcoord = tcoord_param; | |
vertex_1 = vertex_1_param; | |
main_1(); | |
return main_out(ftcoord, fpos, gl_Position); | |
} | |
*/ | |
#if defined(SOKOL_WGPU) | |
static const uint8_t nanovg_vs_source_wgsl[1122] = { | |
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, | |
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, | |
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, | |
0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,0x20, | |
0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,0x20, | |
0x78,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x20,0x3a,0x20,0x76,0x65,0x63, | |
0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61, | |
0x74,0x65,0x3e,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74, | |
0x65,0x3e,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x76,0x65,0x63,0x32, | |
0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e, | |
0x20,0x66,0x70,0x6f,0x73,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a, | |
0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x76,0x65,0x72, | |
0x74,0x65,0x78,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a, | |
0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69, | |
0x6e,0x67,0x28,0x30,0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72, | |
0x6d,0x3e,0x20,0x78,0x5f,0x32,0x38,0x20,0x3a,0x20,0x76,0x69,0x65,0x77,0x53,0x69, | |
0x7a,0x65,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65, | |
0x3e,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f, | |
0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x78,0x20,0x3a,0x20, | |
0x66,0x33,0x32,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x79,0x20,0x3a,0x20,0x66, | |
0x33,0x32,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x32,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b, | |
0x0a,0x20,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x78,0x5f,0x31, | |
0x32,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x35,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31, | |
0x3b,0x0a,0x20,0x20,0x66,0x70,0x6f,0x73,0x20,0x3d,0x20,0x78,0x5f,0x31,0x35,0x3b, | |
0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x33,0x20,0x3a,0x20,0x66,0x33, | |
0x32,0x20,0x3d,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31,0x2e,0x78,0x3b,0x0a, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x33,0x20,0x3a,0x20,0x66,0x33,0x32, | |
0x20,0x3d,0x20,0x78,0x5f,0x32,0x38,0x2e,0x78,0x5f,0x76,0x69,0x65,0x77,0x53,0x69, | |
0x7a,0x65,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x78,0x20,0x3d,0x20,0x28,0x28,0x28,0x32, | |
0x2e,0x30,0x66,0x20,0x2a,0x20,0x78,0x5f,0x32,0x33,0x29,0x20,0x2f,0x20,0x78,0x5f, | |
0x33,0x33,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x34,0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20, | |
0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x34,0x33,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78, | |
0x5f,0x32,0x38,0x2e,0x78,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e,0x79, | |
0x3b,0x0a,0x20,0x20,0x79,0x20,0x3d,0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20, | |
0x28,0x28,0x32,0x2e,0x30,0x66,0x20,0x2a,0x20,0x78,0x5f,0x34,0x30,0x29,0x20,0x2f, | |
0x20,0x78,0x5f,0x34,0x33,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, | |
0x5f,0x35,0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x3b,0x0a,0x20, | |
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x31,0x20,0x3a,0x20,0x66,0x33,0x32,0x20, | |
0x3d,0x20,0x79,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, | |
0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x35,0x30,0x2c, | |
0x20,0x78,0x5f,0x35,0x31,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30, | |
0x66,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a, | |
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74, | |
0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30, | |
0x29,0x0a,0x20,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x5f,0x31,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x32,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69, | |
0x6f,0x6e,0x28,0x31,0x29,0x0a,0x20,0x20,0x66,0x70,0x6f,0x73,0x5f,0x31,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x0a,0x20,0x20,0x40,0x62,0x75,0x69,0x6c,0x74, | |
0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x67, | |
0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63, | |
0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x76,0x65,0x72,0x74,0x65,0x78,0x0a,0x66, | |
0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, | |
0x28,0x31,0x29,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74, | |
0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31,0x5f, | |
0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x29,0x20,0x2d, | |
0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x74, | |
0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x5f,0x70, | |
0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31, | |
0x20,0x3d,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61, | |
0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20, | |
0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74, | |
0x28,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x2c,0x20,0x66,0x70,0x6f,0x73,0x2c,0x20, | |
0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a, | |
0x0a,0x00, | |
}; | |
#endif | |
/* | |
diagnostic(off, derivative_uniformity); | |
alias Arr = array<vec4f, 11u>; | |
struct frag { | |
/_ @offset(0) _/ | |
dummy : Arr, | |
} | |
@group(0) @binding(4) var<uniform> x_56 : frag; | |
var<private> fpos : vec2f; | |
@group(1) @binding(48) var tex : texture_2d<f32>; | |
@group(1) @binding(64) var smp : sampler; | |
var<private> ftcoord : vec2f; | |
var<private> outColor : vec4f; | |
fn scissorMask_vf2_(p : ptr<function, vec2f>) -> f32 { | |
var sc : vec2f; | |
let x_62 : vec4f = x_56.dummy[0i]; | |
let x_63 : vec3f = vec3f(x_62.x, x_62.y, x_62.z); | |
let x_66 : vec4f = x_56.dummy[1i]; | |
let x_67 : vec3f = vec3f(x_66.x, x_66.y, x_66.z); | |
let x_70 : vec4f = x_56.dummy[2i]; | |
let x_71 : vec3f = vec3f(x_70.x, x_70.y, x_70.z); | |
let x_87 : vec2f = *(p); | |
let x_91 : vec3f = (mat3x3f(vec3f(x_63.x, x_63.y, x_63.z), vec3f(x_67.x, x_67.y, x_67.z), vec3f(x_71.x, x_71.y, x_71.z)) * vec3f(x_87.x, x_87.y, 1.0f)); | |
let x_96 : vec4f = x_56.dummy[8i]; | |
sc = (abs(vec2f(x_91.x, x_91.y)) - vec2f(x_96.x, x_96.y)); | |
let x_101 : vec2f = sc; | |
let x_103 : vec4f = x_56.dummy[8i]; | |
sc = (vec2f(0.5f, 0.5f) - (x_101 * vec2f(x_103.z, x_103.w))); | |
let x_108 : f32 = sc.x; | |
let x_111 : f32 = sc.y; | |
return (clamp(x_108, 0.0f, 1.0f) * clamp(x_111, 0.0f, 1.0f)); | |
} | |
fn sdroundrect_vf2_vf2_f1_(pt : ptr<function, vec2f>, ext : ptr<function, vec2f>, rad : ptr<function, f32>) -> f32 { | |
var ext2 : vec2f; | |
var d : vec2f; | |
let x_21 : vec2f = *(ext); | |
let x_22 : f32 = *(rad); | |
let x_23 : f32 = *(rad); | |
ext2 = (x_21 - vec2f(x_22, x_23)); | |
let x_27 : vec2f = *(pt); | |
let x_29 : vec2f = ext2; | |
d = (abs(x_27) - x_29); | |
let x_34 : f32 = d.x; | |
let x_37 : f32 = d.y; | |
let x_41 : vec2f = d; | |
let x_46 : f32 = *(rad); | |
return ((min(max(x_34, x_37), 0.0f) + length(max(x_41, vec2f(0.0f, 0.0f)))) - x_46); | |
} | |
fn main_1() { | |
var strokeAlpha : f32; | |
var scissor : f32; | |
var param : vec2f; | |
var pt_1 : vec2f; | |
var d_1 : f32; | |
var param_1 : vec2f; | |
var param_2 : vec2f; | |
var param_3 : f32; | |
var color : vec4f; | |
var result : vec4f; | |
var pt_2 : vec2f; | |
var color_1 : vec4f; | |
var color_2 : vec4f; | |
strokeAlpha = 1.0f; | |
let x_121 : vec2f = fpos; | |
param = x_121; | |
let x_122 : f32 = scissorMask_vf2_(&(param)); | |
scissor = x_122; | |
let x_123 : f32 = scissor; | |
if ((x_123 == 0.0f)) { | |
return; | |
} | |
let x_133 : f32 = x_56.dummy[10i].w; | |
if ((i32(x_133) == 0i)) { | |
let x_141 : vec4f = x_56.dummy[3i]; | |
let x_142 : vec3f = vec3f(x_141.x, x_141.y, x_141.z); | |
let x_145 : vec4f = x_56.dummy[4i]; | |
let x_146 : vec3f = vec3f(x_145.x, x_145.y, x_145.z); | |
let x_149 : vec4f = x_56.dummy[5i]; | |
let x_150 : vec3f = vec3f(x_149.x, x_149.y, x_149.z); | |
let x_164 : vec2f = fpos; | |
let x_168 : vec3f = (mat3x3f(vec3f(x_142.x, x_142.y, x_142.z), vec3f(x_146.x, x_146.y, x_146.z), vec3f(x_150.x, x_150.y, x_150.z)) * vec3f(x_164.x, x_164.y, 1.0f)); | |
pt_1 = vec2f(x_168.x, x_168.y); | |
let x_173 : vec2f = pt_1; | |
param_1 = x_173; | |
let x_176 : vec4f = x_56.dummy[9i]; | |
param_2 = vec2f(x_176.x, x_176.y); | |
let x_181 : f32 = x_56.dummy[9i].z; | |
param_3 = x_181; | |
let x_182 : f32 = sdroundrect_vf2_vf2_f1_(&(param_1), &(param_2), &(param_3)); | |
let x_184 : f32 = x_56.dummy[9i].w; | |
let x_188 : f32 = x_56.dummy[9i].w; | |
d_1 = clamp(((x_182 + (x_184 * 0.5f)) / x_188), 0.0f, 1.0f); | |
let x_195 : vec4f = x_56.dummy[6i]; | |
let x_198 : vec4f = x_56.dummy[7i]; | |
let x_199 : f32 = d_1; | |
color = mix(x_195, x_198, vec4f(x_199, x_199, x_199, x_199)); | |
let x_202 : f32 = strokeAlpha; | |
let x_203 : f32 = scissor; | |
let x_205 : vec4f = color; | |
color = (x_205 * (x_202 * x_203)); | |
let x_208 : vec4f = color; | |
result = x_208; | |
} else { | |
var x_296 : bool; | |
var x_297 : bool; | |
let x_211 : f32 = x_56.dummy[10i].w; | |
if ((i32(x_211) == 1i)) { | |
let x_218 : vec4f = x_56.dummy[3i]; | |
let x_219 : vec3f = vec3f(x_218.x, x_218.y, x_218.z); | |
let x_221 : vec4f = x_56.dummy[4i]; | |
let x_222 : vec3f = vec3f(x_221.x, x_221.y, x_221.z); | |
let x_224 : vec4f = x_56.dummy[5i]; | |
let x_225 : vec3f = vec3f(x_224.x, x_224.y, x_224.z); | |
let x_239 : vec2f = fpos; | |
let x_243 : vec3f = (mat3x3f(vec3f(x_219.x, x_219.y, x_219.z), vec3f(x_222.x, x_222.y, x_222.z), vec3f(x_225.x, x_225.y, x_225.z)) * vec3f(x_239.x, x_239.y, 1.0f)); | |
let x_246 : vec4f = x_56.dummy[9i]; | |
pt_2 = (vec2f(x_243.x, x_243.y) / vec2f(x_246.x, x_246.y)); | |
let x_260 : vec2f = pt_2; | |
let x_261 : vec4f = textureSample(tex, smp, x_260); | |
color_1 = x_261; | |
let x_263 : f32 = x_56.dummy[10i].z; | |
if ((i32(x_263) == 1i)) { | |
let x_268 : vec4f = color_1; | |
let x_271 : f32 = color_1.w; | |
let x_272 : vec3f = (vec3f(x_268.x, x_268.y, x_268.z) * x_271); | |
let x_274 : f32 = color_1.w; | |
color_1 = vec4f(x_272.x, x_272.y, x_272.z, x_274); | |
} | |
let x_280 : f32 = x_56.dummy[10i].z; | |
if ((i32(x_280) == 2i)) { | |
let x_286 : f32 = color_1.x; | |
color_1 = vec4f(x_286, x_286, x_286, x_286); | |
} | |
let x_289 : f32 = x_56.dummy[10i].z; | |
let x_291 : bool = (i32(x_289) == 3i); | |
x_297 = x_291; | |
if (x_291) { | |
let x_295 : f32 = color_1.w; | |
x_296 = (x_295 == 1.0f); | |
x_297 = x_296; | |
} | |
if (x_297) { | |
discard; | |
} | |
let x_302 : vec4f = x_56.dummy[6i]; | |
let x_303 : vec4f = color_1; | |
color_1 = (x_303 * x_302); | |
let x_305 : f32 = strokeAlpha; | |
let x_306 : f32 = scissor; | |
let x_308 : vec4f = color_1; | |
color_1 = (x_308 * (x_305 * x_306)); | |
let x_310 : vec4f = color_1; | |
result = x_310; | |
} else { | |
let x_313 : f32 = x_56.dummy[10i].w; | |
if ((i32(x_313) == 2i)) { | |
result = vec4f(1.0f, 1.0f, 1.0f, 1.0f); | |
} else { | |
let x_321 : f32 = x_56.dummy[10i].w; | |
if ((i32(x_321) == 3i)) { | |
let x_331 : vec2f = ftcoord; | |
let x_332 : vec4f = textureSample(tex, smp, x_331); | |
color_2 = x_332; | |
let x_334 : f32 = x_56.dummy[10i].z; | |
if ((i32(x_334) == 1i)) { | |
let x_339 : vec4f = color_2; | |
let x_342 : f32 = color_2.w; | |
let x_343 : vec3f = (vec3f(x_339.x, x_339.y, x_339.z) * x_342); | |
let x_345 : f32 = color_2.w; | |
color_2 = vec4f(x_343.x, x_343.y, x_343.z, x_345); | |
} | |
let x_351 : f32 = x_56.dummy[10i].z; | |
if ((i32(x_351) == 2i)) { | |
let x_357 : f32 = color_2.x; | |
color_2 = vec4f(x_357, x_357, x_357, x_357); | |
} | |
let x_359 : vec4f = color_2; | |
let x_360 : f32 = scissor; | |
let x_363 : vec4f = x_56.dummy[6i]; | |
result = ((x_359 * x_360) * x_363); | |
} | |
} | |
} | |
} | |
let x_367 : vec4f = result; | |
outColor = x_367; | |
return; | |
} | |
struct main_out { | |
@location(0) | |
outColor_1 : vec4f, | |
} | |
@fragment | |
fn main(@location(1) fpos_param : vec2f, @location(0) ftcoord_param : vec2f) -> main_out { | |
fpos = fpos_param; | |
ftcoord = ftcoord_param; | |
main_1(); | |
return main_out(outColor); | |
} | |
*/ | |
#if defined(SOKOL_WGPU) | |
static const uint8_t nanovg_fs_source_wgsl[7003] = { | |
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, | |
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, | |
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x61,0x6c,0x69,0x61,0x73,0x20,0x41, | |
0x72,0x72,0x20,0x3d,0x20,0x61,0x72,0x72,0x61,0x79,0x3c,0x76,0x65,0x63,0x34,0x66, | |
0x2c,0x20,0x31,0x31,0x75,0x3e,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, | |
0x66,0x72,0x61,0x67,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66, | |
0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,0x20,0x64,0x75,0x6d,0x6d, | |
0x79,0x20,0x3a,0x20,0x41,0x72,0x72,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x67,0x72,0x6f, | |
0x75,0x70,0x28,0x30,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x34, | |
0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78, | |
0x5f,0x35,0x36,0x20,0x3a,0x20,0x66,0x72,0x61,0x67,0x3b,0x0a,0x0a,0x76,0x61,0x72, | |
0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x70,0x6f,0x73,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28, | |
0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x34,0x38,0x29,0x20, | |
0x76,0x61,0x72,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x74,0x65,0x78,0x74,0x75,0x72, | |
0x65,0x5f,0x32,0x64,0x3c,0x66,0x33,0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f, | |
0x75,0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x36, | |
0x34,0x29,0x20,0x76,0x61,0x72,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x73,0x61,0x6d, | |
0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61, | |
0x74,0x65,0x3e,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74, | |
0x65,0x3e,0x20,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72, | |
0x4d,0x61,0x73,0x6b,0x5f,0x76,0x66,0x32,0x5f,0x28,0x70,0x20,0x3a,0x20,0x70,0x74, | |
0x72,0x3c,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76,0x65,0x63,0x32, | |
0x66,0x3e,0x29,0x20,0x2d,0x3e,0x20,0x66,0x33,0x32,0x20,0x7b,0x0a,0x20,0x20,0x76, | |
0x61,0x72,0x20,0x73,0x63,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x20, | |
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x34, | |
0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x30, | |
0x69,0x5d,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x33,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78, | |
0x5f,0x36,0x32,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x36,0x32,0x2e,0x79,0x2c,0x20,0x78, | |
0x5f,0x36,0x32,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x36,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35, | |
0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x36,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20, | |
0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x36,0x36,0x2e,0x78,0x2c,0x20, | |
0x78,0x5f,0x36,0x36,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x36,0x36,0x2e,0x7a,0x29,0x3b, | |
0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x30,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x32,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x31, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66, | |
0x28,0x78,0x5f,0x37,0x30,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x37,0x30,0x2e,0x79,0x2c, | |
0x20,0x78,0x5f,0x37,0x30,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20, | |
0x78,0x5f,0x38,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x2a, | |
0x28,0x70,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x31,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x28,0x6d,0x61,0x74,0x33,0x78, | |
0x33,0x66,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x36,0x33,0x2e,0x78,0x2c, | |
0x20,0x78,0x5f,0x36,0x33,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x36,0x33,0x2e,0x7a,0x29, | |
0x2c,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x36,0x37,0x2e,0x78,0x2c,0x20, | |
0x78,0x5f,0x36,0x37,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x36,0x37,0x2e,0x7a,0x29,0x2c, | |
0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x37,0x31,0x2e,0x78,0x2c,0x20,0x78, | |
0x5f,0x37,0x31,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x37,0x31,0x2e,0x7a,0x29,0x29,0x20, | |
0x2a,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x38,0x37,0x2e,0x78,0x2c,0x20, | |
0x78,0x5f,0x38,0x37,0x2e,0x79,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x29,0x3b,0x0a, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x36,0x20,0x3a,0x20,0x76,0x65,0x63, | |
0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x38,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x73,0x63,0x20,0x3d,0x20,0x28,0x61,0x62,0x73, | |
0x28,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x39,0x31,0x2e,0x78,0x2c,0x20,0x78, | |
0x5f,0x39,0x31,0x2e,0x79,0x29,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x66,0x28, | |
0x78,0x5f,0x39,0x36,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x39,0x36,0x2e,0x79,0x29,0x29, | |
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x30,0x31,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x73,0x63,0x3b,0x0a,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x31,0x30,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20, | |
0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x38,0x69,0x5d, | |
0x3b,0x0a,0x20,0x20,0x73,0x63,0x20,0x3d,0x20,0x28,0x76,0x65,0x63,0x32,0x66,0x28, | |
0x30,0x2e,0x35,0x66,0x2c,0x20,0x30,0x2e,0x35,0x66,0x29,0x20,0x2d,0x20,0x28,0x78, | |
0x5f,0x31,0x30,0x31,0x20,0x2a,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x31, | |
0x30,0x33,0x2e,0x7a,0x2c,0x20,0x78,0x5f,0x31,0x30,0x33,0x2e,0x77,0x29,0x29,0x29, | |
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x30,0x38,0x20,0x3a,0x20, | |
0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x63,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x31,0x31,0x31,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20, | |
0x73,0x63,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28, | |
0x63,0x6c,0x61,0x6d,0x70,0x28,0x78,0x5f,0x31,0x30,0x38,0x2c,0x20,0x30,0x2e,0x30, | |
0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x63,0x6c,0x61,0x6d,0x70, | |
0x28,0x78,0x5f,0x31,0x31,0x31,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e, | |
0x30,0x66,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6e,0x20,0x73,0x64,0x72,0x6f, | |
0x75,0x6e,0x64,0x72,0x65,0x63,0x74,0x5f,0x76,0x66,0x32,0x5f,0x76,0x66,0x32,0x5f, | |
0x66,0x31,0x5f,0x28,0x70,0x74,0x20,0x3a,0x20,0x70,0x74,0x72,0x3c,0x66,0x75,0x6e, | |
0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76,0x65,0x63,0x32,0x66,0x3e,0x2c,0x20,0x65, | |
0x78,0x74,0x20,0x3a,0x20,0x70,0x74,0x72,0x3c,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, | |
0x6e,0x2c,0x20,0x76,0x65,0x63,0x32,0x66,0x3e,0x2c,0x20,0x72,0x61,0x64,0x20,0x3a, | |
0x20,0x70,0x74,0x72,0x3c,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x66, | |
0x33,0x32,0x3e,0x29,0x20,0x2d,0x3e,0x20,0x66,0x33,0x32,0x20,0x7b,0x0a,0x20,0x20, | |
0x76,0x61,0x72,0x20,0x65,0x78,0x74,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66, | |
0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x64,0x20,0x3a,0x20,0x76,0x65,0x63,0x32, | |
0x66,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x31,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x2a,0x28,0x65,0x78,0x74,0x29,0x3b,0x0a, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x20,0x3a,0x20,0x66,0x33,0x32, | |
0x20,0x3d,0x20,0x2a,0x28,0x72,0x61,0x64,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x32,0x33,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x2a,0x28, | |
0x72,0x61,0x64,0x29,0x3b,0x0a,0x20,0x20,0x65,0x78,0x74,0x32,0x20,0x3d,0x20,0x28, | |
0x78,0x5f,0x32,0x31,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x32, | |
0x32,0x2c,0x20,0x78,0x5f,0x32,0x33,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x32,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20, | |
0x2a,0x28,0x70,0x74,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32, | |
0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x65,0x78,0x74,0x32, | |
0x3b,0x0a,0x20,0x20,0x64,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x78,0x5f,0x32, | |
0x37,0x29,0x20,0x2d,0x20,0x78,0x5f,0x32,0x39,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x33,0x34,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x64, | |
0x2e,0x78,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x37,0x20,0x3a, | |
0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x64,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x34,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d, | |
0x20,0x64,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x36,0x20,0x3a, | |
0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x2a,0x28,0x72,0x61,0x64,0x29,0x3b,0x0a,0x20, | |
0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x6d,0x69,0x6e,0x28,0x6d,0x61, | |
0x78,0x28,0x78,0x5f,0x33,0x34,0x2c,0x20,0x78,0x5f,0x33,0x37,0x29,0x2c,0x20,0x30, | |
0x2e,0x30,0x66,0x29,0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61, | |
0x78,0x28,0x78,0x5f,0x34,0x31,0x2c,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x30,0x2e, | |
0x30,0x66,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x29,0x29,0x29,0x20,0x2d,0x20,0x78, | |
0x5f,0x34,0x36,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e, | |
0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x73,0x74,0x72, | |
0x6f,0x6b,0x65,0x41,0x6c,0x70,0x68,0x61,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a, | |
0x20,0x20,0x76,0x61,0x72,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x20,0x3a,0x20, | |
0x66,0x33,0x32,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20, | |
0x70,0x74,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x20,0x20, | |
0x76,0x61,0x72,0x20,0x64,0x5f,0x31,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x20, | |
0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3a,0x20,0x76, | |
0x65,0x63,0x32,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61, | |
0x6d,0x5f,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x20,0x20,0x76, | |
0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3a,0x20,0x66,0x33,0x32, | |
0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x72,0x65,0x73, | |
0x75,0x6c,0x74,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x20,0x20,0x76, | |
0x61,0x72,0x20,0x70,0x74,0x5f,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b, | |
0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x20, | |
0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x41,0x6c,0x70,0x68,0x61,0x20,0x3d,0x20,0x31, | |
0x2e,0x30,0x66,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x32,0x31, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73,0x3b, | |
0x0a,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x31, | |
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x32,0x32,0x20,0x3a,0x20, | |
0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73, | |
0x6b,0x5f,0x76,0x66,0x32,0x5f,0x28,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x29, | |
0x3b,0x0a,0x20,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x20,0x3d,0x20,0x78,0x5f, | |
0x31,0x32,0x32,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x32,0x33, | |
0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72, | |
0x3b,0x0a,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x78,0x5f,0x31,0x32,0x33,0x20,0x3d, | |
0x3d,0x20,0x30,0x2e,0x30,0x66,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72, | |
0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x7d,0x0a,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x31,0x33,0x33,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78, | |
0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x77, | |
0x3b,0x0a,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x31, | |
0x33,0x33,0x29,0x20,0x3d,0x3d,0x20,0x30,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x34,0x31,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x33,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x31,0x34,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x65, | |
0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x34,0x31,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31, | |
0x34,0x31,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x34,0x31,0x2e,0x7a,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x34,0x35,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x34,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20, | |
0x78,0x5f,0x31,0x34,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20, | |
0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x34,0x35,0x2e,0x78,0x2c,0x20,0x78, | |
0x5f,0x31,0x34,0x35,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x34,0x35,0x2e,0x7a,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x34,0x39,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x35,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x31,0x35,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20, | |
0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x34,0x39,0x2e,0x78,0x2c, | |
0x20,0x78,0x5f,0x31,0x34,0x39,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x34,0x39,0x2e, | |
0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x36, | |
0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x36,0x38,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x28,0x6d,0x61,0x74,0x33,0x78, | |
0x33,0x66,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x34,0x32,0x2e,0x78, | |
0x2c,0x20,0x78,0x5f,0x31,0x34,0x32,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x34,0x32, | |
0x2e,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x34,0x36, | |
0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x34,0x36,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31, | |
0x34,0x36,0x2e,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31, | |
0x35,0x30,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x35,0x30,0x2e,0x79,0x2c,0x20,0x78, | |
0x5f,0x31,0x35,0x30,0x2e,0x7a,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x66, | |
0x28,0x78,0x5f,0x31,0x36,0x34,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x36,0x34,0x2e, | |
0x79,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70, | |
0x74,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x31,0x36, | |
0x38,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x36,0x38,0x2e,0x79,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x37,0x33,0x20,0x3a,0x20,0x76, | |
0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x70,0x74,0x5f,0x31,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x78,0x5f,0x31,0x37,0x33, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x37,0x36,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x39,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61, | |
0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f, | |
0x31,0x37,0x36,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x37,0x36,0x2e,0x79,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x38,0x31,0x20,0x3a, | |
0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x39,0x69,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72, | |
0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x78,0x5f,0x31,0x38,0x31,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x38,0x32,0x20,0x3a,0x20,0x66,0x33, | |
0x32,0x20,0x3d,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63,0x74,0x5f, | |
0x76,0x66,0x32,0x5f,0x76,0x66,0x32,0x5f,0x66,0x31,0x5f,0x28,0x26,0x28,0x70,0x61, | |
0x72,0x61,0x6d,0x5f,0x31,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, | |
0x32,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x29,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x38,0x34,0x20,0x3a, | |
0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x39,0x69,0x5d,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x31,0x38,0x38,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78, | |
0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x69,0x5d,0x2e,0x77,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x64,0x5f,0x31,0x20,0x3d,0x20,0x63,0x6c,0x61,0x6d,0x70, | |
0x28,0x28,0x28,0x78,0x5f,0x31,0x38,0x32,0x20,0x2b,0x20,0x28,0x78,0x5f,0x31,0x38, | |
0x34,0x20,0x2a,0x20,0x30,0x2e,0x35,0x66,0x29,0x29,0x20,0x2f,0x20,0x78,0x5f,0x31, | |
0x38,0x38,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x39,0x35,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x36,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x31,0x39,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20, | |
0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x37,0x69,0x5d, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x39,0x39,0x20, | |
0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x64,0x5f,0x31,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x78,0x5f,0x31, | |
0x39,0x35,0x2c,0x20,0x78,0x5f,0x31,0x39,0x38,0x2c,0x20,0x76,0x65,0x63,0x34,0x66, | |
0x28,0x78,0x5f,0x31,0x39,0x39,0x2c,0x20,0x78,0x5f,0x31,0x39,0x39,0x2c,0x20,0x78, | |
0x5f,0x31,0x39,0x39,0x2c,0x20,0x78,0x5f,0x31,0x39,0x39,0x29,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x30,0x32,0x20,0x3a,0x20,0x66, | |
0x33,0x32,0x20,0x3d,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x41,0x6c,0x70,0x68,0x61, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x30,0x33,0x20, | |
0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x30,0x35,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x28,0x78,0x5f,0x32, | |
0x30,0x35,0x20,0x2a,0x20,0x28,0x78,0x5f,0x32,0x30,0x32,0x20,0x2a,0x20,0x78,0x5f, | |
0x32,0x30,0x33,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, | |
0x5f,0x32,0x30,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74, | |
0x20,0x3d,0x20,0x78,0x5f,0x32,0x30,0x38,0x3b,0x0a,0x20,0x20,0x7d,0x20,0x65,0x6c, | |
0x73,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x61,0x72,0x20,0x78,0x5f,0x32, | |
0x39,0x36,0x20,0x3a,0x20,0x62,0x6f,0x6f,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, | |
0x61,0x72,0x20,0x78,0x5f,0x32,0x39,0x37,0x20,0x3a,0x20,0x62,0x6f,0x6f,0x6c,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x31,0x31,0x20,0x3a, | |
0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, | |
0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x32,0x31,0x31,0x29,0x20,0x3d,0x3d, | |
0x20,0x31,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x32,0x31,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20, | |
0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x69,0x5d, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x31, | |
0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x65,0x63,0x33, | |
0x66,0x28,0x78,0x5f,0x32,0x31,0x38,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x31,0x38, | |
0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x31,0x38,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x31,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x34,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x32,0x32,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20, | |
0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x32,0x31,0x2e,0x78,0x2c, | |
0x20,0x78,0x5f,0x32,0x32,0x31,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x32,0x31,0x2e, | |
0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x32,0x32,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f, | |
0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x35,0x69,0x5d,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x35,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f, | |
0x32,0x32,0x34,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x32,0x34,0x2e,0x79,0x2c,0x20, | |
0x78,0x5f,0x32,0x32,0x34,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x33,0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x32, | |
0x66,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x34,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x33, | |
0x66,0x20,0x3d,0x20,0x28,0x6d,0x61,0x74,0x33,0x78,0x33,0x66,0x28,0x76,0x65,0x63, | |
0x33,0x66,0x28,0x78,0x5f,0x32,0x31,0x39,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x31, | |
0x39,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x31,0x39,0x2e,0x7a,0x29,0x2c,0x20,0x76, | |
0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x32,0x32,0x2e,0x78,0x2c,0x20,0x78,0x5f, | |
0x32,0x32,0x32,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x32,0x32,0x2e,0x7a,0x29,0x2c, | |
0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x32,0x35,0x2e,0x78,0x2c,0x20, | |
0x78,0x5f,0x32,0x32,0x35,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x32,0x35,0x2e,0x7a, | |
0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x33,0x39, | |
0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x33,0x39,0x2e,0x79,0x2c,0x20,0x31,0x2e,0x30, | |
0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, | |
0x5f,0x32,0x34,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78, | |
0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x69,0x5d,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x70,0x74,0x5f,0x32,0x20,0x3d,0x20,0x28,0x76,0x65,0x63, | |
0x32,0x66,0x28,0x78,0x5f,0x32,0x34,0x33,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x34, | |
0x33,0x2e,0x79,0x29,0x20,0x2f,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x32, | |
0x34,0x36,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x34,0x36,0x2e,0x79,0x29,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x36,0x30, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x70,0x74,0x5f,0x32,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x36,0x31, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75, | |
0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x74,0x65,0x78,0x2c,0x20,0x73,0x6d, | |
0x70,0x2c,0x20,0x78,0x5f,0x32,0x36,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x78,0x5f,0x32,0x36,0x31, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x36, | |
0x33,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x32,0x36, | |
0x33,0x29,0x20,0x3d,0x3d,0x20,0x31,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x36,0x38,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x32,0x37,0x31,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x31,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x32,0x37,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66, | |
0x20,0x3d,0x20,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x36,0x38,0x2e, | |
0x78,0x2c,0x20,0x78,0x5f,0x32,0x36,0x38,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x36, | |
0x38,0x2e,0x7a,0x29,0x20,0x2a,0x20,0x78,0x5f,0x32,0x37,0x31,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x37,0x34, | |
0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x32,0x37, | |
0x32,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x37,0x32,0x2e,0x79,0x2c,0x20,0x78,0x5f, | |
0x32,0x37,0x32,0x2e,0x7a,0x2c,0x20,0x78,0x5f,0x32,0x37,0x34,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x32,0x38,0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78, | |
0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x7a, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x69,0x33,0x32, | |
0x28,0x78,0x5f,0x32,0x38,0x30,0x29,0x20,0x3d,0x3d,0x20,0x32,0x69,0x29,0x29,0x20, | |
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x32,0x38,0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x31,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78, | |
0x5f,0x32,0x38,0x36,0x2c,0x20,0x78,0x5f,0x32,0x38,0x36,0x2c,0x20,0x78,0x5f,0x32, | |
0x38,0x36,0x2c,0x20,0x78,0x5f,0x32,0x38,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x32,0x38,0x39,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x7a,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x39,0x31,0x20,0x3a, | |
0x20,0x62,0x6f,0x6f,0x6c,0x20,0x3d,0x20,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x32, | |
0x38,0x39,0x29,0x20,0x3d,0x3d,0x20,0x33,0x69,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x78,0x5f,0x32,0x39,0x37,0x20,0x3d,0x20,0x78,0x5f,0x32,0x39,0x31,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x78,0x5f,0x32,0x39,0x31, | |
0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20, | |
0x78,0x5f,0x32,0x39,0x35,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x78,0x5f,0x32,0x39,0x36,0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x39,0x35,0x20, | |
0x3d,0x3d,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x78,0x5f,0x32,0x39,0x37,0x20,0x3d,0x20,0x78,0x5f,0x32,0x39,0x36,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69, | |
0x66,0x20,0x28,0x78,0x5f,0x32,0x39,0x37,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, | |
0x5f,0x33,0x30,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78, | |
0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x69,0x5d,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x30,0x33,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20, | |
0x3d,0x20,0x28,0x78,0x5f,0x33,0x30,0x33,0x20,0x2a,0x20,0x78,0x5f,0x33,0x30,0x32, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33, | |
0x30,0x35,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x74,0x72,0x6f,0x6b, | |
0x65,0x41,0x6c,0x70,0x68,0x61,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x33,0x30,0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20, | |
0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x33,0x30,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66, | |
0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x28,0x78,0x5f,0x33, | |
0x30,0x38,0x20,0x2a,0x20,0x28,0x78,0x5f,0x33,0x30,0x35,0x20,0x2a,0x20,0x78,0x5f, | |
0x33,0x30,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x33,0x31,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x78,0x5f,0x33,0x31,0x30,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x7d,0x20,0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x31,0x33,0x20,0x3a,0x20,0x66, | |
0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x30,0x69,0x5d,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, | |
0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x33,0x31,0x33,0x29,0x20,0x3d,0x3d, | |
0x20,0x32,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x31, | |
0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x2c, | |
0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x20, | |
0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x33,0x32,0x31,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d, | |
0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d, | |
0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, | |
0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x33,0x32,0x31,0x29,0x20,0x3d,0x3d,0x20,0x33, | |
0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x33,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32, | |
0x66,0x20,0x3d,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x33,0x32, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75, | |
0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x74,0x65,0x78,0x2c,0x20,0x73,0x6d, | |
0x70,0x2c,0x20,0x78,0x5f,0x33,0x33,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x32,0x20,0x3d,0x20,0x78, | |
0x5f,0x33,0x33,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x33,0x34,0x20,0x3a,0x20,0x66,0x33,0x32,0x20, | |
0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69, | |
0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, | |
0x66,0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x33,0x33,0x34,0x29,0x20,0x3d, | |
0x3d,0x20,0x31,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x33,0x39,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x32, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x33,0x34,0x32,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20, | |
0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x32,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x34,0x33, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x28,0x76,0x65,0x63,0x33, | |
0x66,0x28,0x78,0x5f,0x33,0x33,0x39,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33,0x33,0x39, | |
0x2e,0x79,0x2c,0x20,0x78,0x5f,0x33,0x33,0x39,0x2e,0x7a,0x29,0x20,0x2a,0x20,0x78, | |
0x5f,0x33,0x34,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x34,0x35,0x20,0x3a,0x20,0x66, | |
0x33,0x32,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x32,0x2e,0x77,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x32,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x33,0x34, | |
0x33,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33,0x34,0x33,0x2e,0x79,0x2c,0x20,0x78,0x5f, | |
0x33,0x34,0x33,0x2e,0x7a,0x2c,0x20,0x78,0x5f,0x33,0x34,0x35,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x35,0x31,0x20,0x3a, | |
0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x33, | |
0x35,0x31,0x29,0x20,0x3d,0x3d,0x20,0x32,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x33,0x35,0x37,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x32,0x20,0x3d,0x20,0x76,0x65,0x63, | |
0x34,0x66,0x28,0x78,0x5f,0x33,0x35,0x37,0x2c,0x20,0x78,0x5f,0x33,0x35,0x37,0x2c, | |
0x20,0x78,0x5f,0x33,0x35,0x37,0x2c,0x20,0x78,0x5f,0x33,0x35,0x37,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x35,0x39,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x33,0x36,0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73, | |
0x63,0x69,0x73,0x73,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x36,0x33,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x36,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x36,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x28,0x28,0x78,0x5f,0x33,0x35,0x39, | |
0x20,0x2a,0x20,0x78,0x5f,0x33,0x36,0x30,0x29,0x20,0x2a,0x20,0x78,0x5f,0x33,0x36, | |
0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x36,0x37,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x34,0x66,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20, | |
0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x78,0x5f,0x33,0x36,0x37, | |
0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73, | |
0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b, | |
0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a, | |
0x20,0x20,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76, | |
0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,0x65, | |
0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61, | |
0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x66,0x70,0x6f,0x73,0x5f,0x70,0x61,0x72, | |
0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63, | |
0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x29,0x20, | |
0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20, | |
0x66,0x70,0x6f,0x73,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73,0x5f,0x70,0x61,0x72,0x61, | |
0x6d,0x3b,0x0a,0x20,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20, | |
0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75, | |
0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x6f,0x75,0x74,0x43, | |
0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
static inline const sg_shader_desc* nanovg_sg_shader_desc(sg_backend backend) { | |
#if defined(SOKOL_GLCORE) | |
if (backend == SG_BACKEND_GLCORE) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.attrs[0].name = "vertex"; | |
desc.attrs[1].name = "tcoord"; | |
desc.vs.source = (const char*)nanovg_vs_source_glsl410; | |
desc.vs.entry = "main"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.vs.uniform_blocks[0].uniforms[0].name = "viewSize"; | |
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; | |
desc.vs.uniform_blocks[0].uniforms[0].array_count = 1; | |
desc.fs.source = (const char*)nanovg_fs_source_glsl410; | |
desc.fs.entry = "main"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.uniform_blocks[0].uniforms[0].name = "frag"; | |
desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; | |
desc.fs.uniform_blocks[0].uniforms[0].array_count = 11; | |
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 = "nanovg_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_GLCORE */ | |
#if defined(SOKOL_GLES3) | |
if (backend == SG_BACKEND_GLES3) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.attrs[0].name = "vertex"; | |
desc.attrs[1].name = "tcoord"; | |
desc.vs.source = (const char*)nanovg_vs_source_glsl300es; | |
desc.vs.entry = "main"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.vs.uniform_blocks[0].uniforms[0].name = "viewSize"; | |
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; | |
desc.vs.uniform_blocks[0].uniforms[0].array_count = 1; | |
desc.fs.source = (const char*)nanovg_fs_source_glsl300es; | |
desc.fs.entry = "main"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.uniform_blocks[0].uniforms[0].name = "frag"; | |
desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; | |
desc.fs.uniform_blocks[0].uniforms[0].array_count = 11; | |
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 = "nanovg_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_GLES3 */ | |
#if defined(SOKOL_D3D11) | |
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.vs.source = (const char*)nanovg_vs_source_hlsl4; | |
desc.vs.d3d11_target = "vs_4_0"; | |
desc.vs.entry = "main"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.source = (const char*)nanovg_fs_source_hlsl4; | |
desc.fs.d3d11_target = "ps_4_0"; | |
desc.fs.entry = "main"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
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 = "nanovg_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_D3D11 */ | |
#if defined(SOKOL_METAL) | |
if (backend == SG_BACKEND_METAL_MACOS) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.vs.source = (const char*)nanovg_vs_source_metal_macos; | |
desc.vs.entry = "main0"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.source = (const char*)nanovg_fs_source_metal_macos; | |
desc.fs.entry = "main0"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
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 = "nanovg_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_METAL */ | |
#if defined(SOKOL_METAL) | |
if (backend == SG_BACKEND_METAL_IOS) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.vs.source = (const char*)nanovg_vs_source_metal_ios; | |
desc.vs.entry = "main0"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.source = (const char*)nanovg_fs_source_metal_ios; | |
desc.fs.entry = "main0"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
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 = "nanovg_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_METAL */ | |
#if defined(SOKOL_METAL) | |
if (backend == SG_BACKEND_METAL_SIMULATOR) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.vs.source = (const char*)nanovg_vs_source_metal_sim; | |
desc.vs.entry = "main0"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.source = (const char*)nanovg_fs_source_metal_sim; | |
desc.fs.entry = "main0"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
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 = "nanovg_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_METAL */ | |
#if defined(SOKOL_WGPU) | |
if (backend == SG_BACKEND_WGPU) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.vs.source = (const char*)nanovg_vs_source_wgsl; | |
desc.vs.entry = "main"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.source = (const char*)nanovg_fs_source_wgsl; | |
desc.fs.entry = "main"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
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 = "nanovg_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_WGPU */ | |
return 0; | |
} | |
//////////////////////////////////////////////////////////////////////////////// | |
// #include "shd.aa.glsl.h" | |
//////////////////////////////////////////////////////////////////////////////// | |
/* | |
#version:1# (machine generated, don't edit!) | |
Generated by sokol-shdc (https://github.com/floooh/sokol-tools) | |
Cmdline: | |
sokol-shdc --input shd.aa.glsl --output shd.aa.glsl.h --defines=EDGE_AA --slang glsl410:glsl300es:hlsl4:metal_macos:metal_ios:metal_sim:wgsl --ifdef | |
Overview: | |
========= | |
Shader program: 'sg': | |
Get shader desc: nanovg_aa_sg_shader_desc(sg_query_backend()); | |
Vertex shader: vs_aa | |
Attributes: | |
ATTR_nanovg_aa_vs_aa_vertex => 0 | |
ATTR_nanovg_aa_vs_aa_tcoord => 1 | |
Uniform block 'viewSize': | |
C struct: nanovg_aa_viewSize_t | |
Bind slot: SLOT_nanovg_aa_viewSize => 0 | |
Fragment shader: fs_aa | |
Uniform block 'frag': | |
C struct: nanovg_aa_frag_t | |
Bind slot: SLOT_nanovg_aa_frag => 0 | |
Image 'tex': | |
Image type: SG_IMAGETYPE_2D | |
Sample type: SG_IMAGESAMPLETYPE_FLOAT | |
Multisampled: false | |
Bind slot: SLOT_nanovg_aa_tex => 0 | |
Sampler 'smp': | |
Type: SG_SAMPLERTYPE_FILTERING | |
Bind slot: SLOT_nanovg_aa_smp => 0 | |
Image Sampler Pair 'tex_smp': | |
Image: tex | |
Sampler: smp | |
*/ | |
#if !defined(SOKOL_GFX_INCLUDED) | |
#error "Please include sokol_gfx.h before shd.aa.glsl.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_nanovg_aa_vs_aa_vertex (0) | |
#define ATTR_nanovg_aa_vs_aa_tcoord (1) | |
#define SLOT_nanovg_aa_viewSize (0) | |
#define SLOT_nanovg_aa_frag (0) | |
#define SLOT_nanovg_aa_tex (0) | |
#define SLOT_nanovg_aa_smp (0) | |
#pragma pack(push,1) | |
SOKOL_SHDC_ALIGN(16) typedef struct nanovg_aa_viewSize_t { | |
float _viewSize[4]; | |
} nanovg_aa_viewSize_t; | |
#pragma pack(pop) | |
#pragma pack(push,1) | |
SOKOL_SHDC_ALIGN(16) typedef struct nanovg_aa_frag_t { | |
float dummy[11][4]; | |
} nanovg_aa_frag_t; | |
#pragma pack(pop) | |
/* | |
#version 410 | |
uniform vec4 viewSize[1]; | |
layout(location = 0) out vec2 ftcoord; | |
layout(location = 1) in vec2 tcoord; | |
layout(location = 1) out vec2 fpos; | |
layout(location = 0) in vec2 vertex; | |
void main() | |
{ | |
ftcoord = tcoord; | |
fpos = vertex; | |
gl_Position = vec4(((2.0 * vertex.x) / viewSize[0].x) - 1.0, 1.0 - ((2.0 * vertex.y) / viewSize[0].y), 0.0, 1.0); | |
} | |
*/ | |
#if defined(SOKOL_GLCORE) | |
static const uint8_t nanovg_aa_vs_aa_source_glsl410[367] = { | |
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,0x76,0x69,0x65,0x77,0x53, | |
0x69,0x7a,0x65,0x5b,0x31,0x5d,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x63,0x6f,0x6f, | |
0x72,0x64,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, | |
0x32,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, | |
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20, | |
0x76,0x65,0x63,0x32,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x3b,0x0a,0x0a,0x76,0x6f, | |
0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x70,0x6f,0x73,0x20,0x3d,0x20,0x76,0x65,0x72, | |
0x74,0x65,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69, | |
0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x28,0x28,0x32,0x2e, | |
0x30,0x20,0x2a,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x2e,0x78,0x29,0x20,0x2f,0x20, | |
0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2d, | |
0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x28,0x32,0x2e, | |
0x30,0x20,0x2a,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x2e,0x79,0x29,0x20,0x2f,0x20, | |
0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x2c,0x20, | |
0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#version 410 | |
uniform vec4 frag[11]; | |
uniform sampler2D tex_smp; | |
layout(location = 0) in vec2 ftcoord; | |
layout(location = 1) in vec2 fpos; | |
layout(location = 0) out vec4 outColor; | |
float strokeMask() | |
{ | |
return min(1.0, (1.0 - abs(fma(ftcoord.x, 2.0, -1.0))) * frag[10].x) * min(1.0, ftcoord.y); | |
} | |
float scissorMask(vec2 p) | |
{ | |
vec2 _109 = fma(-(abs((mat3(vec3(frag[0].xyz), vec3(frag[1].xyz), vec3(frag[2].xyz)) * vec3(p, 1.0)).xy) - frag[8].xy), frag[8].zw, vec2(0.5)); | |
return clamp(_109.x, 0.0, 1.0) * clamp(_109.y, 0.0, 1.0); | |
} | |
float sdroundrect(vec2 pt, vec2 ext, float rad) | |
{ | |
vec2 _33 = abs(pt) - (ext - vec2(rad, rad)); | |
return (min(max(_33.x, _33.y), 0.0) + length(max(_33, vec2(0.0)))) - rad; | |
} | |
void main() | |
{ | |
float _142 = strokeMask(); | |
if (_142 < frag[10].y) | |
{ | |
discard; | |
} | |
vec2 param = fpos; | |
float _155 = scissorMask(param); | |
if (_155 == 0.0) | |
{ | |
return; | |
} | |
int _164 = int(frag[10].w); | |
vec4 result; | |
if (_164 == 0) | |
{ | |
vec2 param_1 = (mat3(vec3(frag[3].xyz), vec3(frag[4].xyz), vec3(frag[5].xyz)) * vec3(fpos, 1.0)).xy; | |
vec2 param_2 = frag[9].xy; | |
float param_3 = frag[9].z; | |
result = mix(frag[6], frag[7], vec4(clamp(fma(frag[9].w, 0.5, sdroundrect(param_1, param_2, param_3)) / frag[9].w, 0.0, 1.0))) * (_142 * _155); | |
} | |
else | |
{ | |
if (_164 == 1) | |
{ | |
vec4 color = texture(tex_smp, (mat3(vec3(frag[3].xyz), vec3(frag[4].xyz), vec3(frag[5].xyz)) * vec3(fpos, 1.0)).xy / frag[9].xy); | |
int _294 = int(frag[10].z); | |
if (_294 == 1) | |
{ | |
color = vec4(color.xyz * color.w, color.w); | |
} | |
if (_294 == 2) | |
{ | |
color = vec4(color.x); | |
} | |
bool _321 = _294 == 3; | |
bool _327; | |
if (_321) | |
{ | |
_327 = color.w == 1.0; | |
} | |
else | |
{ | |
_327 = _321; | |
} | |
if (_327) | |
{ | |
discard; | |
} | |
vec4 _333 = color; | |
vec4 _339 = (_333 * frag[6]) * (_142 * _155); | |
color = _339; | |
result = _339; | |
} | |
else | |
{ | |
if (_164 == 2) | |
{ | |
result = vec4(1.0); | |
} | |
else | |
{ | |
if (_164 == 3) | |
{ | |
vec4 color_1 = texture(tex_smp, ftcoord); | |
int _364 = int(frag[10].z); | |
if (_364 == 1) | |
{ | |
color_1 = vec4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_364 == 2) | |
{ | |
color_1 = vec4(color_1.x); | |
} | |
result = (color_1 * _155) * frag[6]; | |
} | |
} | |
} | |
} | |
outColor = result; | |
} | |
*/ | |
#if defined(SOKOL_GLCORE) | |
static const uint8_t nanovg_aa_fs_aa_source_glsl410[2949] = { | |
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,0x66,0x72,0x61,0x67,0x5b, | |
0x31,0x31,0x5d,0x3b,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,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x66,0x74, | |
0x63,0x6f,0x6f,0x72,0x64,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,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, | |
0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f, | |
0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72, | |
0x3b,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x4d, | |
0x61,0x73,0x6b,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, | |
0x72,0x6e,0x20,0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,0x2c,0x20,0x28,0x31,0x2e,0x30, | |
0x20,0x2d,0x20,0x61,0x62,0x73,0x28,0x66,0x6d,0x61,0x28,0x66,0x74,0x63,0x6f,0x6f, | |
0x72,0x64,0x2e,0x78,0x2c,0x20,0x32,0x2e,0x30,0x2c,0x20,0x2d,0x31,0x2e,0x30,0x29, | |
0x29,0x29,0x20,0x2a,0x20,0x66,0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x78,0x29, | |
0x20,0x2a,0x20,0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,0x2c,0x20,0x66,0x74,0x63,0x6f, | |
0x6f,0x72,0x64,0x2e,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74, | |
0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x76,0x65,0x63, | |
0x32,0x20,0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20, | |
0x5f,0x31,0x30,0x39,0x20,0x3d,0x20,0x66,0x6d,0x61,0x28,0x2d,0x28,0x61,0x62,0x73, | |
0x28,0x28,0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67, | |
0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66, | |
0x72,0x61,0x67,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63, | |
0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20, | |
0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x70,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e, | |
0x78,0x79,0x29,0x20,0x2d,0x20,0x66,0x72,0x61,0x67,0x5b,0x38,0x5d,0x2e,0x78,0x79, | |
0x29,0x2c,0x20,0x66,0x72,0x61,0x67,0x5b,0x38,0x5d,0x2e,0x7a,0x77,0x2c,0x20,0x76, | |
0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, | |
0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31,0x30,0x39, | |
0x2e,0x78,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20,0x2a,0x20, | |
0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31,0x30,0x39,0x2e,0x79,0x2c,0x20,0x30,0x2e, | |
0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61, | |
0x74,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63,0x74,0x28,0x76,0x65, | |
0x63,0x32,0x20,0x70,0x74,0x2c,0x20,0x76,0x65,0x63,0x32,0x20,0x65,0x78,0x74,0x2c, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x33,0x33,0x20,0x3d,0x20,0x61,0x62,0x73, | |
0x28,0x70,0x74,0x29,0x20,0x2d,0x20,0x28,0x65,0x78,0x74,0x20,0x2d,0x20,0x76,0x65, | |
0x63,0x32,0x28,0x72,0x61,0x64,0x2c,0x20,0x72,0x61,0x64,0x29,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6d,0x69,0x6e,0x28,0x6d, | |
0x61,0x78,0x28,0x5f,0x33,0x33,0x2e,0x78,0x2c,0x20,0x5f,0x33,0x33,0x2e,0x79,0x29, | |
0x2c,0x20,0x30,0x2e,0x30,0x29,0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28, | |
0x6d,0x61,0x78,0x28,0x5f,0x33,0x33,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e, | |
0x30,0x29,0x29,0x29,0x29,0x20,0x2d,0x20,0x72,0x61,0x64,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,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x73, | |
0x74,0x72,0x6f,0x6b,0x65,0x4d,0x61,0x73,0x6b,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x3c,0x20,0x66,0x72,0x61,0x67, | |
0x5b,0x31,0x30,0x5d,0x2e,0x79,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61, | |
0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x35,0x20,0x3d,0x20,0x73,0x63,0x69, | |
0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x35,0x35,0x20,0x3d,0x3d, | |
0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x36,0x34,0x20,0x3d, | |
0x20,0x69,0x6e,0x74,0x28,0x66,0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x77,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x72,0x65,0x73,0x75,0x6c, | |
0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20, | |
0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, | |
0x20,0x3d,0x20,0x28,0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x66,0x72, | |
0x61,0x67,0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33, | |
0x28,0x66,0x72,0x61,0x67,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76, | |
0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29, | |
0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31, | |
0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20, | |
0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, | |
0x33,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x7a,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20, | |
0x6d,0x69,0x78,0x28,0x66,0x72,0x61,0x67,0x5b,0x36,0x5d,0x2c,0x20,0x66,0x72,0x61, | |
0x67,0x5b,0x37,0x5d,0x2c,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6c,0x61,0x6d,0x70, | |
0x28,0x66,0x6d,0x61,0x28,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20, | |
0x30,0x2e,0x35,0x2c,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63,0x74, | |
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,0x20,0x2f,0x20,0x66, | |
0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, | |
0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2a,0x20, | |
0x5f,0x31,0x35,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, | |
0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20, | |
0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,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,0x28,0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63, | |
0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20, | |
0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a, | |
0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x35,0x5d,0x2e, | |
0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x70,0x6f, | |
0x73,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x20,0x2f,0x20,0x66,0x72, | |
0x61,0x67,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x39,0x34,0x20, | |
0x3d,0x20,0x69,0x6e,0x74,0x28,0x66,0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x7a, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, | |
0x66,0x20,0x28,0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78, | |
0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x2c,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f, | |
0x72,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x32,0x31,0x20,0x3d,0x20,0x5f,0x32,0x39,0x34, | |
0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x32,0x37,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33, | |
0x32,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77, | |
0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d,0x20,0x5f,0x33,0x32, | |
0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, | |
0x28,0x5f,0x33,0x32,0x37,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x33, | |
0x33,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x33,0x39, | |
0x20,0x3d,0x20,0x28,0x5f,0x33,0x33,0x33,0x20,0x2a,0x20,0x66,0x72,0x61,0x67,0x5b, | |
0x36,0x5d,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2a,0x20,0x5f,0x31, | |
0x35,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c, | |
0x74,0x20,0x3d,0x20,0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20, | |
0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x76,0x65,0x63, | |
0x34,0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d, | |
0x20,0x33,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, | |
0x28,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72, | |
0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x36,0x34, | |
0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x66,0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e, | |
0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x36,0x34, | |
0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x76, | |
0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x79,0x7a,0x20, | |
0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c, | |
0x6f,0x72,0x5f,0x31,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x36,0x34,0x20,0x3d,0x3d,0x20,0x32, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x28,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x20,0x2a, | |
0x20,0x66,0x72,0x61,0x67,0x5b,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75, | |
0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b, | |
0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#version 300 es | |
uniform vec4 viewSize[1]; | |
out vec2 ftcoord; | |
layout(location = 1) in vec2 tcoord; | |
out vec2 fpos; | |
layout(location = 0) in vec2 vertex; | |
void main() | |
{ | |
ftcoord = tcoord; | |
fpos = vertex; | |
gl_Position = vec4(((2.0 * vertex.x) / viewSize[0].x) - 1.0, 1.0 - ((2.0 * vertex.y) / viewSize[0].y), 0.0, 1.0); | |
} | |
*/ | |
#if defined(SOKOL_GLES3) | |
static const uint8_t nanovg_aa_vs_aa_source_glsl300es[328] = { | |
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, | |
0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x69, | |
0x65,0x77,0x53,0x69,0x7a,0x65,0x5b,0x31,0x5d,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76, | |
0x65,0x63,0x32,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x63,0x6f,0x6f,0x72,0x64, | |
0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x66,0x70,0x6f,0x73,0x3b, | |
0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, | |
0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x76,0x65, | |
0x72,0x74,0x65,0x78,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e, | |
0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x20,0x3d,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, | |
0x70,0x6f,0x73,0x20,0x3d,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, | |
0x76,0x65,0x63,0x34,0x28,0x28,0x28,0x32,0x2e,0x30,0x20,0x2a,0x20,0x76,0x65,0x72, | |
0x74,0x65,0x78,0x2e,0x78,0x29,0x20,0x2f,0x20,0x76,0x69,0x65,0x77,0x53,0x69,0x7a, | |
0x65,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31, | |
0x2e,0x30,0x20,0x2d,0x20,0x28,0x28,0x32,0x2e,0x30,0x20,0x2a,0x20,0x76,0x65,0x72, | |
0x74,0x65,0x78,0x2e,0x79,0x29,0x20,0x2f,0x20,0x76,0x69,0x65,0x77,0x53,0x69,0x7a, | |
0x65,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e, | |
0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#version 300 es | |
precision mediump float; | |
precision highp int; | |
uniform highp vec4 frag[11]; | |
uniform highp sampler2D tex_smp; | |
in highp vec2 ftcoord; | |
in highp vec2 fpos; | |
layout(location = 0) out highp vec4 outColor; | |
highp float strokeMask() | |
{ | |
return min(1.0, (1.0 - abs(ftcoord.x * 2.0 + (-1.0))) * frag[10].x) * min(1.0, ftcoord.y); | |
} | |
highp float scissorMask(highp vec2 p) | |
{ | |
highp vec2 _109 = (-(abs((mat3(vec3(frag[0].xyz), vec3(frag[1].xyz), vec3(frag[2].xyz)) * vec3(p, 1.0)).xy) - frag[8].xy)) * frag[8].zw + vec2(0.5); | |
return clamp(_109.x, 0.0, 1.0) * clamp(_109.y, 0.0, 1.0); | |
} | |
highp float sdroundrect(highp vec2 pt, highp vec2 ext, highp float rad) | |
{ | |
highp vec2 _33 = abs(pt) - (ext - vec2(rad, rad)); | |
return (min(max(_33.x, _33.y), 0.0) + length(max(_33, vec2(0.0)))) - rad; | |
} | |
void main() | |
{ | |
highp float _142 = strokeMask(); | |
if (_142 < frag[10].y) | |
{ | |
discard; | |
} | |
highp vec2 param = fpos; | |
highp float _155 = scissorMask(param); | |
if (_155 == 0.0) | |
{ | |
return; | |
} | |
int _164 = int(frag[10].w); | |
highp vec4 result; | |
if (_164 == 0) | |
{ | |
highp vec2 param_1 = (mat3(vec3(frag[3].xyz), vec3(frag[4].xyz), vec3(frag[5].xyz)) * vec3(fpos, 1.0)).xy; | |
highp vec2 param_2 = frag[9].xy; | |
highp float param_3 = frag[9].z; | |
result = mix(frag[6], frag[7], vec4(clamp((frag[9].w * 0.5 + sdroundrect(param_1, param_2, param_3)) / frag[9].w, 0.0, 1.0))) * (_142 * _155); | |
} | |
else | |
{ | |
if (_164 == 1) | |
{ | |
highp vec4 color = texture(tex_smp, (mat3(vec3(frag[3].xyz), vec3(frag[4].xyz), vec3(frag[5].xyz)) * vec3(fpos, 1.0)).xy / frag[9].xy); | |
int _294 = int(frag[10].z); | |
if (_294 == 1) | |
{ | |
color = vec4(color.xyz * color.w, color.w); | |
} | |
if (_294 == 2) | |
{ | |
color = vec4(color.x); | |
} | |
bool _321 = _294 == 3; | |
bool _327; | |
if (_321) | |
{ | |
_327 = color.w == 1.0; | |
} | |
else | |
{ | |
_327 = _321; | |
} | |
if (_327) | |
{ | |
discard; | |
} | |
highp vec4 _333 = color; | |
highp vec4 _339 = (_333 * frag[6]) * (_142 * _155); | |
color = _339; | |
result = _339; | |
} | |
else | |
{ | |
if (_164 == 2) | |
{ | |
result = vec4(1.0); | |
} | |
else | |
{ | |
if (_164 == 3) | |
{ | |
highp vec4 color_1 = texture(tex_smp, ftcoord); | |
int _364 = int(frag[10].z); | |
if (_364 == 1) | |
{ | |
color_1 = vec4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_364 == 2) | |
{ | |
color_1 = vec4(color_1.x); | |
} | |
result = (color_1 * _155) * frag[6]; | |
} | |
} | |
} | |
} | |
outColor = result; | |
} | |
*/ | |
#if defined(SOKOL_GLES3) | |
static const uint8_t nanovg_aa_fs_aa_source_glsl300es[3103] = { | |
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, | |
0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, | |
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, | |
0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75, | |
0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, | |
0x34,0x20,0x66,0x72,0x61,0x67,0x5b,0x31,0x31,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66, | |
0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65, | |
0x72,0x32,0x44,0x20,0x74,0x65,0x78,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x69,0x6e, | |
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x66,0x74,0x63,0x6f, | |
0x6f,0x72,0x64,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, | |
0x63,0x32,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28, | |
0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75, | |
0x74,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x6f,0x75,0x74, | |
0x43,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x4d,0x61,0x73,0x6b,0x28,0x29, | |
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x69, | |
0x6e,0x28,0x31,0x2e,0x30,0x2c,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x61,0x62, | |
0x73,0x28,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x20,0x2a,0x20,0x32,0x2e, | |
0x30,0x20,0x2b,0x20,0x28,0x2d,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x66, | |
0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2a,0x20,0x6d,0x69,0x6e, | |
0x28,0x31,0x2e,0x30,0x2c,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x2e,0x79,0x29, | |
0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x68,0x69,0x67, | |
0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x31,0x30,0x39, | |
0x20,0x3d,0x20,0x28,0x2d,0x28,0x61,0x62,0x73,0x28,0x28,0x6d,0x61,0x74,0x33,0x28, | |
0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a, | |
0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x31,0x5d,0x2e, | |
0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b, | |
0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28, | |
0x70,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x29,0x20,0x2d,0x20,0x66, | |
0x72,0x61,0x67,0x5b,0x38,0x5d,0x2e,0x78,0x79,0x29,0x29,0x20,0x2a,0x20,0x66,0x72, | |
0x61,0x67,0x5b,0x38,0x5d,0x2e,0x7a,0x77,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28, | |
0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, | |
0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31,0x30,0x39,0x2e,0x78,0x2c,0x20,0x30, | |
0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20,0x2a,0x20,0x63,0x6c,0x61,0x6d,0x70, | |
0x28,0x5f,0x31,0x30,0x39,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e, | |
0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63,0x74,0x28,0x68, | |
0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x74,0x2c,0x20,0x68,0x69, | |
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x65,0x78,0x74,0x2c,0x20,0x68,0x69, | |
0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64,0x29,0x0a,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20, | |
0x5f,0x33,0x33,0x20,0x3d,0x20,0x61,0x62,0x73,0x28,0x70,0x74,0x29,0x20,0x2d,0x20, | |
0x28,0x65,0x78,0x74,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x28,0x72,0x61,0x64,0x2c, | |
0x20,0x72,0x61,0x64,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, | |
0x72,0x6e,0x20,0x28,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x33,0x2e, | |
0x78,0x2c,0x20,0x5f,0x33,0x33,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x20, | |
0x2b,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x33, | |
0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x29,0x20,0x2d, | |
0x20,0x72,0x61,0x64,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61, | |
0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x73,0x74, | |
0x72,0x6f,0x6b,0x65,0x4d,0x61,0x73,0x6b,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x69,0x66,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x3c,0x20,0x66,0x72,0x61,0x67,0x5b, | |
0x31,0x30,0x5d,0x2e,0x79,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, | |
0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x20,0x5f,0x31,0x35,0x35,0x20,0x3d,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d, | |
0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x69,0x66,0x20,0x28,0x5f,0x31,0x35,0x35,0x20,0x3d,0x3d,0x20,0x30,0x2e,0x30,0x29, | |
0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, | |
0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, | |
0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28, | |
0x66,0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x72,0x65,0x73,0x75, | |
0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34, | |
0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20, | |
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x28,0x6d,0x61,0x74,0x33,0x28, | |
0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a, | |
0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x34,0x5d,0x2e, | |
0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b, | |
0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28, | |
0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, | |
0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x66,0x72,0x61, | |
0x67,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, | |
0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x7a, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74, | |
0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x66,0x72,0x61,0x67,0x5b,0x36,0x5d,0x2c,0x20, | |
0x66,0x72,0x61,0x67,0x5b,0x37,0x5d,0x2c,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6c, | |
0x61,0x6d,0x70,0x28,0x28,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x77,0x20,0x2a, | |
0x20,0x30,0x2e,0x35,0x20,0x2b,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65, | |
0x63,0x74,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,0x20,0x2f, | |
0x20,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e,0x30,0x2c, | |
0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20, | |
0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d, | |
0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, | |
0x20,0x76,0x65,0x63,0x34,0x20,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,0x28, | |
0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61,0x67,0x5b,0x33, | |
0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x66,0x72,0x61, | |
0x67,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28, | |
0x66,0x72,0x61,0x67,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x76,0x65,0x63,0x33,0x28,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29, | |
0x2e,0x78,0x79,0x20,0x2f,0x20,0x66,0x72,0x61,0x67,0x5b,0x39,0x5d,0x2e,0x78,0x79, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, | |
0x6e,0x74,0x20,0x5f,0x32,0x39,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x66,0x72, | |
0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x34,0x20, | |
0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34, | |
0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c, | |
0x6f,0x72,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32, | |
0x39,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76, | |
0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x32, | |
0x31,0x20,0x3d,0x20,0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20, | |
0x5f,0x33,0x32,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x31,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33, | |
0x32,0x37,0x20,0x3d,0x20,0x5f,0x33,0x32,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x37,0x29,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73, | |
0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x33,0x33,0x20, | |
0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20, | |
0x5f,0x33,0x33,0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x33,0x33,0x20,0x2a,0x20,0x66, | |
0x72,0x61,0x67,0x5b,0x36,0x5d,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20, | |
0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x33, | |
0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, | |
0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d, | |
0x20,0x76,0x65,0x63,0x34,0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36, | |
0x34,0x20,0x3d,0x3d,0x20,0x33,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69, | |
0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x74,0x65,0x78,0x5f,0x73, | |
0x6d,0x70,0x2c,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74, | |
0x28,0x66,0x72,0x61,0x67,0x5b,0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x36,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x31,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, | |
0x28,0x5f,0x33,0x36,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, | |
0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x20,0x2a,0x20,0x66,0x72,0x61,0x67,0x5b, | |
0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72, | |
0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
cbuffer viewSize : register(b0) | |
{ | |
float4 _28_viewSize : packoffset(c0); | |
}; | |
static float4 gl_Position; | |
static float2 ftcoord; | |
static float2 tcoord; | |
static float2 fpos; | |
static float2 vertex; | |
struct SPIRV_Cross_Input | |
{ | |
float2 vertex : TEXCOORD0; | |
float2 tcoord : TEXCOORD1; | |
}; | |
struct SPIRV_Cross_Output | |
{ | |
float2 ftcoord : TEXCOORD0; | |
float2 fpos : TEXCOORD1; | |
float4 gl_Position : SV_Position; | |
}; | |
void vert_main() | |
{ | |
ftcoord = tcoord; | |
fpos = vertex; | |
gl_Position = float4(((2.0f * vertex.x) / _28_viewSize.x) - 1.0f, 1.0f - ((2.0f * vertex.y) / _28_viewSize.y), 0.0f, 1.0f); | |
} | |
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) | |
{ | |
tcoord = stage_input.tcoord; | |
vertex = stage_input.vertex; | |
vert_main(); | |
SPIRV_Cross_Output stage_output; | |
stage_output.gl_Position = gl_Position; | |
stage_output.ftcoord = ftcoord; | |
stage_output.fpos = fpos; | |
return stage_output; | |
} | |
*/ | |
#if defined(SOKOL_D3D11) | |
static const uint8_t nanovg_aa_vs_aa_source_hlsl4[926] = { | |
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65, | |
0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a, | |
0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x38, | |
0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b, | |
0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a, | |
0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67, | |
0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74, | |
0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72, | |
0x64,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, | |
0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x73,0x74,0x61, | |
0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x65,0x72,0x74,0x65, | |
0x78,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,0x76,0x65,0x72,0x74,0x65,0x78, | |
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,0x63,0x6f,0x6f,0x72,0x64,0x20, | |
0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x66,0x70,0x6f,0x73,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,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,0x66,0x74,0x63,0x6f,0x6f, | |
0x72,0x64,0x20,0x3d,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x66,0x70,0x6f,0x73,0x20,0x3d,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20, | |
0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x32,0x2e,0x30,0x66,0x20, | |
0x2a,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x2e,0x78,0x29,0x20,0x2f,0x20,0x5f,0x32, | |
0x38,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e,0x78,0x29,0x20,0x2d,0x20, | |
0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x28,0x28,0x32, | |
0x2e,0x30,0x66,0x20,0x2a,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x2e,0x79,0x29,0x20, | |
0x2f,0x20,0x5f,0x32,0x38,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e,0x79, | |
0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,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, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, | |
0x6e,0x70,0x75,0x74,0x2e,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, | |
0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x66,0x74,0x63,0x6f,0x6f, | |
0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75, | |
0x74,0x70,0x75,0x74,0x2e,0x66,0x70,0x6f,0x73,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61, | |
0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, | |
}; | |
#endif | |
/* | |
cbuffer frag : register(b0) | |
{ | |
float4 _59_dummy[11] : packoffset(c0); | |
}; | |
Texture2D<float4> tex : register(t0); | |
SamplerState smp : register(s0); | |
static float2 ftcoord; | |
static float2 fpos; | |
static float4 outColor; | |
struct SPIRV_Cross_Input | |
{ | |
float2 ftcoord : TEXCOORD0; | |
float2 fpos : TEXCOORD1; | |
}; | |
struct SPIRV_Cross_Output | |
{ | |
float4 outColor : SV_Target0; | |
}; | |
float strokeMask() | |
{ | |
return min(1.0f, (1.0f - abs(mad(ftcoord.x, 2.0f, -1.0f))) * _59_dummy[10].x) * min(1.0f, ftcoord.y); | |
} | |
float scissorMask(float2 p) | |
{ | |
float2 _109 = mad(-(abs(mul(float3(p, 1.0f), float3x3(float3(_59_dummy[0].xyz), float3(_59_dummy[1].xyz), float3(_59_dummy[2].xyz))).xy) - _59_dummy[8].xy), _59_dummy[8].zw, 0.5f.xx); | |
return clamp(_109.x, 0.0f, 1.0f) * clamp(_109.y, 0.0f, 1.0f); | |
} | |
float sdroundrect(float2 pt, float2 ext, float rad) | |
{ | |
float2 _33 = abs(pt) - (ext - float2(rad, rad)); | |
return (min(max(_33.x, _33.y), 0.0f) + length(max(_33, 0.0f.xx))) - rad; | |
} | |
void frag_main() | |
{ | |
float _142 = strokeMask(); | |
if (_142 < _59_dummy[10].y) | |
{ | |
discard; | |
} | |
float2 param = fpos; | |
float _155 = scissorMask(param); | |
if (_155 == 0.0f) | |
{ | |
return; | |
} | |
int _164 = int(_59_dummy[10].w); | |
float4 result; | |
if (_164 == 0) | |
{ | |
float2 param_1 = mul(float3(fpos, 1.0f), float3x3(float3(_59_dummy[3].xyz), float3(_59_dummy[4].xyz), float3(_59_dummy[5].xyz))).xy; | |
float2 param_2 = _59_dummy[9].xy; | |
float param_3 = _59_dummy[9].z; | |
result = lerp(_59_dummy[6], _59_dummy[7], clamp(mad(_59_dummy[9].w, 0.5f, sdroundrect(param_1, param_2, param_3)) / _59_dummy[9].w, 0.0f, 1.0f).xxxx) * (_142 * _155); | |
} | |
else | |
{ | |
if (_164 == 1) | |
{ | |
float4 color = tex.Sample(smp, mul(float3(fpos, 1.0f), float3x3(float3(_59_dummy[3].xyz), float3(_59_dummy[4].xyz), float3(_59_dummy[5].xyz))).xy / _59_dummy[9].xy); | |
int _294 = int(_59_dummy[10].z); | |
if (_294 == 1) | |
{ | |
color = float4(color.xyz * color.w, color.w); | |
} | |
if (_294 == 2) | |
{ | |
color = color.x.xxxx; | |
} | |
bool _321 = _294 == 3; | |
bool _327; | |
if (_321) | |
{ | |
_327 = color.w == 1.0f; | |
} | |
else | |
{ | |
_327 = _321; | |
} | |
if (_327) | |
{ | |
discard; | |
} | |
float4 _333 = color; | |
float4 _339 = (_333 * _59_dummy[6]) * (_142 * _155); | |
color = _339; | |
result = _339; | |
} | |
else | |
{ | |
if (_164 == 2) | |
{ | |
result = 1.0f.xxxx; | |
} | |
else | |
{ | |
if (_164 == 3) | |
{ | |
float4 color_1 = tex.Sample(smp, ftcoord); | |
int _364 = int(_59_dummy[10].z); | |
if (_364 == 1) | |
{ | |
color_1 = float4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_364 == 2) | |
{ | |
color_1 = color_1.x.xxxx; | |
} | |
result = (color_1 * _155) * _59_dummy[6]; | |
} | |
} | |
} | |
} | |
outColor = result; | |
} | |
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) | |
{ | |
ftcoord = stage_input.ftcoord; | |
fpos = stage_input.fpos; | |
frag_main(); | |
SPIRV_Cross_Output stage_output; | |
stage_output.outColor = outColor; | |
return stage_output; | |
} | |
*/ | |
#if defined(SOKOL_D3D11) | |
static const uint8_t nanovg_aa_fs_aa_source_hlsl4[3599] = { | |
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x66,0x72,0x61,0x67,0x20,0x3a,0x20,0x72, | |
0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x31,0x31,0x5d,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66, | |
0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,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,0x32,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x73,0x74,0x61,0x74, | |
0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a, | |
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75, | |
0x74,0x43,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,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x66, | |
0x70,0x6f,0x73,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,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,0x6f,0x75,0x74,0x43, | |
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,0x73,0x74,0x72, | |
0x6f,0x6b,0x65,0x4d,0x61,0x73,0x6b,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,0x66,0x2c, | |
0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x61,0x62,0x73,0x28,0x6d,0x61,0x64, | |
0x28,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x2c,0x20,0x32,0x2e,0x30,0x66, | |
0x2c,0x20,0x2d,0x31,0x2e,0x30,0x66,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39, | |
0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2a,0x20, | |
0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,0x66,0x2c,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72, | |
0x64,0x2e,0x79,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73, | |
0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x66,0x6c,0x6f,0x61,0x74, | |
0x32,0x20,0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x32,0x20,0x5f,0x31,0x30,0x39,0x20,0x3d,0x20,0x6d,0x61,0x64,0x28,0x2d,0x28,0x61, | |
0x62,0x73,0x28,0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x70,0x2c, | |
0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33, | |
0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x33,0x28,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x5d,0x2e,0x78, | |
0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x5f, | |
0x64,0x75,0x6d,0x6d,0x79,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x29,0x2e, | |
0x78,0x79,0x29,0x20,0x2d,0x20,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x38,0x5d,0x2e,0x78,0x79,0x29,0x2c,0x20,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x38,0x5d,0x2e,0x7a,0x77,0x2c,0x20,0x30,0x2e,0x35,0x66,0x2e,0x78,0x78, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x6c, | |
0x61,0x6d,0x70,0x28,0x5f,0x31,0x30,0x39,0x2e,0x78,0x2c,0x20,0x30,0x2e,0x30,0x66, | |
0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28, | |
0x5f,0x31,0x30,0x39,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e, | |
0x30,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x64, | |
0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63,0x74,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32, | |
0x20,0x70,0x74,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x65,0x78,0x74,0x2c, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x33,0x33,0x20,0x3d,0x20,0x61, | |
0x62,0x73,0x28,0x70,0x74,0x29,0x20,0x2d,0x20,0x28,0x65,0x78,0x74,0x20,0x2d,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x2c,0x20,0x72,0x61,0x64,0x29, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6d, | |
0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x33,0x2e,0x78,0x2c,0x20,0x5f,0x33, | |
0x33,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x20,0x2b,0x20,0x6c,0x65, | |
0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28,0x5f,0x33,0x33,0x2c,0x20,0x30,0x2e, | |
0x30,0x66,0x2e,0x78,0x78,0x29,0x29,0x29,0x20,0x2d,0x20,0x72,0x61,0x64,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, | |
0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x4d,0x61,0x73, | |
0x6b,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x34, | |
0x32,0x20,0x3c,0x20,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30, | |
0x5d,0x2e,0x79,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72, | |
0x61,0x6d,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, | |
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x35,0x20,0x3d,0x20,0x73,0x63,0x69,0x73, | |
0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x35,0x35,0x20,0x3d,0x3d,0x20, | |
0x30,0x2e,0x30,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x36,0x34,0x20,0x3d, | |
0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31, | |
0x30,0x5d,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x34,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, | |
0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20, | |
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30, | |
0x66,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f, | |
0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d, | |
0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35, | |
0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x29,0x2e,0x78,0x79,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70, | |
0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20, | |
0x3d,0x20,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x7a, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74, | |
0x20,0x3d,0x20,0x6c,0x65,0x72,0x70,0x28,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x36,0x5d,0x2c,0x20,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x37,0x5d,0x2c,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6d,0x61,0x64,0x28,0x5f,0x35, | |
0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e, | |
0x35,0x66,0x2c,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63,0x74,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,0x20,0x2f,0x20,0x5f,0x35, | |
0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x77,0x2c,0x20,0x30,0x2e, | |
0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2e,0x78,0x78,0x78,0x78,0x29,0x20, | |
0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, | |
0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20, | |
0x3d,0x20,0x74,0x65,0x78,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70, | |
0x2c,0x20,0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x70,0x6f, | |
0x73,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x78,0x33,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x5f,0x64,0x75, | |
0x6d,0x6d,0x79,0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d, | |
0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35, | |
0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29, | |
0x29,0x2e,0x78,0x79,0x20,0x2f,0x20,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x39,0x5d,0x2e,0x78,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x39,0x34,0x20,0x3d,0x20, | |
0x69,0x6e,0x74,0x28,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30, | |
0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f, | |
0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e, | |
0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x34,0x20, | |
0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x2e,0x78,0x2e,0x78,0x78,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x32,0x31,0x20,0x3d,0x20, | |
0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x32,0x37, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, | |
0x20,0x28,0x5f,0x33,0x32,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d,0x20,0x63,0x6f,0x6c, | |
0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30,0x66,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x32,0x37,0x20, | |
0x3d,0x20,0x5f,0x33,0x32,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x37,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72, | |
0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x20,0x5f,0x33,0x33,0x33,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x20,0x5f,0x33,0x33,0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x33, | |
0x33,0x20,0x2a,0x20,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d, | |
0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20, | |
0x3d,0x20,0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d, | |
0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x31,0x2e,0x30,0x66,0x2e, | |
0x78,0x78,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x33, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x2e,0x53,0x61,0x6d, | |
0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x36,0x34,0x20, | |
0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, | |
0x5f,0x33,0x36,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e, | |
0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x29,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x36, | |
0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20, | |
0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x2e,0x78,0x78,0x78,0x78,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74, | |
0x20,0x3d,0x20,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x2a,0x20,0x5f,0x31, | |
0x35,0x35,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72, | |
0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,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,0x66,0x74,0x63,0x6f,0x6f, | |
0x72,0x64,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74, | |
0x2e,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x70, | |
0x6f,0x73,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74, | |
0x2e,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, | |
0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52, | |
0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73, | |
0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x6f,0x75, | |
0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6f,0x75,0x74,0x43,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, | |
}; | |
#endif | |
/* | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct viewSize | |
{ | |
float4 _viewSize; | |
}; | |
struct main0_out | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
float4 gl_Position [[position]]; | |
}; | |
struct main0_in | |
{ | |
float2 vertex0 [[attribute(0)]]; | |
float2 tcoord [[attribute(1)]]; | |
}; | |
vertex main0_out main0(main0_in in [[stage_in]], constant viewSize& _28 [[buffer(0)]]) | |
{ | |
main0_out out = {}; | |
out.ftcoord = in.tcoord; | |
out.fpos = in.vertex0; | |
out.gl_Position = float4(((2.0 * in.vertex0.x) / _28._viewSize.x) - 1.0, 1.0 - ((2.0 * in.vertex0.y) / _28._viewSize.y), 0.0, 1.0); | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_aa_vs_aa_source_metal_macos[665] = { | |
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,0x76, | |
0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x20,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,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,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, | |
0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b, | |
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, | |
0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x32,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x30,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,0x63,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b, | |
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,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,0x76,0x69, | |
0x65,0x77,0x53,0x69,0x7a,0x65,0x26,0x20,0x5f,0x32,0x38,0x20,0x5b,0x5b,0x62,0x75, | |
0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d, | |
0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x74,0x63, | |
0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x70,0x6f,0x73,0x20,0x3d, | |
0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x32,0x2e,0x30,0x20, | |
0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x2e,0x78,0x29,0x20, | |
0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e, | |
0x78,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20, | |
0x28,0x28,0x32,0x2e,0x30,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65, | |
0x78,0x30,0x2e,0x79,0x29,0x20,0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65, | |
0x77,0x53,0x69,0x7a,0x65,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, | |
0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, | |
0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#pragma clang diagnostic ignored "-Wmissing-prototypes" | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct frag | |
{ | |
float4 dummy[11]; | |
}; | |
struct main0_out | |
{ | |
float4 outColor [[color(0)]]; | |
}; | |
struct main0_in | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
}; | |
static inline __attribute__((always_inline)) | |
float strokeMask(constant frag& _59, thread float2& ftcoord) | |
{ | |
return fast::min(1.0, (1.0 - abs(fma(ftcoord.x, 2.0, -1.0))) * _59.dummy[10].x) * fast::min(1.0, ftcoord.y); | |
} | |
static inline __attribute__((always_inline)) | |
float scissorMask(thread const float2& p, constant frag& _59) | |
{ | |
float2 _109 = fma(-(abs((float3x3(float3(_59.dummy[0].xyz), float3(_59.dummy[1].xyz), float3(_59.dummy[2].xyz)) * float3(p, 1.0)).xy) - _59.dummy[8].xy), _59.dummy[8].zw, float2(0.5)); | |
return fast::clamp(_109.x, 0.0, 1.0) * fast::clamp(_109.y, 0.0, 1.0); | |
} | |
static inline __attribute__((always_inline)) | |
float sdroundrect(thread const float2& pt, thread const float2& ext, thread const float& rad) | |
{ | |
float2 _33 = abs(pt) - (ext - float2(rad, rad)); | |
return (fast::min(fast::max(_33.x, _33.y), 0.0) + length(fast::max(_33, float2(0.0)))) - rad; | |
} | |
fragment main0_out main0(main0_in in [[stage_in]], constant frag& _59 [[buffer(0)]], texture2d<float> tex [[texture(0)]], sampler smp [[sampler(0)]]) | |
{ | |
main0_out out = {}; | |
float _142 = strokeMask(_59, in.ftcoord); | |
if (_142 < _59.dummy[10].y) | |
{ | |
discard_fragment(); | |
} | |
float2 param = in.fpos; | |
float _155 = scissorMask(param, _59); | |
if (_155 == 0.0) | |
{ | |
return out; | |
} | |
int _164 = int(_59.dummy[10].w); | |
float4 result; | |
if (_164 == 0) | |
{ | |
float2 param_1 = (float3x3(float3(_59.dummy[3].xyz), float3(_59.dummy[4].xyz), float3(_59.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy; | |
float2 param_2 = _59.dummy[9].xy; | |
float param_3 = _59.dummy[9].z; | |
result = mix(_59.dummy[6], _59.dummy[7], float4(fast::clamp(fma(_59.dummy[9].w, 0.5, sdroundrect(param_1, param_2, param_3)) / _59.dummy[9].w, 0.0, 1.0))) * (_142 * _155); | |
} | |
else | |
{ | |
if (_164 == 1) | |
{ | |
float4 color = tex.sample(smp, ((float3x3(float3(_59.dummy[3].xyz), float3(_59.dummy[4].xyz), float3(_59.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy / _59.dummy[9].xy)); | |
int _294 = int(_59.dummy[10].z); | |
if (_294 == 1) | |
{ | |
color = float4(color.xyz * color.w, color.w); | |
} | |
if (_294 == 2) | |
{ | |
color = float4(color.x); | |
} | |
bool _321 = _294 == 3; | |
bool _327; | |
if (_321) | |
{ | |
_327 = color.w == 1.0; | |
} | |
else | |
{ | |
_327 = _321; | |
} | |
if (_327) | |
{ | |
discard_fragment(); | |
} | |
float4 _333 = color; | |
float4 _339 = (_333 * _59.dummy[6]) * (_142 * _155); | |
color = _339; | |
result = _339; | |
} | |
else | |
{ | |
if (_164 == 2) | |
{ | |
result = float4(1.0); | |
} | |
else | |
{ | |
if (_164 == 3) | |
{ | |
float4 color_1 = tex.sample(smp, in.ftcoord); | |
int _364 = int(_59.dummy[10].z); | |
if (_364 == 1) | |
{ | |
color_1 = float4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_364 == 2) | |
{ | |
color_1 = float4(color_1.x); | |
} | |
result = (color_1 * _155) * _59.dummy[6]; | |
} | |
} | |
} | |
} | |
out.outColor = result; | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_aa_fs_aa_source_metal_macos[3833] = { | |
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,0x66,0x72,0x61,0x67,0x0a,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x31,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, | |
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75,0x74,0x43,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,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c, | |
0x6f,0x63,0x6e,0x31,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, | |
0x73,0x74,0x72,0x6f,0x6b,0x65,0x4d,0x61,0x73,0x6b,0x28,0x63,0x6f,0x6e,0x73,0x74, | |
0x61,0x6e,0x74,0x20,0x66,0x72,0x61,0x67,0x26,0x20,0x5f,0x35,0x39,0x2c,0x20,0x74, | |
0x68,0x72,0x65,0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x66,0x74, | |
0x63,0x6f,0x6f,0x72,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, | |
0x75,0x72,0x6e,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x31,0x2e, | |
0x30,0x2c,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x61,0x62,0x73,0x28,0x66,0x6d, | |
0x61,0x28,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x2c,0x20,0x32,0x2e,0x30, | |
0x2c,0x20,0x2d,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x2e, | |
0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2a,0x20,0x66, | |
0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,0x2c,0x20,0x66,0x74, | |
0x63,0x6f,0x6f,0x72,0x64,0x2e,0x79,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, | |
0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x70,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61, | |
0x67,0x26,0x20,0x5f,0x35,0x39,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x30,0x39,0x20,0x3d,0x20,0x66,0x6d,0x61,0x28, | |
0x2d,0x28,0x61,0x62,0x73,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x70,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e, | |
0x78,0x79,0x29,0x20,0x2d,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x38,0x5d,0x2e,0x78,0x79,0x29,0x2c,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x38,0x5d,0x2e,0x7a,0x77,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, | |
0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, | |
0x6e,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x39,0x2e,0x78,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20, | |
0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x39,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,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,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65, | |
0x63,0x74,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x70,0x74,0x2c,0x20,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x65,0x78,0x74,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,0x29,0x0a,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x33,0x33,0x20, | |
0x3d,0x20,0x61,0x62,0x73,0x28,0x70,0x74,0x29,0x20,0x2d,0x20,0x28,0x65,0x78,0x74, | |
0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x2c,0x20,0x72, | |
0x61,0x64,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, | |
0x20,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x66,0x61,0x73,0x74, | |
0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x33,0x2e,0x78,0x2c,0x20,0x5f,0x33,0x33, | |
0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67, | |
0x74,0x68,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x33, | |
0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x29, | |
0x20,0x2d,0x20,0x72,0x61,0x64,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,0x63,0x6f, | |
0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61,0x67,0x26,0x20,0x5f,0x35,0x39, | |
0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,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,0x31,0x34,0x32,0x20,0x3d,0x20,0x73,0x74,0x72,0x6f, | |
0x6b,0x65,0x4d,0x61,0x73,0x6b,0x28,0x5f,0x35,0x39,0x2c,0x20,0x69,0x6e,0x2e,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, | |
0x28,0x5f,0x31,0x34,0x32,0x20,0x3c,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x31,0x30,0x5d,0x2e,0x79,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66, | |
0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61, | |
0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x35,0x20,0x3d,0x20,0x73,0x63, | |
0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c, | |
0x20,0x5f,0x35,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x31,0x35,0x35,0x20,0x3d,0x3d,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, | |
0x20,0x6f,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x69,0x6e,0x74,0x20,0x5f,0x31,0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f, | |
0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x77,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x72,0x65,0x73,0x75, | |
0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34, | |
0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61, | |
0x6d,0x5f,0x31,0x20,0x3d,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20, | |
0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32, | |
0x20,0x3d,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e, | |
0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x35,0x39,0x2e, | |
0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78, | |
0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x2c,0x20,0x5f, | |
0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x37,0x5d,0x2c,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28, | |
0x66,0x6d,0x61,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d, | |
0x2e,0x77,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64, | |
0x72,0x65,0x63,0x74,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, | |
0x20,0x2f,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e, | |
0x77,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a, | |
0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, | |
0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, | |
0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c, | |
0x20,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61, | |
0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d,0x2e, | |
0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x33,0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29, | |
0x29,0x2e,0x78,0x79,0x20,0x2f,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x39,0x5d,0x2e,0x78,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x39,0x34,0x20,0x3d, | |
0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31, | |
0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x31, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63, | |
0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x34, | |
0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x32, | |
0x31,0x20,0x3d,0x20,0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20, | |
0x5f,0x33,0x32,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x31,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33, | |
0x32,0x37,0x20,0x3d,0x20,0x5f,0x33,0x32,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x37,0x29,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73, | |
0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x34,0x20,0x5f,0x33,0x33,0x33,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x34,0x20,0x5f,0x33,0x33,0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x33,0x33,0x20, | |
0x2a,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x29,0x20, | |
0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c, | |
0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20, | |
0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x32, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28, | |
0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x33, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d, | |
0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x74,0x63,0x6f, | |
0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33, | |
0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, | |
0x66,0x20,0x28,0x5f,0x33,0x36,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c, | |
0x6f,0x72,0x5f,0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x5f,0x31,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, | |
0x5f,0x33,0x36,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x31,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x31,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x2e, | |
0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75, | |
0x74,0x2e,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x72,0x65,0x73, | |
0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, | |
0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct viewSize | |
{ | |
float4 _viewSize; | |
}; | |
struct main0_out | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
float4 gl_Position [[position]]; | |
}; | |
struct main0_in | |
{ | |
float2 vertex0 [[attribute(0)]]; | |
float2 tcoord [[attribute(1)]]; | |
}; | |
vertex main0_out main0(main0_in in [[stage_in]], constant viewSize& _28 [[buffer(0)]]) | |
{ | |
main0_out out = {}; | |
out.ftcoord = in.tcoord; | |
out.fpos = in.vertex0; | |
out.gl_Position = float4(((2.0 * in.vertex0.x) / _28._viewSize.x) - 1.0, 1.0 - ((2.0 * in.vertex0.y) / _28._viewSize.y), 0.0, 1.0); | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_aa_vs_aa_source_metal_ios[665] = { | |
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,0x76, | |
0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x20,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,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,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, | |
0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b, | |
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, | |
0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x32,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x30,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,0x63,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b, | |
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,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,0x76,0x69, | |
0x65,0x77,0x53,0x69,0x7a,0x65,0x26,0x20,0x5f,0x32,0x38,0x20,0x5b,0x5b,0x62,0x75, | |
0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d, | |
0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x74,0x63, | |
0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x70,0x6f,0x73,0x20,0x3d, | |
0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x32,0x2e,0x30,0x20, | |
0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x2e,0x78,0x29,0x20, | |
0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e, | |
0x78,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20, | |
0x28,0x28,0x32,0x2e,0x30,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65, | |
0x78,0x30,0x2e,0x79,0x29,0x20,0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65, | |
0x77,0x53,0x69,0x7a,0x65,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, | |
0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, | |
0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#pragma clang diagnostic ignored "-Wmissing-prototypes" | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct frag | |
{ | |
float4 dummy[11]; | |
}; | |
struct main0_out | |
{ | |
float4 outColor [[color(0)]]; | |
}; | |
struct main0_in | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
}; | |
static inline __attribute__((always_inline)) | |
float strokeMask(constant frag& _59, thread float2& ftcoord) | |
{ | |
return fast::min(1.0, (1.0 - abs(fma(ftcoord.x, 2.0, -1.0))) * _59.dummy[10].x) * fast::min(1.0, ftcoord.y); | |
} | |
static inline __attribute__((always_inline)) | |
float scissorMask(thread const float2& p, constant frag& _59) | |
{ | |
float2 _109 = fma(-(abs((float3x3(float3(_59.dummy[0].xyz), float3(_59.dummy[1].xyz), float3(_59.dummy[2].xyz)) * float3(p, 1.0)).xy) - _59.dummy[8].xy), _59.dummy[8].zw, float2(0.5)); | |
return fast::clamp(_109.x, 0.0, 1.0) * fast::clamp(_109.y, 0.0, 1.0); | |
} | |
static inline __attribute__((always_inline)) | |
float sdroundrect(thread const float2& pt, thread const float2& ext, thread const float& rad) | |
{ | |
float2 _33 = abs(pt) - (ext - float2(rad, rad)); | |
return (fast::min(fast::max(_33.x, _33.y), 0.0) + length(fast::max(_33, float2(0.0)))) - rad; | |
} | |
fragment main0_out main0(main0_in in [[stage_in]], constant frag& _59 [[buffer(0)]], texture2d<float> tex [[texture(0)]], sampler smp [[sampler(0)]]) | |
{ | |
main0_out out = {}; | |
float _142 = strokeMask(_59, in.ftcoord); | |
if (_142 < _59.dummy[10].y) | |
{ | |
discard_fragment(); | |
} | |
float2 param = in.fpos; | |
float _155 = scissorMask(param, _59); | |
if (_155 == 0.0) | |
{ | |
return out; | |
} | |
int _164 = int(_59.dummy[10].w); | |
float4 result; | |
if (_164 == 0) | |
{ | |
float2 param_1 = (float3x3(float3(_59.dummy[3].xyz), float3(_59.dummy[4].xyz), float3(_59.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy; | |
float2 param_2 = _59.dummy[9].xy; | |
float param_3 = _59.dummy[9].z; | |
result = mix(_59.dummy[6], _59.dummy[7], float4(fast::clamp(fma(_59.dummy[9].w, 0.5, sdroundrect(param_1, param_2, param_3)) / _59.dummy[9].w, 0.0, 1.0))) * (_142 * _155); | |
} | |
else | |
{ | |
if (_164 == 1) | |
{ | |
float4 color = tex.sample(smp, ((float3x3(float3(_59.dummy[3].xyz), float3(_59.dummy[4].xyz), float3(_59.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy / _59.dummy[9].xy)); | |
int _294 = int(_59.dummy[10].z); | |
if (_294 == 1) | |
{ | |
color = float4(color.xyz * color.w, color.w); | |
} | |
if (_294 == 2) | |
{ | |
color = float4(color.x); | |
} | |
bool _321 = _294 == 3; | |
bool _327; | |
if (_321) | |
{ | |
_327 = color.w == 1.0; | |
} | |
else | |
{ | |
_327 = _321; | |
} | |
if (_327) | |
{ | |
discard_fragment(); | |
} | |
float4 _333 = color; | |
float4 _339 = (_333 * _59.dummy[6]) * (_142 * _155); | |
color = _339; | |
result = _339; | |
} | |
else | |
{ | |
if (_164 == 2) | |
{ | |
result = float4(1.0); | |
} | |
else | |
{ | |
if (_164 == 3) | |
{ | |
float4 color_1 = tex.sample(smp, in.ftcoord); | |
int _364 = int(_59.dummy[10].z); | |
if (_364 == 1) | |
{ | |
color_1 = float4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_364 == 2) | |
{ | |
color_1 = float4(color_1.x); | |
} | |
result = (color_1 * _155) * _59.dummy[6]; | |
} | |
} | |
} | |
} | |
out.outColor = result; | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_aa_fs_aa_source_metal_ios[3833] = { | |
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,0x66,0x72,0x61,0x67,0x0a,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x31,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, | |
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75,0x74,0x43,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,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c, | |
0x6f,0x63,0x6e,0x31,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, | |
0x73,0x74,0x72,0x6f,0x6b,0x65,0x4d,0x61,0x73,0x6b,0x28,0x63,0x6f,0x6e,0x73,0x74, | |
0x61,0x6e,0x74,0x20,0x66,0x72,0x61,0x67,0x26,0x20,0x5f,0x35,0x39,0x2c,0x20,0x74, | |
0x68,0x72,0x65,0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x66,0x74, | |
0x63,0x6f,0x6f,0x72,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, | |
0x75,0x72,0x6e,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x31,0x2e, | |
0x30,0x2c,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x61,0x62,0x73,0x28,0x66,0x6d, | |
0x61,0x28,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x2c,0x20,0x32,0x2e,0x30, | |
0x2c,0x20,0x2d,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x2e, | |
0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2a,0x20,0x66, | |
0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,0x2c,0x20,0x66,0x74, | |
0x63,0x6f,0x6f,0x72,0x64,0x2e,0x79,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, | |
0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x70,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61, | |
0x67,0x26,0x20,0x5f,0x35,0x39,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x30,0x39,0x20,0x3d,0x20,0x66,0x6d,0x61,0x28, | |
0x2d,0x28,0x61,0x62,0x73,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x70,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e, | |
0x78,0x79,0x29,0x20,0x2d,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x38,0x5d,0x2e,0x78,0x79,0x29,0x2c,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x38,0x5d,0x2e,0x7a,0x77,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, | |
0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, | |
0x6e,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x39,0x2e,0x78,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20, | |
0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x39,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,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,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65, | |
0x63,0x74,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x70,0x74,0x2c,0x20,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x65,0x78,0x74,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,0x29,0x0a,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x33,0x33,0x20, | |
0x3d,0x20,0x61,0x62,0x73,0x28,0x70,0x74,0x29,0x20,0x2d,0x20,0x28,0x65,0x78,0x74, | |
0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x2c,0x20,0x72, | |
0x61,0x64,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, | |
0x20,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x66,0x61,0x73,0x74, | |
0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x33,0x2e,0x78,0x2c,0x20,0x5f,0x33,0x33, | |
0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67, | |
0x74,0x68,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x33, | |
0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x29, | |
0x20,0x2d,0x20,0x72,0x61,0x64,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,0x63,0x6f, | |
0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61,0x67,0x26,0x20,0x5f,0x35,0x39, | |
0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,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,0x31,0x34,0x32,0x20,0x3d,0x20,0x73,0x74,0x72,0x6f, | |
0x6b,0x65,0x4d,0x61,0x73,0x6b,0x28,0x5f,0x35,0x39,0x2c,0x20,0x69,0x6e,0x2e,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, | |
0x28,0x5f,0x31,0x34,0x32,0x20,0x3c,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x31,0x30,0x5d,0x2e,0x79,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66, | |
0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61, | |
0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x35,0x20,0x3d,0x20,0x73,0x63, | |
0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c, | |
0x20,0x5f,0x35,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x31,0x35,0x35,0x20,0x3d,0x3d,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, | |
0x20,0x6f,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x69,0x6e,0x74,0x20,0x5f,0x31,0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f, | |
0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x77,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x72,0x65,0x73,0x75, | |
0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34, | |
0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61, | |
0x6d,0x5f,0x31,0x20,0x3d,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20, | |
0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32, | |
0x20,0x3d,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e, | |
0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x35,0x39,0x2e, | |
0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78, | |
0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x2c,0x20,0x5f, | |
0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x37,0x5d,0x2c,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28, | |
0x66,0x6d,0x61,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d, | |
0x2e,0x77,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64, | |
0x72,0x65,0x63,0x74,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, | |
0x20,0x2f,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e, | |
0x77,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a, | |
0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, | |
0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, | |
0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c, | |
0x20,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61, | |
0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d,0x2e, | |
0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x33,0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29, | |
0x29,0x2e,0x78,0x79,0x20,0x2f,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x39,0x5d,0x2e,0x78,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x39,0x34,0x20,0x3d, | |
0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31, | |
0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x31, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63, | |
0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x34, | |
0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x32, | |
0x31,0x20,0x3d,0x20,0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20, | |
0x5f,0x33,0x32,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x31,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33, | |
0x32,0x37,0x20,0x3d,0x20,0x5f,0x33,0x32,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x37,0x29,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73, | |
0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x34,0x20,0x5f,0x33,0x33,0x33,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x34,0x20,0x5f,0x33,0x33,0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x33,0x33,0x20, | |
0x2a,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x29,0x20, | |
0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c, | |
0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20, | |
0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x32, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28, | |
0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x33, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d, | |
0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x74,0x63,0x6f, | |
0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33, | |
0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, | |
0x66,0x20,0x28,0x5f,0x33,0x36,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c, | |
0x6f,0x72,0x5f,0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x5f,0x31,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, | |
0x5f,0x33,0x36,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x31,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x31,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x2e, | |
0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75, | |
0x74,0x2e,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x72,0x65,0x73, | |
0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, | |
0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct viewSize | |
{ | |
float4 _viewSize; | |
}; | |
struct main0_out | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
float4 gl_Position [[position]]; | |
}; | |
struct main0_in | |
{ | |
float2 vertex0 [[attribute(0)]]; | |
float2 tcoord [[attribute(1)]]; | |
}; | |
vertex main0_out main0(main0_in in [[stage_in]], constant viewSize& _28 [[buffer(0)]]) | |
{ | |
main0_out out = {}; | |
out.ftcoord = in.tcoord; | |
out.fpos = in.vertex0; | |
out.gl_Position = float4(((2.0 * in.vertex0.x) / _28._viewSize.x) - 1.0, 1.0 - ((2.0 * in.vertex0.y) / _28._viewSize.y), 0.0, 1.0); | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_aa_vs_aa_source_metal_sim[665] = { | |
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,0x76, | |
0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x34,0x20,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,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,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,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,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, | |
0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b, | |
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, | |
0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x32,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x30,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,0x63,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b, | |
0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,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,0x76,0x69, | |
0x65,0x77,0x53,0x69,0x7a,0x65,0x26,0x20,0x5f,0x32,0x38,0x20,0x5b,0x5b,0x62,0x75, | |
0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d, | |
0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x74,0x63, | |
0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x63,0x6f,0x6f,0x72,0x64, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x70,0x6f,0x73,0x20,0x3d, | |
0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x28,0x28,0x32,0x2e,0x30,0x20, | |
0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65,0x78,0x30,0x2e,0x78,0x29,0x20, | |
0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e, | |
0x78,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20, | |
0x28,0x28,0x32,0x2e,0x30,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x76,0x65,0x72,0x74,0x65, | |
0x78,0x30,0x2e,0x79,0x29,0x20,0x2f,0x20,0x5f,0x32,0x38,0x2e,0x5f,0x76,0x69,0x65, | |
0x77,0x53,0x69,0x7a,0x65,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, | |
0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, | |
0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
#pragma clang diagnostic ignored "-Wmissing-prototypes" | |
#include <metal_stdlib> | |
#include <simd/simd.h> | |
using namespace metal; | |
struct frag | |
{ | |
float4 dummy[11]; | |
}; | |
struct main0_out | |
{ | |
float4 outColor [[color(0)]]; | |
}; | |
struct main0_in | |
{ | |
float2 ftcoord [[user(locn0)]]; | |
float2 fpos [[user(locn1)]]; | |
}; | |
static inline __attribute__((always_inline)) | |
float strokeMask(constant frag& _59, thread float2& ftcoord) | |
{ | |
return fast::min(1.0, (1.0 - abs(fma(ftcoord.x, 2.0, -1.0))) * _59.dummy[10].x) * fast::min(1.0, ftcoord.y); | |
} | |
static inline __attribute__((always_inline)) | |
float scissorMask(thread const float2& p, constant frag& _59) | |
{ | |
float2 _109 = fma(-(abs((float3x3(float3(_59.dummy[0].xyz), float3(_59.dummy[1].xyz), float3(_59.dummy[2].xyz)) * float3(p, 1.0)).xy) - _59.dummy[8].xy), _59.dummy[8].zw, float2(0.5)); | |
return fast::clamp(_109.x, 0.0, 1.0) * fast::clamp(_109.y, 0.0, 1.0); | |
} | |
static inline __attribute__((always_inline)) | |
float sdroundrect(thread const float2& pt, thread const float2& ext, thread const float& rad) | |
{ | |
float2 _33 = abs(pt) - (ext - float2(rad, rad)); | |
return (fast::min(fast::max(_33.x, _33.y), 0.0) + length(fast::max(_33, float2(0.0)))) - rad; | |
} | |
fragment main0_out main0(main0_in in [[stage_in]], constant frag& _59 [[buffer(0)]], texture2d<float> tex [[texture(0)]], sampler smp [[sampler(0)]]) | |
{ | |
main0_out out = {}; | |
float _142 = strokeMask(_59, in.ftcoord); | |
if (_142 < _59.dummy[10].y) | |
{ | |
discard_fragment(); | |
} | |
float2 param = in.fpos; | |
float _155 = scissorMask(param, _59); | |
if (_155 == 0.0) | |
{ | |
return out; | |
} | |
int _164 = int(_59.dummy[10].w); | |
float4 result; | |
if (_164 == 0) | |
{ | |
float2 param_1 = (float3x3(float3(_59.dummy[3].xyz), float3(_59.dummy[4].xyz), float3(_59.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy; | |
float2 param_2 = _59.dummy[9].xy; | |
float param_3 = _59.dummy[9].z; | |
result = mix(_59.dummy[6], _59.dummy[7], float4(fast::clamp(fma(_59.dummy[9].w, 0.5, sdroundrect(param_1, param_2, param_3)) / _59.dummy[9].w, 0.0, 1.0))) * (_142 * _155); | |
} | |
else | |
{ | |
if (_164 == 1) | |
{ | |
float4 color = tex.sample(smp, ((float3x3(float3(_59.dummy[3].xyz), float3(_59.dummy[4].xyz), float3(_59.dummy[5].xyz)) * float3(in.fpos, 1.0)).xy / _59.dummy[9].xy)); | |
int _294 = int(_59.dummy[10].z); | |
if (_294 == 1) | |
{ | |
color = float4(color.xyz * color.w, color.w); | |
} | |
if (_294 == 2) | |
{ | |
color = float4(color.x); | |
} | |
bool _321 = _294 == 3; | |
bool _327; | |
if (_321) | |
{ | |
_327 = color.w == 1.0; | |
} | |
else | |
{ | |
_327 = _321; | |
} | |
if (_327) | |
{ | |
discard_fragment(); | |
} | |
float4 _333 = color; | |
float4 _339 = (_333 * _59.dummy[6]) * (_142 * _155); | |
color = _339; | |
result = _339; | |
} | |
else | |
{ | |
if (_164 == 2) | |
{ | |
result = float4(1.0); | |
} | |
else | |
{ | |
if (_164 == 3) | |
{ | |
float4 color_1 = tex.sample(smp, in.ftcoord); | |
int _364 = int(_59.dummy[10].z); | |
if (_364 == 1) | |
{ | |
color_1 = float4(color_1.xyz * color_1.w, color_1.w); | |
} | |
if (_364 == 2) | |
{ | |
color_1 = float4(color_1.x); | |
} | |
result = (color_1 * _155) * _59.dummy[6]; | |
} | |
} | |
} | |
} | |
out.outColor = result; | |
return out; | |
} | |
*/ | |
#if defined(SOKOL_METAL) | |
static const uint8_t nanovg_aa_fs_aa_source_metal_sim[3833] = { | |
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,0x66,0x72,0x61,0x67,0x0a,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x31,0x31,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, | |
0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75,0x74,0x43,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,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,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,0x32,0x20,0x66,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c, | |
0x6f,0x63,0x6e,0x31,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, | |
0x73,0x74,0x72,0x6f,0x6b,0x65,0x4d,0x61,0x73,0x6b,0x28,0x63,0x6f,0x6e,0x73,0x74, | |
0x61,0x6e,0x74,0x20,0x66,0x72,0x61,0x67,0x26,0x20,0x5f,0x35,0x39,0x2c,0x20,0x74, | |
0x68,0x72,0x65,0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x66,0x74, | |
0x63,0x6f,0x6f,0x72,0x64,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, | |
0x75,0x72,0x6e,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x31,0x2e, | |
0x30,0x2c,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x61,0x62,0x73,0x28,0x66,0x6d, | |
0x61,0x28,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x2c,0x20,0x32,0x2e,0x30, | |
0x2c,0x20,0x2d,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x2e, | |
0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2a,0x20,0x66, | |
0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x31,0x2e,0x30,0x2c,0x20,0x66,0x74, | |
0x63,0x6f,0x6f,0x72,0x64,0x2e,0x79,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, | |
0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x70,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61, | |
0x67,0x26,0x20,0x5f,0x35,0x39,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, | |
0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x30,0x39,0x20,0x3d,0x20,0x66,0x6d,0x61,0x28, | |
0x2d,0x28,0x61,0x62,0x73,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x30,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x70,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x2e, | |
0x78,0x79,0x29,0x20,0x2d,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b, | |
0x38,0x5d,0x2e,0x78,0x79,0x29,0x2c,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x38,0x5d,0x2e,0x7a,0x77,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, | |
0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, | |
0x6e,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x39,0x2e,0x78,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20, | |
0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x31, | |
0x30,0x39,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,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,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65, | |
0x63,0x74,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x70,0x74,0x2c,0x20,0x74,0x68,0x72,0x65, | |
0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26, | |
0x20,0x65,0x78,0x74,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,0x29,0x0a,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x33,0x33,0x20, | |
0x3d,0x20,0x61,0x62,0x73,0x28,0x70,0x74,0x29,0x20,0x2d,0x20,0x28,0x65,0x78,0x74, | |
0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x72,0x61,0x64,0x2c,0x20,0x72, | |
0x61,0x64,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, | |
0x20,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x66,0x61,0x73,0x74, | |
0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x33,0x2e,0x78,0x2c,0x20,0x5f,0x33,0x33, | |
0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67, | |
0x74,0x68,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x33,0x33, | |
0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x29,0x29,0x29,0x29, | |
0x20,0x2d,0x20,0x72,0x61,0x64,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,0x63,0x6f, | |
0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x66,0x72,0x61,0x67,0x26,0x20,0x5f,0x35,0x39, | |
0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,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,0x31,0x34,0x32,0x20,0x3d,0x20,0x73,0x74,0x72,0x6f, | |
0x6b,0x65,0x4d,0x61,0x73,0x6b,0x28,0x5f,0x35,0x39,0x2c,0x20,0x69,0x6e,0x2e,0x66, | |
0x74,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, | |
0x28,0x5f,0x31,0x34,0x32,0x20,0x3c,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x31,0x30,0x5d,0x2e,0x79,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66, | |
0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61, | |
0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x35,0x20,0x3d,0x20,0x73,0x63, | |
0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c, | |
0x20,0x5f,0x35,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, | |
0x31,0x35,0x35,0x20,0x3d,0x3d,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, | |
0x20,0x6f,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x69,0x6e,0x74,0x20,0x5f,0x31,0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f, | |
0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x77,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x72,0x65,0x73,0x75, | |
0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34, | |
0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61, | |
0x6d,0x5f,0x31,0x20,0x3d,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x33,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, | |
0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79, | |
0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20, | |
0x31,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32, | |
0x20,0x3d,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e, | |
0x78,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x35,0x39,0x2e, | |
0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78, | |
0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x2c,0x20,0x5f, | |
0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x37,0x5d,0x2c,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28, | |
0x66,0x6d,0x61,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d, | |
0x2e,0x77,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64, | |
0x72,0x65,0x63,0x74,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, | |
0x20,0x2f,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x5d,0x2e, | |
0x77,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a, | |
0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, | |
0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, | |
0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c, | |
0x20,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61, | |
0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33,0x5d,0x2e, | |
0x78,0x79,0x7a,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20, | |
0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x35,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x33,0x28,0x69,0x6e,0x2e,0x66,0x70,0x6f,0x73,0x2c,0x20,0x31,0x2e,0x30,0x29, | |
0x29,0x2e,0x78,0x79,0x20,0x2f,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79, | |
0x5b,0x39,0x5d,0x2e,0x78,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x39,0x34,0x20,0x3d, | |
0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31, | |
0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x31, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63, | |
0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x34, | |
0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f, | |
0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x32, | |
0x31,0x20,0x3d,0x20,0x5f,0x32,0x39,0x34,0x20,0x3d,0x3d,0x20,0x33,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20, | |
0x5f,0x33,0x32,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x31,0x29,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33, | |
0x32,0x37,0x20,0x3d,0x20,0x5f,0x33,0x32,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x37,0x29,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73, | |
0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, | |
0x34,0x20,0x5f,0x33,0x33,0x33,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, | |
0x74,0x34,0x20,0x5f,0x33,0x33,0x39,0x20,0x3d,0x20,0x28,0x5f,0x33,0x33,0x33,0x20, | |
0x2a,0x20,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x29,0x20, | |
0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c, | |
0x6f,0x72,0x20,0x3d,0x20,0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20, | |
0x5f,0x33,0x33,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x32, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28, | |
0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x36,0x34,0x20,0x3d,0x3d,0x20,0x33, | |
0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63, | |
0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d, | |
0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x74,0x63,0x6f, | |
0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33, | |
0x36,0x34,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x31,0x30,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, | |
0x66,0x20,0x28,0x5f,0x33,0x36,0x34,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c, | |
0x6f,0x72,0x5f,0x31,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x5f,0x31,0x2e,0x77,0x2c,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, | |
0x5f,0x33,0x36,0x34,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31, | |
0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x31,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x31,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x2e, | |
0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75, | |
0x74,0x2e,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x72,0x65,0x73, | |
0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, | |
0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
/* | |
diagnostic(off, derivative_uniformity); | |
struct viewSize { | |
/_ @offset(0) _/ | |
x_viewSize : vec4f, | |
} | |
var<private> ftcoord : vec2f; | |
var<private> tcoord : vec2f; | |
var<private> fpos : vec2f; | |
var<private> vertex_1 : vec2f; | |
@group(0) @binding(0) var<uniform> x_28 : viewSize; | |
var<private> gl_Position : vec4f; | |
fn main_1() { | |
var x : f32; | |
var y : f32; | |
let x_12 : vec2f = tcoord; | |
ftcoord = x_12; | |
let x_15 : vec2f = vertex_1; | |
fpos = x_15; | |
let x_23 : f32 = vertex_1.x; | |
let x_33 : f32 = x_28.x_viewSize.x; | |
x = (((2.0f * x_23) / x_33) - 1.0f); | |
let x_40 : f32 = vertex_1.y; | |
let x_43 : f32 = x_28.x_viewSize.y; | |
y = (1.0f - ((2.0f * x_40) / x_43)); | |
let x_50 : f32 = x; | |
let x_51 : f32 = y; | |
gl_Position = vec4f(x_50, x_51, 0.0f, 1.0f); | |
return; | |
} | |
struct main_out { | |
@location(0) | |
ftcoord_1 : vec2f, | |
@location(1) | |
fpos_1 : vec2f, | |
@builtin(position) | |
gl_Position : vec4f, | |
} | |
@vertex | |
fn main(@location(1) tcoord_param : vec2f, @location(0) vertex_1_param : vec2f) -> main_out { | |
tcoord = tcoord_param; | |
vertex_1 = vertex_1_param; | |
main_1(); | |
return main_out(ftcoord, fpos, gl_Position); | |
} | |
*/ | |
#if defined(SOKOL_WGPU) | |
static const uint8_t nanovg_aa_vs_aa_source_wgsl[1122] = { | |
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, | |
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, | |
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, | |
0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,0x20, | |
0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,0x20, | |
0x78,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x20,0x3a,0x20,0x76,0x65,0x63, | |
0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61, | |
0x74,0x65,0x3e,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74, | |
0x65,0x3e,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,0x76,0x65,0x63,0x32, | |
0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e, | |
0x20,0x66,0x70,0x6f,0x73,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a, | |
0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x76,0x65,0x72, | |
0x74,0x65,0x78,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a, | |
0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69, | |
0x6e,0x67,0x28,0x30,0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72, | |
0x6d,0x3e,0x20,0x78,0x5f,0x32,0x38,0x20,0x3a,0x20,0x76,0x69,0x65,0x77,0x53,0x69, | |
0x7a,0x65,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65, | |
0x3e,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f, | |
0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x78,0x20,0x3a,0x20, | |
0x66,0x33,0x32,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x79,0x20,0x3a,0x20,0x66, | |
0x33,0x32,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x32,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b, | |
0x0a,0x20,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x78,0x5f,0x31, | |
0x32,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x35,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31, | |
0x3b,0x0a,0x20,0x20,0x66,0x70,0x6f,0x73,0x20,0x3d,0x20,0x78,0x5f,0x31,0x35,0x3b, | |
0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x33,0x20,0x3a,0x20,0x66,0x33, | |
0x32,0x20,0x3d,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31,0x2e,0x78,0x3b,0x0a, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x33,0x20,0x3a,0x20,0x66,0x33,0x32, | |
0x20,0x3d,0x20,0x78,0x5f,0x32,0x38,0x2e,0x78,0x5f,0x76,0x69,0x65,0x77,0x53,0x69, | |
0x7a,0x65,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x78,0x20,0x3d,0x20,0x28,0x28,0x28,0x32, | |
0x2e,0x30,0x66,0x20,0x2a,0x20,0x78,0x5f,0x32,0x33,0x29,0x20,0x2f,0x20,0x78,0x5f, | |
0x33,0x33,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x34,0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20, | |
0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x34,0x33,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78, | |
0x5f,0x32,0x38,0x2e,0x78,0x5f,0x76,0x69,0x65,0x77,0x53,0x69,0x7a,0x65,0x2e,0x79, | |
0x3b,0x0a,0x20,0x20,0x79,0x20,0x3d,0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20, | |
0x28,0x28,0x32,0x2e,0x30,0x66,0x20,0x2a,0x20,0x78,0x5f,0x34,0x30,0x29,0x20,0x2f, | |
0x20,0x78,0x5f,0x34,0x33,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, | |
0x5f,0x35,0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x3b,0x0a,0x20, | |
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x31,0x20,0x3a,0x20,0x66,0x33,0x32,0x20, | |
0x3d,0x20,0x79,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, | |
0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x35,0x30,0x2c, | |
0x20,0x78,0x5f,0x35,0x31,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30, | |
0x66,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a, | |
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74, | |
0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30, | |
0x29,0x0a,0x20,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x5f,0x31,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x32,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69, | |
0x6f,0x6e,0x28,0x31,0x29,0x0a,0x20,0x20,0x66,0x70,0x6f,0x73,0x5f,0x31,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x0a,0x20,0x20,0x40,0x62,0x75,0x69,0x6c,0x74, | |
0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x67, | |
0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63, | |
0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x76,0x65,0x72,0x74,0x65,0x78,0x0a,0x66, | |
0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, | |
0x28,0x31,0x29,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74, | |
0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31,0x5f, | |
0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x29,0x20,0x2d, | |
0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x74, | |
0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x74,0x63,0x6f,0x6f,0x72,0x64,0x5f,0x70, | |
0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31, | |
0x20,0x3d,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x31,0x5f,0x70,0x61,0x72,0x61, | |
0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20, | |
0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74, | |
0x28,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x2c,0x20,0x66,0x70,0x6f,0x73,0x2c,0x20, | |
0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a, | |
0x0a,0x00, | |
}; | |
#endif | |
/* | |
diagnostic(off, derivative_uniformity); | |
alias Arr = array<vec4f, 11u>; | |
struct frag { | |
/_ @offset(0) _/ | |
dummy : Arr, | |
} | |
@group(0) @binding(4) var<uniform> x_59 : frag; | |
var<private> ftcoord : vec2f; | |
var<private> fpos : vec2f; | |
@group(1) @binding(48) var tex : texture_2d<f32>; | |
@group(1) @binding(64) var smp : sampler; | |
var<private> outColor : vec4f; | |
fn strokeMask_() -> f32 { | |
let x_123 : f32 = ftcoord.x; | |
let x_132 : f32 = x_59.dummy[10i].x; | |
let x_136 : f32 = ftcoord.y; | |
return (min(1.0f, ((1.0f - abs(((x_123 * 2.0f) - 1.0f))) * x_132)) * min(1.0f, x_136)); | |
} | |
fn scissorMask_vf2_(p : ptr<function, vec2f>) -> f32 { | |
var sc : vec2f; | |
let x_65 : vec4f = x_59.dummy[0i]; | |
let x_66 : vec3f = vec3f(x_65.x, x_65.y, x_65.z); | |
let x_69 : vec4f = x_59.dummy[1i]; | |
let x_70 : vec3f = vec3f(x_69.x, x_69.y, x_69.z); | |
let x_73 : vec4f = x_59.dummy[2i]; | |
let x_74 : vec3f = vec3f(x_73.x, x_73.y, x_73.z); | |
let x_90 : vec2f = *(p); | |
let x_94 : vec3f = (mat3x3f(vec3f(x_66.x, x_66.y, x_66.z), vec3f(x_70.x, x_70.y, x_70.z), vec3f(x_74.x, x_74.y, x_74.z)) * vec3f(x_90.x, x_90.y, 1.0f)); | |
let x_99 : vec4f = x_59.dummy[8i]; | |
sc = (abs(vec2f(x_94.x, x_94.y)) - vec2f(x_99.x, x_99.y)); | |
let x_104 : vec2f = sc; | |
let x_106 : vec4f = x_59.dummy[8i]; | |
sc = (vec2f(0.5f, 0.5f) - (x_104 * vec2f(x_106.z, x_106.w))); | |
let x_111 : f32 = sc.x; | |
let x_114 : f32 = sc.y; | |
return (clamp(x_111, 0.0f, 1.0f) * clamp(x_114, 0.0f, 1.0f)); | |
} | |
fn sdroundrect_vf2_vf2_f1_(pt : ptr<function, vec2f>, ext : ptr<function, vec2f>, rad : ptr<function, f32>) -> f32 { | |
var ext2 : vec2f; | |
var d : vec2f; | |
let x_24 : vec2f = *(ext); | |
let x_25 : f32 = *(rad); | |
let x_26 : f32 = *(rad); | |
ext2 = (x_24 - vec2f(x_25, x_26)); | |
let x_30 : vec2f = *(pt); | |
let x_32 : vec2f = ext2; | |
d = (abs(x_30) - x_32); | |
let x_37 : f32 = d.x; | |
let x_40 : f32 = d.y; | |
let x_44 : vec2f = d; | |
let x_49 : f32 = *(rad); | |
return ((min(max(x_37, x_40), 0.0f) + length(max(x_44, vec2f(0.0f, 0.0f)))) - x_49); | |
} | |
fn main_1() { | |
var strokeAlpha : f32; | |
var scissor : f32; | |
var param : vec2f; | |
var pt_1 : vec2f; | |
var d_1 : f32; | |
var param_1 : vec2f; | |
var param_2 : vec2f; | |
var param_3 : f32; | |
var color : vec4f; | |
var result : vec4f; | |
var pt_2 : vec2f; | |
var color_1 : vec4f; | |
var color_2 : vec4f; | |
let x_142 : f32 = strokeMask_(); | |
strokeAlpha = x_142; | |
let x_143 : f32 = strokeAlpha; | |
let x_145 : f32 = x_59.dummy[10i].y; | |
if ((x_143 < x_145)) { | |
discard; | |
} | |
let x_154 : vec2f = fpos; | |
param = x_154; | |
let x_155 : f32 = scissorMask_vf2_(&(param)); | |
scissor = x_155; | |
let x_156 : f32 = scissor; | |
if ((x_156 == 0.0f)) { | |
return; | |
} | |
let x_163 : f32 = x_59.dummy[10i].w; | |
if ((i32(x_163) == 0i)) { | |
let x_171 : vec4f = x_59.dummy[3i]; | |
let x_172 : vec3f = vec3f(x_171.x, x_171.y, x_171.z); | |
let x_175 : vec4f = x_59.dummy[4i]; | |
let x_176 : vec3f = vec3f(x_175.x, x_175.y, x_175.z); | |
let x_179 : vec4f = x_59.dummy[5i]; | |
let x_180 : vec3f = vec3f(x_179.x, x_179.y, x_179.z); | |
let x_194 : vec2f = fpos; | |
let x_198 : vec3f = (mat3x3f(vec3f(x_172.x, x_172.y, x_172.z), vec3f(x_176.x, x_176.y, x_176.z), vec3f(x_180.x, x_180.y, x_180.z)) * vec3f(x_194.x, x_194.y, 1.0f)); | |
pt_1 = vec2f(x_198.x, x_198.y); | |
let x_203 : vec2f = pt_1; | |
param_1 = x_203; | |
let x_206 : vec4f = x_59.dummy[9i]; | |
param_2 = vec2f(x_206.x, x_206.y); | |
let x_211 : f32 = x_59.dummy[9i].z; | |
param_3 = x_211; | |
let x_212 : f32 = sdroundrect_vf2_vf2_f1_(&(param_1), &(param_2), &(param_3)); | |
let x_214 : f32 = x_59.dummy[9i].w; | |
let x_218 : f32 = x_59.dummy[9i].w; | |
d_1 = clamp(((x_212 + (x_214 * 0.5f)) / x_218), 0.0f, 1.0f); | |
let x_225 : vec4f = x_59.dummy[6i]; | |
let x_228 : vec4f = x_59.dummy[7i]; | |
let x_229 : f32 = d_1; | |
color = mix(x_225, x_228, vec4f(x_229, x_229, x_229, x_229)); | |
let x_232 : f32 = strokeAlpha; | |
let x_233 : f32 = scissor; | |
let x_235 : vec4f = color; | |
color = (x_235 * (x_232 * x_233)); | |
let x_238 : vec4f = color; | |
result = x_238; | |
} else { | |
var x_326 : bool; | |
var x_327 : bool; | |
let x_241 : f32 = x_59.dummy[10i].w; | |
if ((i32(x_241) == 1i)) { | |
let x_248 : vec4f = x_59.dummy[3i]; | |
let x_249 : vec3f = vec3f(x_248.x, x_248.y, x_248.z); | |
let x_251 : vec4f = x_59.dummy[4i]; | |
let x_252 : vec3f = vec3f(x_251.x, x_251.y, x_251.z); | |
let x_254 : vec4f = x_59.dummy[5i]; | |
let x_255 : vec3f = vec3f(x_254.x, x_254.y, x_254.z); | |
let x_269 : vec2f = fpos; | |
let x_273 : vec3f = (mat3x3f(vec3f(x_249.x, x_249.y, x_249.z), vec3f(x_252.x, x_252.y, x_252.z), vec3f(x_255.x, x_255.y, x_255.z)) * vec3f(x_269.x, x_269.y, 1.0f)); | |
let x_276 : vec4f = x_59.dummy[9i]; | |
pt_2 = (vec2f(x_273.x, x_273.y) / vec2f(x_276.x, x_276.y)); | |
let x_290 : vec2f = pt_2; | |
let x_291 : vec4f = textureSample(tex, smp, x_290); | |
color_1 = x_291; | |
let x_293 : f32 = x_59.dummy[10i].z; | |
if ((i32(x_293) == 1i)) { | |
let x_298 : vec4f = color_1; | |
let x_301 : f32 = color_1.w; | |
let x_302 : vec3f = (vec3f(x_298.x, x_298.y, x_298.z) * x_301); | |
let x_304 : f32 = color_1.w; | |
color_1 = vec4f(x_302.x, x_302.y, x_302.z, x_304); | |
} | |
let x_310 : f32 = x_59.dummy[10i].z; | |
if ((i32(x_310) == 2i)) { | |
let x_316 : f32 = color_1.x; | |
color_1 = vec4f(x_316, x_316, x_316, x_316); | |
} | |
let x_319 : f32 = x_59.dummy[10i].z; | |
let x_321 : bool = (i32(x_319) == 3i); | |
x_327 = x_321; | |
if (x_321) { | |
let x_325 : f32 = color_1.w; | |
x_326 = (x_325 == 1.0f); | |
x_327 = x_326; | |
} | |
if (x_327) { | |
discard; | |
} | |
let x_332 : vec4f = x_59.dummy[6i]; | |
let x_333 : vec4f = color_1; | |
color_1 = (x_333 * x_332); | |
let x_335 : f32 = strokeAlpha; | |
let x_336 : f32 = scissor; | |
let x_338 : vec4f = color_1; | |
color_1 = (x_338 * (x_335 * x_336)); | |
let x_340 : vec4f = color_1; | |
result = x_340; | |
} else { | |
let x_343 : f32 = x_59.dummy[10i].w; | |
if ((i32(x_343) == 2i)) { | |
result = vec4f(1.0f, 1.0f, 1.0f, 1.0f); | |
} else { | |
let x_351 : f32 = x_59.dummy[10i].w; | |
if ((i32(x_351) == 3i)) { | |
let x_360 : vec2f = ftcoord; | |
let x_361 : vec4f = textureSample(tex, smp, x_360); | |
color_2 = x_361; | |
let x_363 : f32 = x_59.dummy[10i].z; | |
if ((i32(x_363) == 1i)) { | |
let x_368 : vec4f = color_2; | |
let x_371 : f32 = color_2.w; | |
let x_372 : vec3f = (vec3f(x_368.x, x_368.y, x_368.z) * x_371); | |
let x_374 : f32 = color_2.w; | |
color_2 = vec4f(x_372.x, x_372.y, x_372.z, x_374); | |
} | |
let x_380 : f32 = x_59.dummy[10i].z; | |
if ((i32(x_380) == 2i)) { | |
let x_386 : f32 = color_2.x; | |
color_2 = vec4f(x_386, x_386, x_386, x_386); | |
} | |
let x_388 : vec4f = color_2; | |
let x_389 : f32 = scissor; | |
let x_392 : vec4f = x_59.dummy[6i]; | |
result = ((x_388 * x_389) * x_392); | |
} | |
} | |
} | |
} | |
let x_396 : vec4f = result; | |
outColor = x_396; | |
return; | |
} | |
struct main_out { | |
@location(0) | |
outColor_1 : vec4f, | |
} | |
@fragment | |
fn main(@location(0) ftcoord_param : vec2f, @location(1) fpos_param : vec2f) -> main_out { | |
ftcoord = ftcoord_param; | |
fpos = fpos_param; | |
main_1(); | |
return main_out(outColor); | |
} | |
*/ | |
#if defined(SOKOL_WGPU) | |
static const uint8_t nanovg_aa_fs_aa_source_wgsl[7373] = { | |
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, | |
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, | |
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x61,0x6c,0x69,0x61,0x73,0x20,0x41, | |
0x72,0x72,0x20,0x3d,0x20,0x61,0x72,0x72,0x61,0x79,0x3c,0x76,0x65,0x63,0x34,0x66, | |
0x2c,0x20,0x31,0x31,0x75,0x3e,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, | |
0x66,0x72,0x61,0x67,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66, | |
0x73,0x65,0x74,0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,0x20,0x64,0x75,0x6d,0x6d, | |
0x79,0x20,0x3a,0x20,0x41,0x72,0x72,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x67,0x72,0x6f, | |
0x75,0x70,0x28,0x30,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x34, | |
0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78, | |
0x5f,0x35,0x39,0x20,0x3a,0x20,0x66,0x72,0x61,0x67,0x3b,0x0a,0x0a,0x76,0x61,0x72, | |
0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72, | |
0x64,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c, | |
0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x70,0x6f,0x73,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x31, | |
0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x34,0x38,0x29,0x20,0x76, | |
0x61,0x72,0x20,0x74,0x65,0x78,0x20,0x3a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, | |
0x5f,0x32,0x64,0x3c,0x66,0x33,0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75, | |
0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x36,0x34, | |
0x29,0x20,0x76,0x61,0x72,0x20,0x73,0x6d,0x70,0x20,0x3a,0x20,0x73,0x61,0x6d,0x70, | |
0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74, | |
0x65,0x3e,0x20,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x4d, | |
0x61,0x73,0x6b,0x5f,0x28,0x29,0x20,0x2d,0x3e,0x20,0x66,0x33,0x32,0x20,0x7b,0x0a, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x32,0x33,0x20,0x3a,0x20,0x66,0x33, | |
0x32,0x20,0x3d,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x3b,0x0a,0x20, | |
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x33,0x32,0x20,0x3a,0x20,0x66,0x33,0x32, | |
0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30, | |
0x69,0x5d,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x33, | |
0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72, | |
0x64,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x6d, | |
0x69,0x6e,0x28,0x31,0x2e,0x30,0x66,0x2c,0x20,0x28,0x28,0x31,0x2e,0x30,0x66,0x20, | |
0x2d,0x20,0x61,0x62,0x73,0x28,0x28,0x28,0x78,0x5f,0x31,0x32,0x33,0x20,0x2a,0x20, | |
0x32,0x2e,0x30,0x66,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x66,0x29,0x29,0x29,0x20, | |
0x2a,0x20,0x78,0x5f,0x31,0x33,0x32,0x29,0x29,0x20,0x2a,0x20,0x6d,0x69,0x6e,0x28, | |
0x31,0x2e,0x30,0x66,0x2c,0x20,0x78,0x5f,0x31,0x33,0x36,0x29,0x29,0x3b,0x0a,0x7d, | |
0x0a,0x0a,0x66,0x6e,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d,0x61,0x73,0x6b, | |
0x5f,0x76,0x66,0x32,0x5f,0x28,0x70,0x20,0x3a,0x20,0x70,0x74,0x72,0x3c,0x66,0x75, | |
0x6e,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76,0x65,0x63,0x32,0x66,0x3e,0x29,0x20, | |
0x2d,0x3e,0x20,0x66,0x33,0x32,0x20,0x7b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x73, | |
0x63,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x36,0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20, | |
0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x30,0x69,0x5d,0x3b,0x0a, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x36,0x20,0x3a,0x20,0x76,0x65,0x63, | |
0x33,0x66,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x36,0x35,0x2e, | |
0x78,0x2c,0x20,0x78,0x5f,0x36,0x35,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x36,0x35,0x2e, | |
0x7a,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x39,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75, | |
0x6d,0x6d,0x79,0x5b,0x31,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, | |
0x5f,0x37,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x65, | |
0x63,0x33,0x66,0x28,0x78,0x5f,0x36,0x39,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x36,0x39, | |
0x2e,0x79,0x2c,0x20,0x78,0x5f,0x36,0x39,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x37,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20, | |
0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x32,0x69,0x5d, | |
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x34,0x20,0x3a,0x20,0x76, | |
0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x37, | |
0x33,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x37,0x33,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x37, | |
0x33,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x30, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x2a,0x28,0x70,0x29,0x3b, | |
0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x34,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x33,0x66,0x20,0x3d,0x20,0x28,0x6d,0x61,0x74,0x33,0x78,0x33,0x66,0x28,0x76, | |
0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x36,0x36,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x36, | |
0x36,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x36,0x36,0x2e,0x7a,0x29,0x2c,0x20,0x76,0x65, | |
0x63,0x33,0x66,0x28,0x78,0x5f,0x37,0x30,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x37,0x30, | |
0x2e,0x79,0x2c,0x20,0x78,0x5f,0x37,0x30,0x2e,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63, | |
0x33,0x66,0x28,0x78,0x5f,0x37,0x34,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x37,0x34,0x2e, | |
0x79,0x2c,0x20,0x78,0x5f,0x37,0x34,0x2e,0x7a,0x29,0x29,0x20,0x2a,0x20,0x76,0x65, | |
0x63,0x33,0x66,0x28,0x78,0x5f,0x39,0x30,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x39,0x30, | |
0x2e,0x79,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x39,0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d, | |
0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x38,0x69,0x5d,0x3b, | |
0x0a,0x20,0x20,0x73,0x63,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x76,0x65,0x63, | |
0x32,0x66,0x28,0x78,0x5f,0x39,0x34,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x39,0x34,0x2e, | |
0x79,0x29,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x39,0x39, | |
0x2e,0x78,0x2c,0x20,0x78,0x5f,0x39,0x39,0x2e,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x30,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x32, | |
0x66,0x20,0x3d,0x20,0x73,0x63,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x31,0x30,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f, | |
0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x38,0x69,0x5d,0x3b,0x0a,0x20,0x20, | |
0x73,0x63,0x20,0x3d,0x20,0x28,0x76,0x65,0x63,0x32,0x66,0x28,0x30,0x2e,0x35,0x66, | |
0x2c,0x20,0x30,0x2e,0x35,0x66,0x29,0x20,0x2d,0x20,0x28,0x78,0x5f,0x31,0x30,0x34, | |
0x20,0x2a,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x31,0x30,0x36,0x2e,0x7a, | |
0x2c,0x20,0x78,0x5f,0x31,0x30,0x36,0x2e,0x77,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x31,0x31,0x20,0x3a,0x20,0x66,0x33,0x32,0x20, | |
0x3d,0x20,0x73,0x63,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x31,0x31,0x34,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x63,0x2e,0x79, | |
0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x63,0x6c,0x61,0x6d, | |
0x70,0x28,0x78,0x5f,0x31,0x31,0x31,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31, | |
0x2e,0x30,0x66,0x29,0x20,0x2a,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x78,0x5f,0x31, | |
0x31,0x34,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x29, | |
0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6e,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72, | |
0x65,0x63,0x74,0x5f,0x76,0x66,0x32,0x5f,0x76,0x66,0x32,0x5f,0x66,0x31,0x5f,0x28, | |
0x70,0x74,0x20,0x3a,0x20,0x70,0x74,0x72,0x3c,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, | |
0x6e,0x2c,0x20,0x76,0x65,0x63,0x32,0x66,0x3e,0x2c,0x20,0x65,0x78,0x74,0x20,0x3a, | |
0x20,0x70,0x74,0x72,0x3c,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76, | |
0x65,0x63,0x32,0x66,0x3e,0x2c,0x20,0x72,0x61,0x64,0x20,0x3a,0x20,0x70,0x74,0x72, | |
0x3c,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x66,0x33,0x32,0x3e,0x29, | |
0x20,0x2d,0x3e,0x20,0x66,0x33,0x32,0x20,0x7b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20, | |
0x65,0x78,0x74,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x20,0x20, | |
0x76,0x61,0x72,0x20,0x64,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x20, | |
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x32, | |
0x66,0x20,0x3d,0x20,0x2a,0x28,0x65,0x78,0x74,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x32,0x35,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x2a, | |
0x28,0x72,0x61,0x64,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32, | |
0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x2a,0x28,0x72,0x61,0x64,0x29, | |
0x3b,0x0a,0x20,0x20,0x65,0x78,0x74,0x32,0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x34, | |
0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x32,0x35,0x2c,0x20,0x78, | |
0x5f,0x32,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33, | |
0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x2a,0x28,0x70,0x74, | |
0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x32,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x65,0x78,0x74,0x32,0x3b,0x0a,0x20,0x20, | |
0x64,0x20,0x3d,0x20,0x28,0x61,0x62,0x73,0x28,0x78,0x5f,0x33,0x30,0x29,0x20,0x2d, | |
0x20,0x78,0x5f,0x33,0x32,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x33,0x37,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x64,0x2e,0x78,0x3b,0x0a, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x30,0x20,0x3a,0x20,0x66,0x33,0x32, | |
0x20,0x3d,0x20,0x64,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x34,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x64,0x3b,0x0a, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x39,0x20,0x3a,0x20,0x66,0x33,0x32, | |
0x20,0x3d,0x20,0x2a,0x28,0x72,0x61,0x64,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74, | |
0x75,0x72,0x6e,0x20,0x28,0x28,0x6d,0x69,0x6e,0x28,0x6d,0x61,0x78,0x28,0x78,0x5f, | |
0x33,0x37,0x2c,0x20,0x78,0x5f,0x34,0x30,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29, | |
0x20,0x2b,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x6d,0x61,0x78,0x28,0x78,0x5f, | |
0x34,0x34,0x2c,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x30,0x2e,0x30,0x66,0x2c,0x20, | |
0x30,0x2e,0x30,0x66,0x29,0x29,0x29,0x29,0x20,0x2d,0x20,0x78,0x5f,0x34,0x39,0x29, | |
0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29, | |
0x20,0x7b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x41, | |
0x6c,0x70,0x68,0x61,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x20,0x20,0x76,0x61, | |
0x72,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b, | |
0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76, | |
0x65,0x63,0x32,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x74,0x5f,0x31, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20, | |
0x64,0x5f,0x31,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72, | |
0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66, | |
0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70, | |
0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x20,0x20, | |
0x76,0x61,0x72,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34, | |
0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70, | |
0x74,0x5f,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x20,0x20,0x76, | |
0x61,0x72,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63, | |
0x34,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x31,0x34,0x32,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73, | |
0x74,0x72,0x6f,0x6b,0x65,0x4d,0x61,0x73,0x6b,0x5f,0x28,0x29,0x3b,0x0a,0x20,0x20, | |
0x73,0x74,0x72,0x6f,0x6b,0x65,0x41,0x6c,0x70,0x68,0x61,0x20,0x3d,0x20,0x78,0x5f, | |
0x31,0x34,0x32,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x34,0x33, | |
0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x41, | |
0x6c,0x70,0x68,0x61,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x34, | |
0x35,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x69, | |
0x66,0x20,0x28,0x28,0x78,0x5f,0x31,0x34,0x33,0x20,0x3c,0x20,0x78,0x5f,0x31,0x34, | |
0x35,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72, | |
0x64,0x3b,0x0a,0x20,0x20,0x7d,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31, | |
0x35,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x66,0x70,0x6f, | |
0x73,0x3b,0x0a,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x78,0x5f,0x31, | |
0x35,0x34,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x35,0x35,0x20, | |
0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x4d, | |
0x61,0x73,0x6b,0x5f,0x76,0x66,0x32,0x5f,0x28,0x26,0x28,0x70,0x61,0x72,0x61,0x6d, | |
0x29,0x29,0x3b,0x0a,0x20,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x20,0x3d,0x20, | |
0x78,0x5f,0x31,0x35,0x35,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31, | |
0x35,0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x63,0x69,0x73,0x73, | |
0x6f,0x72,0x3b,0x0a,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x78,0x5f,0x31,0x35,0x36, | |
0x20,0x3d,0x3d,0x20,0x30,0x2e,0x30,0x66,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20, | |
0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x7d,0x0a,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x31,0x36,0x33,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d, | |
0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d, | |
0x2e,0x77,0x3b,0x0a,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78, | |
0x5f,0x31,0x36,0x33,0x29,0x20,0x3d,0x3d,0x20,0x30,0x69,0x29,0x29,0x20,0x7b,0x0a, | |
0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x37,0x31,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x33,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20, | |
0x78,0x5f,0x31,0x37,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20, | |
0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x37,0x31,0x2e,0x78,0x2c,0x20,0x78, | |
0x5f,0x31,0x37,0x31,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x37,0x31,0x2e,0x7a,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x37,0x35,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x34,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x31,0x37,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20, | |
0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x37,0x35,0x2e,0x78,0x2c, | |
0x20,0x78,0x5f,0x31,0x37,0x35,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x37,0x35,0x2e, | |
0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x37, | |
0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x35,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x38,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x33, | |
0x66,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x37,0x39,0x2e, | |
0x78,0x2c,0x20,0x78,0x5f,0x31,0x37,0x39,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x37, | |
0x39,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x31,0x39,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x66,0x70, | |
0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x39, | |
0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x28,0x6d,0x61,0x74, | |
0x33,0x78,0x33,0x66,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x37,0x32, | |
0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x37,0x32,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31, | |
0x37,0x32,0x2e,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31, | |
0x37,0x36,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x37,0x36,0x2e,0x79,0x2c,0x20,0x78, | |
0x5f,0x31,0x37,0x36,0x2e,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78, | |
0x5f,0x31,0x38,0x30,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x38,0x30,0x2e,0x79,0x2c, | |
0x20,0x78,0x5f,0x31,0x38,0x30,0x2e,0x7a,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63, | |
0x33,0x66,0x28,0x78,0x5f,0x31,0x39,0x34,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x39, | |
0x34,0x2e,0x79,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x70,0x74,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78,0x5f, | |
0x31,0x39,0x38,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x39,0x38,0x2e,0x79,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x30,0x33,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x70,0x74,0x5f,0x31,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x78,0x5f,0x32, | |
0x30,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x30, | |
0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x66,0x28, | |
0x78,0x5f,0x32,0x30,0x36,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x30,0x36,0x2e,0x79, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x31,0x31, | |
0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75, | |
0x6d,0x6d,0x79,0x5b,0x39,0x69,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70, | |
0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x78,0x5f,0x32,0x31,0x31,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x31,0x32,0x20,0x3a,0x20, | |
0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x64,0x72,0x6f,0x75,0x6e,0x64,0x72,0x65,0x63, | |
0x74,0x5f,0x76,0x66,0x32,0x5f,0x76,0x66,0x32,0x5f,0x66,0x31,0x5f,0x28,0x26,0x28, | |
0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61, | |
0x6d,0x5f,0x32,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x29, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x31,0x34, | |
0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75, | |
0x6d,0x6d,0x79,0x5b,0x39,0x69,0x5d,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x32,0x31,0x38,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d, | |
0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x69,0x5d,0x2e, | |
0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x64,0x5f,0x31,0x20,0x3d,0x20,0x63,0x6c,0x61, | |
0x6d,0x70,0x28,0x28,0x28,0x78,0x5f,0x32,0x31,0x32,0x20,0x2b,0x20,0x28,0x78,0x5f, | |
0x32,0x31,0x34,0x20,0x2a,0x20,0x30,0x2e,0x35,0x66,0x29,0x29,0x20,0x2f,0x20,0x78, | |
0x5f,0x32,0x31,0x38,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30, | |
0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32, | |
0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x34, | |
0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x37, | |
0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32, | |
0x39,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x64,0x5f,0x31,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x78, | |
0x5f,0x32,0x32,0x35,0x2c,0x20,0x78,0x5f,0x32,0x32,0x38,0x2c,0x20,0x76,0x65,0x63, | |
0x34,0x66,0x28,0x78,0x5f,0x32,0x32,0x39,0x2c,0x20,0x78,0x5f,0x32,0x32,0x39,0x2c, | |
0x20,0x78,0x5f,0x32,0x32,0x39,0x2c,0x20,0x78,0x5f,0x32,0x32,0x39,0x29,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x33,0x32,0x20,0x3a, | |
0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x74,0x72,0x6f,0x6b,0x65,0x41,0x6c,0x70, | |
0x68,0x61,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x33, | |
0x33,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x63,0x69,0x73,0x73,0x6f, | |
0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x33,0x35, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x28,0x78, | |
0x5f,0x32,0x33,0x35,0x20,0x2a,0x20,0x28,0x78,0x5f,0x32,0x33,0x32,0x20,0x2a,0x20, | |
0x78,0x5f,0x32,0x33,0x33,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x32,0x33,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75, | |
0x6c,0x74,0x20,0x3d,0x20,0x78,0x5f,0x32,0x33,0x38,0x3b,0x0a,0x20,0x20,0x7d,0x20, | |
0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x61,0x72,0x20,0x78, | |
0x5f,0x33,0x32,0x36,0x20,0x3a,0x20,0x62,0x6f,0x6f,0x6c,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x76,0x61,0x72,0x20,0x78,0x5f,0x33,0x32,0x37,0x20,0x3a,0x20,0x62,0x6f,0x6f, | |
0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x34,0x31, | |
0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75, | |
0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x69,0x66,0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x32,0x34,0x31,0x29,0x20, | |
0x3d,0x3d,0x20,0x31,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x34,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x34, | |
0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x33, | |
0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x32,0x34,0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x65, | |
0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x34,0x38,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32, | |
0x34,0x38,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x34,0x38,0x2e,0x7a,0x29,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x35,0x31,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64, | |
0x75,0x6d,0x6d,0x79,0x5b,0x34,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x35,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33, | |
0x66,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x35,0x31,0x2e, | |
0x78,0x2c,0x20,0x78,0x5f,0x32,0x35,0x31,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x35, | |
0x31,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20, | |
0x78,0x5f,0x32,0x35,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20, | |
0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x35,0x69,0x5d,0x3b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x35,0x35,0x20, | |
0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28, | |
0x78,0x5f,0x32,0x35,0x34,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x35,0x34,0x2e,0x79, | |
0x2c,0x20,0x78,0x5f,0x32,0x35,0x34,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x36,0x39,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x32,0x66,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x37,0x33,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x33,0x66,0x20,0x3d,0x20,0x28,0x6d,0x61,0x74,0x33,0x78,0x33,0x66,0x28,0x76, | |
0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x34,0x39,0x2e,0x78,0x2c,0x20,0x78,0x5f, | |
0x32,0x34,0x39,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x34,0x39,0x2e,0x7a,0x29,0x2c, | |
0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x35,0x32,0x2e,0x78,0x2c,0x20, | |
0x78,0x5f,0x32,0x35,0x32,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x35,0x32,0x2e,0x7a, | |
0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x35,0x35,0x2e,0x78, | |
0x2c,0x20,0x78,0x5f,0x32,0x35,0x35,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x35,0x35, | |
0x2e,0x7a,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32, | |
0x36,0x39,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x36,0x39,0x2e,0x79,0x2c,0x20,0x31, | |
0x2e,0x30,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x32,0x37,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d, | |
0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x39,0x69,0x5d,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x70,0x74,0x5f,0x32,0x20,0x3d,0x20,0x28,0x76, | |
0x65,0x63,0x32,0x66,0x28,0x78,0x5f,0x32,0x37,0x33,0x2e,0x78,0x2c,0x20,0x78,0x5f, | |
0x32,0x37,0x33,0x2e,0x79,0x29,0x20,0x2f,0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x78, | |
0x5f,0x32,0x37,0x36,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x37,0x36,0x2e,0x79,0x29, | |
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32, | |
0x39,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x70,0x74,0x5f, | |
0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32, | |
0x39,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78, | |
0x74,0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x74,0x65,0x78,0x2c,0x20, | |
0x73,0x6d,0x70,0x2c,0x20,0x78,0x5f,0x32,0x39,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x78,0x5f,0x32, | |
0x39,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, | |
0x32,0x39,0x33,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39, | |
0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x7a,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f, | |
0x32,0x39,0x33,0x29,0x20,0x3d,0x3d,0x20,0x31,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x39,0x38, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x5f,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20, | |
0x78,0x5f,0x33,0x30,0x31,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x30,0x32,0x20,0x3a,0x20,0x76,0x65,0x63, | |
0x33,0x66,0x20,0x3d,0x20,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x39, | |
0x38,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x39,0x38,0x2e,0x79,0x2c,0x20,0x78,0x5f, | |
0x32,0x39,0x38,0x2e,0x7a,0x29,0x20,0x2a,0x20,0x78,0x5f,0x33,0x30,0x31,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33, | |
0x30,0x34,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x5f,0x31,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f, | |
0x33,0x30,0x32,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33,0x30,0x32,0x2e,0x79,0x2c,0x20, | |
0x78,0x5f,0x33,0x30,0x32,0x2e,0x7a,0x2c,0x20,0x78,0x5f,0x33,0x30,0x34,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x33,0x31,0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d, | |
0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d, | |
0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x69, | |
0x33,0x32,0x28,0x78,0x5f,0x33,0x31,0x30,0x29,0x20,0x3d,0x3d,0x20,0x32,0x69,0x29, | |
0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20, | |
0x78,0x5f,0x33,0x31,0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66, | |
0x28,0x78,0x5f,0x33,0x31,0x36,0x2c,0x20,0x78,0x5f,0x33,0x31,0x36,0x2c,0x20,0x78, | |
0x5f,0x33,0x31,0x36,0x2c,0x20,0x78,0x5f,0x33,0x31,0x36,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20, | |
0x78,0x5f,0x33,0x31,0x39,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f, | |
0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x7a,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x32,0x31, | |
0x20,0x3a,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x3d,0x20,0x28,0x69,0x33,0x32,0x28,0x78, | |
0x5f,0x33,0x31,0x39,0x29,0x20,0x3d,0x3d,0x20,0x33,0x69,0x29,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x78,0x5f,0x33,0x32,0x37,0x20,0x3d,0x20,0x78,0x5f,0x33,0x32, | |
0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x78,0x5f,0x33, | |
0x32,0x31,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65, | |
0x74,0x20,0x78,0x5f,0x33,0x32,0x35,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20, | |
0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x78,0x5f,0x33,0x32,0x36,0x20,0x3d,0x20,0x28,0x78,0x5f,0x33,0x32, | |
0x35,0x20,0x3d,0x3d,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x78,0x5f,0x33,0x32,0x37,0x20,0x3d,0x20,0x78,0x5f,0x33,0x32, | |
0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x69,0x66,0x20,0x28,0x78,0x5f,0x33,0x32,0x37,0x29,0x20,0x7b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74, | |
0x20,0x78,0x5f,0x33,0x33,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d, | |
0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x36,0x69,0x5d,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x33,0x33, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x5f,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f, | |
0x31,0x20,0x3d,0x20,0x28,0x78,0x5f,0x33,0x33,0x33,0x20,0x2a,0x20,0x78,0x5f,0x33, | |
0x33,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, | |
0x5f,0x33,0x33,0x35,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x74,0x72, | |
0x6f,0x6b,0x65,0x41,0x6c,0x70,0x68,0x61,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x33,0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20, | |
0x3d,0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x33,0x38,0x20,0x3a,0x20,0x76,0x65,0x63, | |
0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x3b,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3d,0x20,0x28,0x78, | |
0x5f,0x33,0x33,0x38,0x20,0x2a,0x20,0x28,0x78,0x5f,0x33,0x33,0x35,0x20,0x2a,0x20, | |
0x78,0x5f,0x33,0x33,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x33,0x34,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66, | |
0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x78,0x5f,0x33,0x34,0x30, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x20,0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x34,0x33,0x20,0x3a, | |
0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d, | |
0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x69,0x66,0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x33,0x34,0x33,0x29,0x20, | |
0x3d,0x3d,0x20,0x32,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66, | |
0x28,0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30, | |
0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x7d,0x20,0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x35,0x31,0x20,0x3a,0x20,0x66,0x33,0x32, | |
0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31,0x30, | |
0x69,0x5d,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, | |
0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x33,0x35,0x31,0x29,0x20,0x3d,0x3d, | |
0x20,0x33,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x36,0x30,0x20,0x3a,0x20,0x76,0x65, | |
0x63,0x32,0x66,0x20,0x3d,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33, | |
0x36,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78, | |
0x74,0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x74,0x65,0x78,0x2c,0x20, | |
0x73,0x6d,0x70,0x2c,0x20,0x78,0x5f,0x33,0x36,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x32,0x20,0x3d, | |
0x20,0x78,0x5f,0x33,0x36,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x36,0x33,0x20,0x3a,0x20,0x66,0x33, | |
0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d,0x6d,0x79,0x5b,0x31, | |
0x30,0x69,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x69,0x66,0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78,0x5f,0x33,0x36,0x33,0x29, | |
0x20,0x3d,0x3d,0x20,0x31,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x36,0x38, | |
0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72, | |
0x5f,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x37,0x31,0x20,0x3a,0x20,0x66,0x33,0x32,0x20, | |
0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x32,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33, | |
0x37,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x28,0x76,0x65, | |
0x63,0x33,0x66,0x28,0x78,0x5f,0x33,0x36,0x38,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33, | |
0x36,0x38,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x33,0x36,0x38,0x2e,0x7a,0x29,0x20,0x2a, | |
0x20,0x78,0x5f,0x33,0x37,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x37,0x34,0x20,0x3a, | |
0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x32,0x2e,0x77, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x32,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f, | |
0x33,0x37,0x32,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33,0x37,0x32,0x2e,0x79,0x2c,0x20, | |
0x78,0x5f,0x33,0x37,0x32,0x2e,0x7a,0x2c,0x20,0x78,0x5f,0x33,0x37,0x34,0x29,0x3b, | |
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x38,0x30, | |
0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75, | |
0x6d,0x6d,0x79,0x5b,0x31,0x30,0x69,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x69,0x33,0x32,0x28,0x78, | |
0x5f,0x33,0x38,0x30,0x29,0x20,0x3d,0x3d,0x20,0x32,0x69,0x29,0x29,0x20,0x7b,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20, | |
0x78,0x5f,0x33,0x38,0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x63,0x6f, | |
0x6c,0x6f,0x72,0x5f,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x32,0x20,0x3d,0x20,0x76, | |
0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x33,0x38,0x36,0x2c,0x20,0x78,0x5f,0x33,0x38, | |
0x36,0x2c,0x20,0x78,0x5f,0x33,0x38,0x36,0x2c,0x20,0x78,0x5f,0x33,0x38,0x36,0x29, | |
0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x38, | |
0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, | |
0x72,0x5f,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, | |
0x65,0x74,0x20,0x78,0x5f,0x33,0x38,0x39,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d, | |
0x20,0x73,0x63,0x69,0x73,0x73,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x39,0x32,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x35,0x39,0x2e,0x64,0x75,0x6d, | |
0x6d,0x79,0x5b,0x36,0x69,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, | |
0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x28,0x28,0x78,0x5f,0x33, | |
0x38,0x38,0x20,0x2a,0x20,0x78,0x5f,0x33,0x38,0x39,0x29,0x20,0x2a,0x20,0x78,0x5f, | |
0x33,0x39,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, | |
0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, | |
0x7d,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x39,0x36,0x20,0x3a,0x20, | |
0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a, | |
0x20,0x20,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x78,0x5f,0x33, | |
0x39,0x36,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a, | |
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74, | |
0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30, | |
0x29,0x0a,0x20,0x20,0x6f,0x75,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a, | |
0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61,0x67, | |
0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f, | |
0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72, | |
0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c, | |
0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x66,0x70, | |
0x6f,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66, | |
0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a, | |
0x20,0x20,0x66,0x74,0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x66,0x74,0x63,0x6f, | |
0x6f,0x72,0x64,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x66,0x70,0x6f, | |
0x73,0x20,0x3d,0x20,0x66,0x70,0x6f,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a, | |
0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65, | |
0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x6f,0x75, | |
0x74,0x43,0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, | |
}; | |
#endif | |
static inline const sg_shader_desc* nanovg_aa_sg_shader_desc(sg_backend backend) { | |
#if defined(SOKOL_GLCORE) | |
if (backend == SG_BACKEND_GLCORE) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.attrs[0].name = "vertex"; | |
desc.attrs[1].name = "tcoord"; | |
desc.vs.source = (const char*)nanovg_aa_vs_aa_source_glsl410; | |
desc.vs.entry = "main"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.vs.uniform_blocks[0].uniforms[0].name = "viewSize"; | |
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; | |
desc.vs.uniform_blocks[0].uniforms[0].array_count = 1; | |
desc.fs.source = (const char*)nanovg_aa_fs_aa_source_glsl410; | |
desc.fs.entry = "main"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.uniform_blocks[0].uniforms[0].name = "frag"; | |
desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; | |
desc.fs.uniform_blocks[0].uniforms[0].array_count = 11; | |
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 = "nanovg_aa_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_GLCORE */ | |
#if defined(SOKOL_GLES3) | |
if (backend == SG_BACKEND_GLES3) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.attrs[0].name = "vertex"; | |
desc.attrs[1].name = "tcoord"; | |
desc.vs.source = (const char*)nanovg_aa_vs_aa_source_glsl300es; | |
desc.vs.entry = "main"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.vs.uniform_blocks[0].uniforms[0].name = "viewSize"; | |
desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; | |
desc.vs.uniform_blocks[0].uniforms[0].array_count = 1; | |
desc.fs.source = (const char*)nanovg_aa_fs_aa_source_glsl300es; | |
desc.fs.entry = "main"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.uniform_blocks[0].uniforms[0].name = "frag"; | |
desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; | |
desc.fs.uniform_blocks[0].uniforms[0].array_count = 11; | |
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 = "nanovg_aa_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_GLES3 */ | |
#if defined(SOKOL_D3D11) | |
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.vs.source = (const char*)nanovg_aa_vs_aa_source_hlsl4; | |
desc.vs.d3d11_target = "vs_4_0"; | |
desc.vs.entry = "main"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.source = (const char*)nanovg_aa_fs_aa_source_hlsl4; | |
desc.fs.d3d11_target = "ps_4_0"; | |
desc.fs.entry = "main"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
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 = "nanovg_aa_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_D3D11 */ | |
#if defined(SOKOL_METAL) | |
if (backend == SG_BACKEND_METAL_MACOS) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.vs.source = (const char*)nanovg_aa_vs_aa_source_metal_macos; | |
desc.vs.entry = "main0"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.source = (const char*)nanovg_aa_fs_aa_source_metal_macos; | |
desc.fs.entry = "main0"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
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 = "nanovg_aa_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_METAL */ | |
#if defined(SOKOL_METAL) | |
if (backend == SG_BACKEND_METAL_IOS) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.vs.source = (const char*)nanovg_aa_vs_aa_source_metal_ios; | |
desc.vs.entry = "main0"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.source = (const char*)nanovg_aa_fs_aa_source_metal_ios; | |
desc.fs.entry = "main0"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
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 = "nanovg_aa_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_METAL */ | |
#if defined(SOKOL_METAL) | |
if (backend == SG_BACKEND_METAL_SIMULATOR) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.vs.source = (const char*)nanovg_aa_vs_aa_source_metal_sim; | |
desc.vs.entry = "main0"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.source = (const char*)nanovg_aa_fs_aa_source_metal_sim; | |
desc.fs.entry = "main0"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
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 = "nanovg_aa_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_METAL */ | |
#if defined(SOKOL_WGPU) | |
if (backend == SG_BACKEND_WGPU) { | |
static sg_shader_desc desc; | |
static bool valid; | |
if (!valid) { | |
valid = true; | |
desc.vs.source = (const char*)nanovg_aa_vs_aa_source_wgsl; | |
desc.vs.entry = "main"; | |
desc.vs.uniform_blocks[0].size = 16; | |
desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
desc.fs.source = (const char*)nanovg_aa_fs_aa_source_wgsl; | |
desc.fs.entry = "main"; | |
desc.fs.uniform_blocks[0].size = 176; | |
desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; | |
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 = "nanovg_aa_sg_shader"; | |
} | |
return &desc; | |
} | |
#endif /* SOKOL_WGPU */ | |
return 0; | |
} | |
//////////////////////////////////////////////////////////////////////////////// | |
enum SGNVGshaderType { | |
NSVG_SHADER_FILLGRAD, | |
NSVG_SHADER_FILLIMG, | |
NSVG_SHADER_SIMPLE, | |
NSVG_SHADER_IMG | |
}; | |
struct SGNVGtexture { | |
int id; | |
sg_image img; | |
sg_sampler smp; | |
int width, height; | |
int type; | |
int flags; | |
uint8_t* imgData; | |
}; | |
typedef struct SGNVGtexture SGNVGtexture; | |
struct SGNVGblend | |
{ | |
sg_blend_factor srcRGB; | |
sg_blend_factor dstRGB; | |
sg_blend_factor srcAlpha; | |
sg_blend_factor dstAlpha; | |
}; | |
typedef struct SGNVGblend SGNVGblend; | |
enum SGNVGcallType { | |
SGNVG_NONE = 0, | |
SGNVG_FILL, | |
SGNVG_CONVEXFILL, | |
SGNVG_STROKE, | |
SGNVG_TRIANGLES, | |
}; | |
struct SGNVGcall { | |
int type; | |
int image; | |
int pathOffset; | |
int pathCount; | |
int triangleOffset; | |
int triangleCount; | |
int uniformOffset; | |
SGNVGblend blendFunc; | |
}; | |
typedef struct SGNVGcall SGNVGcall; | |
struct SGNVGpath { | |
int fillOffset; | |
int fillCount; | |
int strokeOffset; | |
int strokeCount; | |
}; | |
typedef struct SGNVGpath SGNVGpath; | |
struct SGNVGattribute { | |
float vertex[2]; | |
float tcoord[2]; | |
}; | |
typedef struct SGNVGattribute SGNVGattribute; | |
struct SGNVGvertUniforms { | |
float viewSize[4]; | |
}; | |
typedef struct SGNVGvertUniforms SGNVGvertUniforms; | |
struct SGNVGfragUniforms { | |
#define NANOVG_SG_UNIFORMARRAY_SIZE 11 | |
union { | |
struct { | |
float scissorMat[12]; // matrices are actually 3 vec4s | |
float paintMat[12]; | |
struct NVGcolor innerCol; | |
struct NVGcolor outerCol; | |
float scissorExt[2]; | |
float scissorScale[2]; | |
float extent[2]; | |
float radius; | |
float feather; | |
float strokeMult; | |
float strokeThr; | |
float texType; | |
float type; | |
}; | |
float uniformArray[NANOVG_SG_UNIFORMARRAY_SIZE][4]; | |
}; | |
}; | |
typedef struct SGNVGfragUniforms SGNVGfragUniforms; | |
// LRU cache; keep its size relatively small, as items are accessed via a linear search | |
#define NANOVG_SG_PIPELINE_CACHE_SIZE 32 | |
struct SGNVGpipelineCacheKey { | |
uint16_t blend; // cached as `src_factor_rgb | (dst_factor_rgb << 4) | (src_factor_alpha << 8) | (dst_factor_alpha << 12)` | |
uint16_t lastUse; // updated on each read | |
}; | |
typedef struct SGNVGpipelineCacheKey SGNVGpipelineCacheKey; | |
enum SGNVGpipelineType | |
{ | |
// used by sgnvg__convexFill, sgnvg__stroke, sgnvg__triangles | |
SGNVG_PIP_BASE = 0, | |
// used by sgnvg__fill | |
SGNVG_PIP_FILL_STENCIL, | |
SGNVG_PIP_FILL_ANTIALIAS, // only used if sg->flags & NVG_ANTIALIAS | |
SGNVG_PIP_FILL_DRAW, | |
// used by sgnvg__stroke | |
SGNVG_PIP_STROKE_STENCIL_DRAW, // only used if sg->flags & NVG_STENCIL_STROKES | |
SGNVG_PIP_STROKE_STENCIL_ANTIALIAS, // only used if sg->flags & NVG_STENCIL_STROKES | |
SGNVG_PIP_STROKE_STENCIL_CLEAR, // only used if sg->flags & NVG_STENCIL_STROKES | |
SGNVG_PIP_NUM_ | |
}; | |
typedef enum SGNVGpipelineType SGNVGpipelineType; | |
struct SGNVGpipelineCache { | |
// keys are stored as a separate array for search performance | |
SGNVGpipelineCacheKey keys[NANOVG_SG_PIPELINE_CACHE_SIZE]; | |
sg_pipeline pipelines[NANOVG_SG_PIPELINE_CACHE_SIZE][SGNVG_PIP_NUM_]; | |
uint8_t pipelinesActive[NANOVG_SG_PIPELINE_CACHE_SIZE]; | |
uint16_t currentUse; // incremented on each overwrite | |
}; | |
typedef struct SGNVGpipelineCache SGNVGpipelineCache; | |
struct SGNVGcontext { | |
sg_shader shader; | |
SGNVGtexture* textures; | |
SGNVGvertUniforms view; | |
int ntextures; | |
int ctextures; | |
int textureId; | |
sg_buffer vertBuf; | |
sg_buffer indexBuf; | |
SGNVGpipelineCache pipelineCache; | |
int fragSize; | |
int flags; | |
// Per frame buffers | |
SGNVGcall* calls; | |
int ccalls; | |
int ncalls; | |
SGNVGpath* paths; | |
int cpaths; | |
int npaths; | |
SGNVGattribute* verts; | |
int cverts; | |
int nverts; | |
int cverts_gpu; | |
uint32_t* indexes; | |
int cindexes; | |
int nindexes; | |
int cindexes_gpu; | |
unsigned char* uniforms; | |
int cuniforms; | |
int nuniforms; | |
// state | |
int pipelineCacheIndex; | |
sg_blend_state blend; | |
int dummyTex; | |
}; | |
typedef struct SGNVGcontext SGNVGcontext; | |
static int sgnvg__maxi(int a, int b) { return a > b ? a : b; } | |
#ifdef SOKOL_GLES2 | |
static unsigned int sgnvg__nearestPow2(unsigned int num) | |
{ | |
unsigned n = num > 0 ? num - 1 : 0; | |
n |= n >> 1; | |
n |= n >> 2; | |
n |= n >> 4; | |
n |= n >> 8; | |
n |= n >> 16; | |
n++; | |
return n; | |
} | |
#endif | |
// you probably always want to have that one disabled for performance | |
// unless you want to trace all functions in here which is very verbose | |
//#define SGNVG_DEBUG_LOG | |
#ifdef SGNVG_DEBUG_LOG | |
#define SGNVG_EXTLOG(...) printf("- " __VA_ARGS__); | |
#define SGNVG_INTLOG(...) printf(" - " __VA_ARGS__); | |
#define SG_DRAW(b, n, i) printf(" -> sg_draw(base_element: %d, num_elements: %d, num_instances: %d)\n", b, n, i); sg_draw(b, n, i); | |
#else | |
#define SGNVG_EXTLOG(...) | |
#define SGNVG_INTLOG(...) | |
#define SG_DRAW(b, n, i) sg_draw(b, n, i); | |
#endif | |
static void sgnvg__flushTexture(SGNVGtexture* tex) { | |
SGNVG_INTLOG("sgnvg__flushTexture(%p -> tex->id: %d, tex->img: 0x%0X)\n", tex, tex->id, tex->img.id); | |
sg_update_image(tex->img, &(sg_image_data){ | |
.subimage[0][0] = {tex->imgData, tex->width * tex->height * (tex->type == NVG_TEXTURE_RGBA ? 4 : 1)}, | |
}); | |
} | |
static SGNVGtexture* sgnvg__allocTexture(SGNVGcontext* sg) | |
{ | |
SGNVG_INTLOG("sgnvg__allocTexture(%p)\n", sg); | |
SGNVGtexture* tex = NULL; | |
int i; | |
for (i = 0; i < sg->ntextures; i++) { | |
if (sg->textures[i].id == 0) { | |
tex = &sg->textures[i]; | |
break; | |
} | |
} | |
if (tex == NULL) { | |
if (sg->ntextures+1 > sg->ctextures) { | |
SGNVGtexture* textures; | |
int ctextures = sgnvg__maxi(sg->ntextures+1, 4) + sg->ctextures/2; // 1.5x Overallocate | |
textures = (SGNVGtexture*)realloc(sg->textures, sizeof(SGNVGtexture)*ctextures); | |
if (textures == NULL) return NULL; | |
sg->textures = textures; | |
sg->ctextures = ctextures; | |
} | |
tex = &sg->textures[sg->ntextures++]; | |
} | |
memset(tex, 0, sizeof(*tex)); | |
tex->id = ++sg->textureId; | |
SGNVG_INTLOG("sgnvg__allocTexture(%p) -> %d\n", sg, tex->id); | |
return tex; | |
} | |
static SGNVGtexture* sgnvg__findTexture(SGNVGcontext* sg, int id) | |
{ | |
SGNVG_INTLOG("sgnvg__findTexture(sg: %p, id: %d)\n", sg, id); | |
int i; | |
for (i = 0; i < sg->ntextures; i++) | |
if (sg->textures[i].id == id) | |
return &sg->textures[i]; | |
return NULL; | |
} | |
static int sgnvg__deleteTexture(SGNVGcontext* sg, int id) | |
{ | |
SGNVG_INTLOG("sgnvg__deleteTexture(sg: %p, id: %d)\n", sg, id); | |
int i; | |
for (i = 0; i < sg->ntextures; i++) { | |
if (sg->textures[i].id == id) { | |
if (sg->textures[i].img.id != 0 && (sg->textures[i].flags & NVG_IMAGE_NODELETE) == 0) | |
sg_destroy_image(sg->textures[i].img); | |
free(sg->textures[i].imgData); | |
memset(&sg->textures[i], 0, sizeof(sg->textures[i])); | |
return 1; | |
} | |
} | |
return 0; | |
} | |
static uint16_t sgnvg__getCombinedBlendNumber(sg_blend_state blend) | |
{ | |
SGNVG_INTLOG("sgnvg__getCombinedBlendNumber(%d, %d, %d, %d)\n", blend.src_factor_rgb, blend.dst_factor_rgb, blend.src_factor_alpha, blend.dst_factor_alpha); | |
#if __STDC_VERSION__ >= 201112L | |
_Static_assert(_SG_BLENDFACTOR_NUM <= 17, "too many blend factors for 16-bit blend number"); | |
#else | |
assert(_SG_BLENDFACTOR_NUM <= 17); // can be a _Static_assert | |
#endif | |
return blend.src_factor_rgb | (blend.dst_factor_rgb << 4) | (blend.src_factor_alpha << 8) | (blend.dst_factor_alpha << 12); | |
} | |
static void sgnvg__initPipeline(SGNVGcontext* sg, sg_pipeline pip, const sg_stencil_state* stencil, sg_color_mask write_mask, sg_cull_mode cull_mode) | |
{ | |
SGNVG_INTLOG("sgnvg__initPipeline(sg: %p, pip: %d, stencil: %p, write_mask: %d, cull_mode: %d)\n", sg, pip.id, stencil, write_mask, cull_mode); | |
sg_init_pipeline(pip, &(sg_pipeline_desc){ | |
.shader = sg->shader, | |
.layout = { | |
// .buffers[0] = {.stride = sizeof(SGNVGattribute)}, | |
.attrs = { | |
[ATTR_nanovg_vs_vertex].format = SG_VERTEXFORMAT_FLOAT2, | |
[ATTR_nanovg_vs_tcoord].format = SG_VERTEXFORMAT_FLOAT2, | |
}, | |
}, | |
.stencil = *stencil, | |
.colors[0] = { | |
.write_mask = write_mask, | |
.blend = sg->blend, | |
}, | |
.primitive_type = SG_PRIMITIVETYPE_TRIANGLES, | |
.index_type = SG_INDEXTYPE_UINT32, | |
.cull_mode = cull_mode, | |
.face_winding = SG_FACEWINDING_CCW, | |
.label = "nanovg.pipeline", | |
}); | |
} | |
static bool sgnvg__pipelineTypeIsInUse(SGNVGcontext* sg, SGNVGpipelineType type) | |
{ | |
SGNVG_INTLOG("sgnvg__pipelineTypeIsInUse(sg: %p, type: %d)\n", sg, type); | |
switch(type) | |
{ | |
case SGNVG_PIP_BASE: | |
case SGNVG_PIP_FILL_STENCIL: | |
case SGNVG_PIP_FILL_DRAW: | |
return true; | |
case SGNVG_PIP_FILL_ANTIALIAS: | |
return !!(sg->flags & NVG_ANTIALIAS); | |
case SGNVG_PIP_STROKE_STENCIL_DRAW: | |
case SGNVG_PIP_STROKE_STENCIL_ANTIALIAS: | |
case SGNVG_PIP_STROKE_STENCIL_CLEAR: | |
return !!(sg->flags & NVG_STENCIL_STROKES); | |
case SGNVG_PIP_NUM_: // to avoid warnings | |
break; /* fall through to assert */ | |
} | |
assert(0); | |
return false; | |
} | |
static int sgnvg__getIndexFromCache(SGNVGcontext* sg, uint16_t blendNumber) | |
{ | |
SGNVG_INTLOG("sgnvg__getIndexFromCache(sg: %p, blendNumber: %d)\n", sg, blendNumber); | |
uint16_t currentUse = sg->pipelineCache.currentUse; | |
int maxAge = 0; | |
int maxAgeIndex = 0; | |
// find the correct cache entry for `blend_number` | |
for(unsigned int i = 0; i < NANOVG_SG_PIPELINE_CACHE_SIZE; i++) | |
{ | |
if(sg->pipelineCache.keys[i].blend == blendNumber) | |
{ | |
sg->pipelineCache.keys[i].lastUse = sg->pipelineCache.currentUse; | |
return i; | |
} | |
int age = (uint16_t)(currentUse - sg->pipelineCache.keys[i].lastUse); | |
if(age > maxAge) | |
{ | |
maxAge = age; | |
maxAgeIndex = i; | |
} | |
} | |
// not found; reuse an old one | |
sg->pipelineCache.currentUse = ++currentUse; | |
sg->pipelineCache.keys[maxAgeIndex].blend = blendNumber; | |
sg->pipelineCache.keys[maxAgeIndex].lastUse = currentUse; | |
sg_pipeline* pipelines = sg->pipelineCache.pipelines[maxAgeIndex]; | |
uint8_t pipelinesActive = sg->pipelineCache.pipelinesActive[maxAgeIndex]; | |
// we may have had data already initialized; deinit those | |
for(uint32_t type = SGNVG_PIP_BASE; type < SGNVG_PIP_NUM_; type++) | |
if(pipelinesActive & (1 << type)) | |
sg_uninit_pipeline(pipelines[type]); | |
// mark all as inactive | |
sg->pipelineCache.pipelinesActive[maxAgeIndex] = 0; | |
return maxAgeIndex; | |
} | |
static sg_pipeline sgnvg__getPipelineFromCache(SGNVGcontext* sg, SGNVGpipelineType type) | |
{ | |
SGNVG_INTLOG("sgnvg__getPipelineFromCache(sg: %p, type: %d)\n", sg, type); | |
assert(sgnvg__pipelineTypeIsInUse(sg, type)); | |
int pipelineCacheIndex = sg->pipelineCacheIndex; | |
sg_pipeline pipeline = sg->pipelineCache.pipelines[pipelineCacheIndex][type]; | |
uint8_t typeMask = 1 << type; | |
if(!(sg->pipelineCache.pipelinesActive[pipelineCacheIndex] & typeMask)) | |
{ | |
sg->pipelineCache.pipelinesActive[pipelineCacheIndex] |= typeMask; | |
switch(type) | |
{ | |
case SGNVG_PIP_BASE: | |
sgnvg__initPipeline(sg, pipeline, &(sg_stencil_state){ | |
.enabled = false, | |
}, SG_COLORMASK_RGBA, SG_CULLMODE_BACK); | |
break; | |
case SGNVG_PIP_FILL_STENCIL: | |
sgnvg__initPipeline(sg, pipeline, &(sg_stencil_state){ | |
.enabled = true, | |
.front = {.compare = SG_COMPAREFUNC_ALWAYS, .fail_op = SG_STENCILOP_KEEP, .depth_fail_op = SG_STENCILOP_KEEP, .pass_op = SG_STENCILOP_INCR_WRAP}, | |
.back = {.compare = SG_COMPAREFUNC_ALWAYS, .fail_op = SG_STENCILOP_KEEP, .depth_fail_op = SG_STENCILOP_KEEP, .pass_op = SG_STENCILOP_DECR_WRAP}, | |
.read_mask = 0xFF, | |
.write_mask = 0xFF, | |
.ref = 0, | |
}, SG_COLORMASK_NONE, SG_CULLMODE_NONE); | |
break; | |
case SGNVG_PIP_FILL_ANTIALIAS: | |
sgnvg__initPipeline(sg, pipeline, &(sg_stencil_state){ | |
.enabled = true, | |
.front = {.compare = SG_COMPAREFUNC_EQUAL, .fail_op = SG_STENCILOP_KEEP, .depth_fail_op = SG_STENCILOP_KEEP, .pass_op = SG_STENCILOP_KEEP}, | |
.back = {.compare = SG_COMPAREFUNC_EQUAL, .fail_op = SG_STENCILOP_KEEP, .depth_fail_op = SG_STENCILOP_KEEP, .pass_op = SG_STENCILOP_KEEP}, | |
.read_mask = 0xFF, | |
.write_mask = 0xFF, | |
.ref = 0, | |
}, SG_COLORMASK_RGBA, SG_CULLMODE_BACK); | |
break; | |
case SGNVG_PIP_FILL_DRAW: | |
sgnvg__initPipeline(sg, pipeline, &(sg_stencil_state){ | |
.enabled = true, | |
.front = {.compare = SG_COMPAREFUNC_NOT_EQUAL, .fail_op = SG_STENCILOP_ZERO, .depth_fail_op = SG_STENCILOP_ZERO, .pass_op = SG_STENCILOP_ZERO}, | |
.back = {.compare = SG_COMPAREFUNC_NOT_EQUAL, .fail_op = SG_STENCILOP_ZERO, .depth_fail_op = SG_STENCILOP_ZERO, .pass_op = SG_STENCILOP_ZERO}, | |
.read_mask = 0xFF, | |
.write_mask = 0xFF, | |
.ref = 0, | |
}, SG_COLORMASK_RGBA, SG_CULLMODE_BACK); | |
break; | |
case SGNVG_PIP_STROKE_STENCIL_DRAW: | |
sgnvg__initPipeline(sg, pipeline, &(sg_stencil_state){ | |
.enabled = true, | |
.front = {.compare = SG_COMPAREFUNC_EQUAL, .fail_op = SG_STENCILOP_KEEP, .depth_fail_op = SG_STENCILOP_KEEP, .pass_op = SG_STENCILOP_INCR_CLAMP}, | |
.back = {.compare = SG_COMPAREFUNC_EQUAL, .fail_op = SG_STENCILOP_KEEP, .depth_fail_op = SG_STENCILOP_KEEP, .pass_op = SG_STENCILOP_INCR_CLAMP}, | |
.read_mask = 0xFF, | |
.write_mask = 0xFF, | |
.ref = 0, | |
}, SG_COLORMASK_RGBA, SG_CULLMODE_BACK); | |
break; | |
case SGNVG_PIP_STROKE_STENCIL_ANTIALIAS: | |
sgnvg__initPipeline(sg, pipeline, &(sg_stencil_state){ | |
.enabled = true, | |
.front = {.compare = SG_COMPAREFUNC_EQUAL, .fail_op = SG_STENCILOP_KEEP, .depth_fail_op = SG_STENCILOP_KEEP, .pass_op = SG_STENCILOP_KEEP}, | |
.back = {.compare = SG_COMPAREFUNC_EQUAL, .fail_op = SG_STENCILOP_KEEP, .depth_fail_op = SG_STENCILOP_KEEP, .pass_op = SG_STENCILOP_KEEP}, | |
.read_mask = 0xFF, | |
.write_mask = 0xFF, | |
.ref = 0, | |
}, SG_COLORMASK_RGBA, SG_CULLMODE_BACK); | |
break; | |
case SGNVG_PIP_STROKE_STENCIL_CLEAR: | |
sgnvg__initPipeline(sg, pipeline, &(sg_stencil_state){ | |
.enabled = true, | |
.front = {.compare = SG_COMPAREFUNC_ALWAYS, .fail_op = SG_STENCILOP_ZERO, .depth_fail_op = SG_STENCILOP_ZERO, .pass_op = SG_STENCILOP_ZERO}, | |
.back = {.compare = SG_COMPAREFUNC_ALWAYS, .fail_op = SG_STENCILOP_ZERO, .depth_fail_op = SG_STENCILOP_ZERO, .pass_op = SG_STENCILOP_ZERO}, | |
.read_mask = 0xFF, | |
.write_mask = 0xFF, | |
.ref = 0, | |
}, SG_COLORMASK_NONE, SG_CULLMODE_BACK); | |
break; | |
default: | |
assert(0); | |
} | |
} | |
return pipeline; | |
} | |
static SGNVGfragUniforms* nvg__fragUniformPtr(SGNVGcontext* gl, int i); | |
static void sgnvg__setUniforms(SGNVGcontext* sg, int uniformOffset, int image) | |
{ | |
SGNVG_INTLOG("sgnvg__setUniforms(sg: %p, uniformOffset: %d, image: %d)\n", sg, uniformOffset, image); | |
SGNVGtexture* tex = NULL; | |
SGNVGfragUniforms* frag = nvg__fragUniformPtr(sg, uniformOffset); | |
sg_apply_uniforms(SG_SHADERSTAGE_VS, SLOT_nanovg_viewSize, &(sg_range){ &sg->view, sizeof(sg->view) }); | |
sg_apply_uniforms(SG_SHADERSTAGE_FS, SLOT_nanovg_frag, &(sg_range){ frag, sizeof(*frag) }); | |
if (image != 0) { | |
tex = sgnvg__findTexture(sg, image); | |
} | |
// If no image is set, use empty texture | |
if (tex == NULL) { | |
tex = sgnvg__findTexture(sg, sg->dummyTex); | |
} | |
sg_apply_bindings(&(sg_bindings){ | |
.vertex_buffers[0] = sg->vertBuf, | |
.index_buffer = sg->indexBuf, | |
.fs.images[SLOT_nanovg_tex] = tex ? tex->img : (sg_image){0}, | |
.fs.samplers[SLOT_nanovg_smp] = tex ? tex->smp : (sg_sampler){0}, | |
}); | |
} | |
static void sgnvg__preparePipelineUniforms(SGNVGcontext* sg, SGNVGpipelineType pipelineType, int uniformOffset, int image) | |
{ | |
SGNVG_INTLOG("sgnvg__preparePipelineUniforms(sg: %p, pipelineType: %d, uniformOffset: %d, image: %d)\n", sg, pipelineType, uniformOffset, image); | |
sg_pipeline pip = sgnvg__getPipelineFromCache(sg, pipelineType); | |
sg_apply_pipeline(pip); | |
sgnvg__setUniforms(sg, uniformOffset, image); | |
} | |
#define NANOVG_SG_TOSTRING_(X) #X | |
#define NANOVG_SG_TOSTRING(X) NANOVG_SG_TOSTRING_(X) | |
static int sgnvg__renderCreateTexture(void* uptr, int type, int w, int h, int imageFlags, const unsigned char* data); | |
static int sgnvg__renderCreate(void* uptr) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderCreate(uptr: %p)\n", uptr); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
int align = 4; | |
if(sg->flags & NVG_ANTIALIAS) | |
sg->shader = sg_make_shader(nanovg_aa_sg_shader_desc(sg_query_backend())); | |
else | |
sg->shader = sg_make_shader(nanovg_sg_shader_desc(sg_query_backend())); | |
for(int i = 0; i < NANOVG_SG_PIPELINE_CACHE_SIZE; i++) | |
{ | |
for(uint32_t t = 0; t < SGNVG_PIP_NUM_; t++) | |
{ | |
// only allocate pipelines if correct flags are set | |
if(!sgnvg__pipelineTypeIsInUse(sg, (SGNVGpipelineType)t)) | |
continue; | |
sg->pipelineCache.pipelines[i][t] = sg_alloc_pipeline(); | |
} | |
} | |
sg->blend = (sg_blend_state){ | |
.enabled = true, | |
.src_factor_rgb = SG_BLENDFACTOR_ZERO, | |
.dst_factor_rgb = SG_BLENDFACTOR_ZERO, | |
.op_rgb = SG_BLENDOP_ADD, | |
.src_factor_alpha = SG_BLENDFACTOR_ZERO, | |
.dst_factor_alpha = SG_BLENDFACTOR_ZERO, | |
.op_alpha = SG_BLENDOP_ADD, | |
}; | |
sg->vertBuf = sg_alloc_buffer(); | |
sg->indexBuf = sg_alloc_buffer(); | |
sg->fragSize = sizeof(SGNVGfragUniforms) + (align - sizeof(SGNVGfragUniforms) % align) % align; | |
// Some platforms does not allow to have samples to unset textures. | |
// Create empty one which is bound when there's no texture specified. | |
sg->dummyTex = sgnvg__renderCreateTexture(sg, NVG_TEXTURE_ALPHA, 1, 1, 0, NULL); | |
return 1; | |
} | |
static int sgnvg__renderCreateTexture(void* uptr, int type, int w, int h, int imageFlags, const unsigned char* data) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderCreateTexture(uptr: %p, type: %d, w: %d, h: %d, imageFlags: %d, data: %p)\n",uptr, type, w, h, imageFlags, data); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
SGNVGtexture* tex = sgnvg__allocTexture(sg); | |
if (tex == NULL) return 0; | |
#ifdef SOKOL_GLES2 | |
// Check for non-power of 2. | |
if (sgnvg__nearestPow2(w) != (unsigned int)w || sgnvg__nearestPow2(h) != (unsigned int)h) { | |
// No repeat | |
if ((imageFlags & NVG_IMAGE_REPEATX) != 0 || (imageFlags & NVG_IMAGE_REPEATY) != 0) { | |
printf("Repeat X/Y is not supported for non power-of-two textures (%d x %d)\n", w, h); | |
imageFlags &= ~(NVG_IMAGE_REPEATX | NVG_IMAGE_REPEATY); | |
} | |
// No mips. | |
if (imageFlags & NVG_IMAGE_GENERATE_MIPMAPS) { | |
printf("Mip-maps is not support for non power-of-two textures (%d x %d)\n", w, h); | |
imageFlags &= ~NVG_IMAGE_GENERATE_MIPMAPS; | |
} | |
} | |
#endif | |
assert(!(imageFlags & NVG_IMAGE_GENERATE_MIPMAPS) && "TODO mipmaps"); | |
// if we have mipmaps, we forbid updating | |
bool immutable = !!(imageFlags & NVG_IMAGE_GENERATE_MIPMAPS) && data; | |
tex->width = w; | |
tex->height = h; | |
tex->type = type; | |
tex->flags = imageFlags; | |
sg_image_data imageData = { | |
// TODO mipmaps | |
.subimage[0][0] = {data, w * h * (type == NVG_TEXTURE_RGBA ? 4 : 1)}, | |
}; | |
tex->img = sg_make_image(&(sg_image_desc){ | |
.type = SG_IMAGETYPE_2D, | |
//.render_target | |
.width = w, | |
.height = h, | |
.num_mipmaps = 1, // TODO mipmaps | |
.usage = immutable ? SG_USAGE_IMMUTABLE : SG_USAGE_DYNAMIC, | |
.pixel_format = type == NVG_TEXTURE_RGBA ? SG_PIXELFORMAT_RGBA8 : SG_PIXELFORMAT_R8, | |
.data = ((imageFlags & NVG_IMAGE_GENERATE_MIPMAPS) && data) ? imageData : (sg_image_data){.subimage[0][0] = {NULL, 0}}, | |
.label = "nanovg.image[]", | |
}); | |
tex->imgData = malloc(w * h * (type == NVG_TEXTURE_RGBA ? 4 : 1)); | |
if (data != NULL) { | |
memcpy(tex->imgData, data, w * h * (type == NVG_TEXTURE_RGBA ? 4 : 1)); | |
} | |
tex->smp = sg_make_sampler(&(sg_sampler_desc){ | |
.min_filter = imageFlags & NVG_IMAGE_GENERATE_MIPMAPS | |
? _SG_FILTER_DEFAULT | |
: (imageFlags & NVG_IMAGE_NEAREST ? SG_FILTER_NEAREST : SG_FILTER_LINEAR), | |
.mipmap_filter = imageFlags & NVG_IMAGE_GENERATE_MIPMAPS | |
? (imageFlags & NVG_IMAGE_NEAREST ? SG_FILTER_NEAREST : SG_FILTER_LINEAR) | |
: _SG_FILTER_DEFAULT, | |
.mag_filter = imageFlags & NVG_IMAGE_NEAREST ? SG_FILTER_NEAREST : SG_FILTER_LINEAR, | |
.wrap_u = imageFlags & NVG_IMAGE_REPEATX ? SG_WRAP_REPEAT : SG_WRAP_CLAMP_TO_EDGE, | |
.wrap_v = imageFlags & NVG_IMAGE_REPEATY ? SG_WRAP_REPEAT : SG_WRAP_CLAMP_TO_EDGE, | |
}); | |
return tex->id; | |
} | |
static int sgnvg__renderDeleteTexture(void* uptr, int image) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderDeleteTexture(uptr: %p, image: %d)\n", uptr, image); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
return sgnvg__deleteTexture(sg, image); | |
} | |
static int sgnvg__renderUpdateTexture(void* uptr, int image, int x0, int y0, int w, int h, const unsigned char* data) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderUpdateTexture(uptr: %p, image: %d, x0: %d, y0: %d, w: %d, h: %d, data: %p)\n", uptr, image, x0, y0, w, h, data); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
SGNVGtexture* tex = sgnvg__findTexture(sg, image); | |
if (tex == NULL) return 0; | |
if (tex->imgData) { | |
// this is really weird but nanogl_gl.h is doing the same | |
// somehow we always get a whole row or so? o_O | |
x0 = 0; | |
w = tex->width; | |
size_t bytePerPixel = 1; | |
if (tex->type == NVG_TEXTURE_RGBA) { | |
bytePerPixel = 4; | |
} | |
size_t srcLineInBytes = w * bytePerPixel; | |
size_t dstLineInBytes = tex->width * bytePerPixel; | |
const unsigned char* src = data + y0 * srcLineInBytes; | |
unsigned char* dst = tex->imgData + y0 * dstLineInBytes + x0 * bytePerPixel; | |
for (int y=0; y<h; y++) { | |
memcpy(dst, src, srcLineInBytes); | |
src += srcLineInBytes; | |
dst += dstLineInBytes; | |
} | |
} | |
return 1; | |
} | |
static int sgnvg__renderGetTextureSize(void* uptr, int image, int* w, int* h) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderGetTextureSize(uptr: %p, image: %d, w: %d, h: %d)\n", uptr, image, *w, *h); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
SGNVGtexture* tex = sgnvg__findTexture(sg, image); | |
if (tex == NULL) return 0; | |
*w = tex->width; | |
*h = tex->height; | |
return 1; | |
} | |
static void sgnvg__xformToMat3x4(float* m3, float* t) | |
{ | |
SGNVG_INTLOG("sgnvg__xformToMat3x4(m3: %p, t: %p)\n", m3, t); | |
m3[0] = t[0]; | |
m3[1] = t[1]; | |
m3[2] = 0.0f; | |
m3[3] = 0.0f; | |
m3[4] = t[2]; | |
m3[5] = t[3]; | |
m3[6] = 0.0f; | |
m3[7] = 0.0f; | |
m3[8] = t[4]; | |
m3[9] = t[5]; | |
m3[10] = 1.0f; | |
m3[11] = 0.0f; | |
} | |
static NVGcolor sgnvg__premulColor(NVGcolor c) | |
{ | |
SGNVG_INTLOG("sgnvg__premulColor(c: %f, %f, %f, %f)\n", c.r, c.g, c.b, c.a); | |
c.r *= c.a; | |
c.g *= c.a; | |
c.b *= c.a; | |
return c; | |
} | |
static int sgnvg__convertPaint(SGNVGcontext* sg, SGNVGfragUniforms* frag, NVGpaint* paint, | |
NVGscissor* scissor, float width, float fringe, float strokeThr) | |
{ | |
SGNVG_INTLOG("sgnvg__convertPaint(sg: %p, frag: %p, paint: %p, scissor: %p, width: %f, fringe: %f, strokeThr: %f)\n", sg, frag, paint, scissor, width, fringe, strokeThr); | |
SGNVGtexture* tex = NULL; | |
float invxform[6]; | |
memset(frag, 0, sizeof(*frag)); | |
frag->innerCol = sgnvg__premulColor(paint->innerColor); | |
frag->outerCol = sgnvg__premulColor(paint->outerColor); | |
if (scissor->extent[0] < -0.5f || scissor->extent[1] < -0.5f) { | |
memset(frag->scissorMat, 0, sizeof(frag->scissorMat)); | |
frag->scissorExt[0] = 1.0f; | |
frag->scissorExt[1] = 1.0f; | |
frag->scissorScale[0] = 1.0f; | |
frag->scissorScale[1] = 1.0f; | |
} else { | |
nvgTransformInverse(invxform, scissor->xform); | |
sgnvg__xformToMat3x4(frag->scissorMat, invxform); | |
frag->scissorExt[0] = scissor->extent[0]; | |
frag->scissorExt[1] = scissor->extent[1]; | |
frag->scissorScale[0] = sqrtf(scissor->xform[0]*scissor->xform[0] + scissor->xform[2]*scissor->xform[2]) / fringe; | |
frag->scissorScale[1] = sqrtf(scissor->xform[1]*scissor->xform[1] + scissor->xform[3]*scissor->xform[3]) / fringe; | |
} | |
memcpy(frag->extent, paint->extent, sizeof(frag->extent)); | |
frag->strokeMult = (width*0.5f + fringe*0.5f) / fringe; | |
frag->strokeThr = strokeThr; | |
if (paint->image != 0) { | |
tex = sgnvg__findTexture(sg, paint->image); | |
if (tex == NULL) return 0; | |
if ((tex->flags & NVG_IMAGE_FLIPY) != 0) { | |
float m1[6], m2[6]; | |
nvgTransformTranslate(m1, 0.0f, frag->extent[1] * 0.5f); | |
nvgTransformMultiply(m1, paint->xform); | |
nvgTransformScale(m2, 1.0f, -1.0f); | |
nvgTransformMultiply(m2, m1); | |
nvgTransformTranslate(m1, 0.0f, -frag->extent[1] * 0.5f); | |
nvgTransformMultiply(m1, m2); | |
nvgTransformInverse(invxform, m1); | |
} else { | |
nvgTransformInverse(invxform, paint->xform); | |
} | |
frag->type = NSVG_SHADER_FILLIMG; | |
#if NANOVG_GL_USE_UNIFORMBUFFER | |
if (tex->type == NVG_TEXTURE_RGBA) | |
frag->texType = (tex->flags & NVG_IMAGE_PREMULTIPLIED) ? 0 : 1; | |
else | |
frag->texType = 2; | |
#else | |
if (tex->type == NVG_TEXTURE_RGBA) | |
frag->texType = (tex->flags & NVG_IMAGE_PREMULTIPLIED) ? 0.0f : 1.0f; | |
else | |
frag->texType = 2.0f; | |
#endif | |
// printf("frag->texType = %d\n", frag->texType); | |
} else { | |
frag->type = NSVG_SHADER_FILLGRAD; | |
frag->radius = paint->radius; | |
frag->feather = paint->feather; | |
nvgTransformInverse(invxform, paint->xform); | |
} | |
sgnvg__xformToMat3x4(frag->paintMat, invxform); | |
return 1; | |
} | |
static void sgnvg__renderViewport(void* uptr, float width, float height, float devicePixelRatio) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderViewport(uptr: %p, width: %f, height: %f, devicePixelRatio: %f)\n", uptr, width, height, devicePixelRatio); | |
NVG_NOTUSED(devicePixelRatio); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
sg->view.viewSize[0] = width; | |
sg->view.viewSize[1] = height; | |
} | |
static void sgnvg__fill(SGNVGcontext* sg, SGNVGcall* call) | |
{ | |
SGNVG_INTLOG("sgnvg__fill(sg: %p, call: %p)\n", sg, call); | |
SGNVGpath* paths = &sg->paths[call->pathOffset]; | |
int i, npaths = call->pathCount; | |
sgnvg__preparePipelineUniforms(sg, SGNVG_PIP_FILL_STENCIL, call->uniformOffset, 0); | |
for (i = 0; i < npaths; i++) | |
SG_DRAW(paths[i].fillOffset, paths[i].fillCount, 1); | |
if (sg->flags & NVG_ANTIALIAS) { | |
sgnvg__preparePipelineUniforms(sg, SGNVG_PIP_FILL_ANTIALIAS, call->uniformOffset + sg->fragSize, call->image); | |
// Draw fringes | |
for (i = 0; i < npaths; i++) | |
SG_DRAW(paths[i].strokeOffset, paths[i].strokeCount, 1); | |
} | |
// Draw fill | |
sgnvg__preparePipelineUniforms(sg, SGNVG_PIP_FILL_DRAW, call->uniformOffset + sg->fragSize, call->image); | |
SG_DRAW(call->triangleOffset, call->triangleCount, 1); | |
} | |
static void sgnvg__convexFill(SGNVGcontext* sg, SGNVGcall* call) | |
{ | |
SGNVG_INTLOG("sgnvg__convexFill(sg: %p, call: %p)\n", sg, call); | |
SGNVGpath* paths = &sg->paths[call->pathOffset]; | |
int i, npaths = call->pathCount; | |
sgnvg__preparePipelineUniforms(sg, SGNVG_PIP_BASE, call->uniformOffset, call->image); | |
for (i = 0; i < npaths; i++) { | |
SG_DRAW(paths[i].fillOffset, paths[i].fillCount, 1); | |
// Draw fringes | |
if (paths[i].strokeCount > 0) { | |
SG_DRAW(paths[i].strokeOffset, paths[i].strokeCount, 1); | |
} | |
} | |
} | |
static void sgnvg__stroke(SGNVGcontext* sg, SGNVGcall* call) | |
{ | |
SGNVG_INTLOG("sgnvg__stroke(sg: %p, call: %p)\n", sg, call); | |
SGNVGpath* paths = &sg->paths[call->pathOffset]; | |
int npaths = call->pathCount, i; | |
if (sg->flags & NVG_STENCIL_STROKES) { | |
sgnvg__preparePipelineUniforms(sg, SGNVG_PIP_STROKE_STENCIL_DRAW, call->uniformOffset + sg->fragSize, call->image); | |
for (i = 0; i < npaths; i++) | |
SG_DRAW(paths[i].strokeOffset, paths[i].strokeCount, 1); | |
// Draw anti-aliased pixels. | |
sgnvg__preparePipelineUniforms(sg, SGNVG_PIP_STROKE_STENCIL_ANTIALIAS, call->uniformOffset, call->image); | |
for (i = 0; i < npaths; i++) | |
SG_DRAW(paths[i].strokeOffset, paths[i].strokeCount, 1); | |
// Clear stencil buffer. | |
sgnvg__preparePipelineUniforms(sg, SGNVG_PIP_STROKE_STENCIL_CLEAR, call->uniformOffset, 0); | |
for (i = 0; i < npaths; i++) | |
SG_DRAW(paths[i].strokeOffset, paths[i].strokeCount, 1); | |
// sgnvg__convertPaint(sg, nvg__fragUniformPtr(sg, call->uniformOffset + sg->fragSize), paint, scissor, strokeWidth, fringe, 1.0f - 0.5f/255.0f); | |
} else { | |
sgnvg__preparePipelineUniforms(sg, SGNVG_PIP_BASE, call->uniformOffset, call->image); | |
// Draw Strokes | |
for (i = 0; i < npaths; i++) | |
SG_DRAW(paths[i].strokeOffset, paths[i].strokeCount, 1); | |
} | |
} | |
static void sgnvg__triangles(SGNVGcontext* sg, SGNVGcall* call) | |
{ | |
SGNVG_INTLOG("sgnvg__triangles(sg: %p, call: %p)\n", sg, call); | |
sgnvg__preparePipelineUniforms(sg, SGNVG_PIP_BASE, call->uniformOffset, call->image); | |
SG_DRAW(call->triangleOffset, call->triangleCount, 1); | |
} | |
static void sgnvg__renderCancel(void* uptr) { | |
SGNVG_EXTLOG("sgnvg__renderCancel(uptr: %p)\n", uptr); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
sg->nverts = 0; | |
sg->npaths = 0; | |
sg->ncalls = 0; | |
sg->nuniforms = 0; | |
} | |
static sg_blend_factor sgnvg_convertBlendFuncFactor(int factor) | |
{ | |
if (factor == NVG_ZERO) | |
return SG_BLENDFACTOR_ZERO; | |
if (factor == NVG_ONE) | |
return SG_BLENDFACTOR_ONE; | |
if (factor == NVG_SRC_COLOR) | |
return SG_BLENDFACTOR_SRC_COLOR; | |
if (factor == NVG_ONE_MINUS_SRC_COLOR) | |
return SG_BLENDFACTOR_ONE_MINUS_SRC_COLOR; | |
if (factor == NVG_DST_COLOR) | |
return SG_BLENDFACTOR_DST_COLOR; | |
if (factor == NVG_ONE_MINUS_DST_COLOR) | |
return SG_BLENDFACTOR_ONE_MINUS_DST_COLOR; | |
if (factor == NVG_SRC_ALPHA) | |
return SG_BLENDFACTOR_SRC_ALPHA; | |
if (factor == NVG_ONE_MINUS_SRC_ALPHA) | |
return SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA; | |
if (factor == NVG_DST_ALPHA) | |
return SG_BLENDFACTOR_DST_ALPHA; | |
if (factor == NVG_ONE_MINUS_DST_ALPHA) | |
return SG_BLENDFACTOR_ONE_MINUS_DST_ALPHA; | |
if (factor == NVG_SRC_ALPHA_SATURATE) | |
return SG_BLENDFACTOR_SRC_ALPHA_SATURATED; | |
return _SG_BLENDFACTOR_DEFAULT; | |
} | |
static SGNVGblend sgnvg__blendCompositeOperation(NVGcompositeOperationState op) | |
{ | |
SGNVG_INTLOG("sgnvg__blendCompositeOperation(op: (%d, %d, %d, %d))\n", op.srcRGB, op.dstRGB, op.srcAlpha, op.dstAlpha); | |
SGNVGblend blend; | |
blend.srcRGB = sgnvg_convertBlendFuncFactor(op.srcRGB); | |
blend.dstRGB = sgnvg_convertBlendFuncFactor(op.dstRGB); | |
blend.srcAlpha = sgnvg_convertBlendFuncFactor(op.srcAlpha); | |
blend.dstAlpha = sgnvg_convertBlendFuncFactor(op.dstAlpha); | |
if (blend.srcRGB == _SG_BLENDFACTOR_DEFAULT || blend.dstRGB == _SG_BLENDFACTOR_DEFAULT || blend.srcAlpha == _SG_BLENDFACTOR_DEFAULT || blend.dstAlpha == _SG_BLENDFACTOR_DEFAULT) | |
{ | |
blend.srcRGB = SG_BLENDFACTOR_ONE; | |
blend.dstRGB = SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA; | |
blend.srcAlpha = SG_BLENDFACTOR_ONE; | |
blend.dstAlpha = SG_BLENDFACTOR_ONE_MINUS_SRC_ALPHA; | |
} | |
return blend; | |
} | |
static void sgnvg__renderFlush(void* uptr) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderFlush(uptr: %p)\n", uptr); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
int i; | |
for (i = 0; i < sg->ntextures; i++) { | |
if (sg->textures[i].id != 0) { | |
sgnvg__flushTexture(&sg->textures[i]); | |
} | |
} | |
if (sg->ncalls > 0 && sg->nverts && sg->nindexes) { | |
if(sg->cverts_gpu < sg->nverts) // resize GPU vertex buffer | |
{ | |
if(sg->cverts_gpu) // delete old buffer if necessary | |
sg_uninit_buffer(sg->vertBuf); | |
sg->cverts_gpu = sg->cverts; | |
sg_init_buffer(sg->vertBuf, &(sg_buffer_desc){ | |
.size = sg->cverts_gpu * sizeof(*sg->verts), | |
.type = SG_BUFFERTYPE_VERTEXBUFFER, | |
.usage = SG_USAGE_STREAM, | |
.label = "nanovg.vertBuf", | |
}); | |
} | |
// upload vertex data | |
sg_update_buffer(sg->vertBuf, &(sg_range){ sg->verts, sg->nverts * sizeof(*sg->verts) }); | |
if(sg->cindexes_gpu < sg->nindexes) // resize GPU index buffer | |
{ | |
if(sg->cindexes_gpu) // delete old buffer if necessary | |
sg_uninit_buffer(sg->indexBuf); | |
sg->cindexes_gpu = sg->cindexes; | |
sg_init_buffer(sg->indexBuf, &(sg_buffer_desc){ | |
.size = sg->cindexes_gpu * sizeof(*sg->indexes), | |
.type = SG_BUFFERTYPE_INDEXBUFFER, | |
.usage = SG_USAGE_STREAM, | |
.label = "nanovg.indexBuf", | |
}); | |
} | |
// upload index data | |
sg_update_buffer(sg->indexBuf, &(sg_range){ sg->indexes, sg->nindexes * sizeof(*sg->indexes) }); | |
for (i = 0; i < sg->ncalls; i++) { | |
SGNVGcall* call = &sg->calls[i]; | |
sg->blend.src_factor_rgb = call->blendFunc.srcRGB; | |
sg->blend.dst_factor_rgb = call->blendFunc.dstRGB; | |
sg->blend.src_factor_alpha = call->blendFunc.srcAlpha; | |
sg->blend.dst_factor_alpha = call->blendFunc.dstAlpha; | |
sg->pipelineCacheIndex = sgnvg__getIndexFromCache(sg, sgnvg__getCombinedBlendNumber(sg->blend)); | |
if (call->type == SGNVG_FILL) | |
sgnvg__fill(sg, call); | |
else if (call->type == SGNVG_CONVEXFILL) | |
sgnvg__convexFill(sg, call); | |
else if (call->type == SGNVG_STROKE) | |
sgnvg__stroke(sg, call); | |
else if (call->type == SGNVG_TRIANGLES) | |
sgnvg__triangles(sg, call); | |
} | |
//sg_uninit_pipeline(sg->pipeline); | |
//sgnvg__initPipeline(sg, &(sg_stencil_state){0}, SG_COLORMASK_RGBA, SG_CULLMODE_NONE); | |
} | |
// Reset calls | |
sg->nverts = 0; | |
sg->nindexes = 0; | |
sg->npaths = 0; | |
sg->ncalls = 0; | |
sg->nuniforms = 0; | |
} | |
static int sgnvg__maxVertCount(const NVGpath* paths, int npaths) | |
{ | |
SGNVG_INTLOG("sgnvg__maxVertCount(paths: %p, npaths: %d)\n", paths, npaths); | |
int i, count = 0; | |
for (i = 0; i < npaths; i++) { | |
count += paths[i].nfill; | |
count += paths[i].nstroke; | |
} | |
return count; | |
} | |
static int sgnvg__maxIndexCount(const NVGpath* paths, int npaths) | |
{ | |
SGNVG_INTLOG("sgnvg__maxIndexCount(paths: %p, npaths: %d)\n", paths, npaths); | |
int i, count = 0; | |
for (i = 0; i < npaths; i++) { | |
count += sgnvg__maxi(paths[i].nfill - 2, 0) * 3; // triangle fan | |
count += sgnvg__maxi(paths[i].nstroke - 2, 0) * 3; // triangle strip | |
} | |
return count; | |
} | |
static SGNVGcall* sgnvg__allocCall(SGNVGcontext* sg) | |
{ | |
SGNVG_INTLOG("sgnvg__allocCall(sg: %p)\n", sg); | |
SGNVGcall* ret = NULL; | |
if (sg->ncalls+1 > sg->ccalls) { | |
SGNVGcall* calls; | |
int ccalls = sgnvg__maxi(sg->ncalls+1, 128) + sg->ccalls/2; // 1.5x Overallocate | |
calls = (SGNVGcall*)realloc(sg->calls, sizeof(SGNVGcall) * ccalls); | |
if (calls == NULL) return NULL; | |
sg->calls = calls; | |
sg->ccalls = ccalls; | |
} | |
ret = &sg->calls[sg->ncalls++]; | |
memset(ret, 0, sizeof(SGNVGcall)); | |
return ret; | |
} | |
static int sgnvg__allocPaths(SGNVGcontext* sg, int n) | |
{ | |
SGNVG_INTLOG("sgnvg__allocPaths(sg: %p, n: %d)\n", sg, n); | |
int ret = 0; | |
if (sg->npaths+n > sg->cpaths) { | |
SGNVGpath* paths; | |
int cpaths = sgnvg__maxi(sg->npaths + n, 128) + sg->cpaths/2; // 1.5x Overallocate | |
paths = (SGNVGpath*)realloc(sg->paths, sizeof(SGNVGpath) * cpaths); | |
if (paths == NULL) return -1; | |
sg->paths = paths; | |
sg->cpaths = cpaths; | |
} | |
ret = sg->npaths; | |
sg->npaths += n; | |
return ret; | |
} | |
static int sgnvg__allocVerts(SGNVGcontext* sg, int n) | |
{ | |
SGNVG_INTLOG("sgnvg__allocVerts(sg: %p, n: %d)\n", sg, n); | |
int ret = 0; | |
if (sg->nverts+n > sg->cverts) { | |
SGNVGattribute* verts; | |
int cverts = sgnvg__maxi(sg->nverts + n, 4096) + sg->cverts/2; // 1.5x Overallocate | |
verts = (SGNVGattribute*)realloc(sg->verts, sizeof(SGNVGattribute) * cverts); | |
if (verts == NULL) return -1; | |
sg->verts = verts; | |
sg->cverts = cverts; | |
} | |
ret = sg->nverts; | |
sg->nverts += n; | |
return ret; | |
} | |
static int sgnvg__allocIndexes(SGNVGcontext* sg, int n) | |
{ | |
SGNVG_INTLOG("sgnvg__allocIndexes(sg: %p, n: %d)\n", sg, n); | |
int ret = 0; | |
if (sg->nindexes+n > sg->cindexes) { | |
uint32_t* indexes; | |
int cindexes = sgnvg__maxi(sg->nindexes + n, 4096) + sg->cindexes/2; // 1.5x Overallocate | |
indexes = (uint32_t*)realloc(sg->indexes, sizeof(uint32_t) * cindexes); | |
if (indexes == NULL) return -1; | |
sg->indexes = indexes; | |
sg->cindexes = cindexes; | |
} | |
ret = sg->nindexes; | |
sg->nindexes += n; | |
return ret; | |
} | |
static int sgnvg__allocFragUniforms(SGNVGcontext* sg, int n) | |
{ | |
SGNVG_INTLOG("sgnvg__allocFragUniforms(sg: %p, n: %d)\n", sg, n); | |
int ret = 0, structSize = sg->fragSize; | |
if (sg->nuniforms+n > sg->cuniforms) { | |
unsigned char* uniforms; | |
int cuniforms = sgnvg__maxi(sg->nuniforms+n, 128) + sg->cuniforms/2; // 1.5x Overallocate | |
uniforms = (unsigned char*)realloc(sg->uniforms, structSize * cuniforms); | |
if (uniforms == NULL) return -1; | |
sg->uniforms = uniforms; | |
sg->cuniforms = cuniforms; | |
} | |
ret = sg->nuniforms * structSize; | |
sg->nuniforms += n; | |
return ret; | |
} | |
static SGNVGfragUniforms* nvg__fragUniformPtr(SGNVGcontext* gl, int i) | |
{ | |
SGNVG_INTLOG("nvg__fragUniformPtr(gl: %p, i: %d)\n", gl, i); | |
return (SGNVGfragUniforms*)&gl->uniforms[i]; | |
} | |
static void sgnvg__vset(SGNVGattribute* vtx, float x, float y, float u, float v) | |
{ | |
SGNVG_INTLOG("sgnvg__vset(vtx: %p, x: %f, y: %f, u: %f, v: %f)\n", vtx, x, y, u, v); | |
vtx->vertex[0] = x; | |
vtx->vertex[1] = y; | |
vtx->tcoord[0] = u; | |
vtx->tcoord[1] = v; | |
} | |
static void sgnvg__generateTriangleFanIndexes(uint32_t* indexes, int offset, int nverts) | |
{ | |
SGNVG_INTLOG("sgnvg__generateTriangleFanIndexes(indexes: %p, offset: %d, nverts: %d)\n", indexes, offset, nverts); | |
// following triangles all use starting vertex, previous vertex, and current vertex | |
for(int i = 2; i < nverts; i++) | |
{ | |
indexes[3*(i-2)+0] = offset+0; | |
indexes[3*(i-2)+1] = offset+i-1; | |
indexes[3*(i-2)+2] = offset+i; | |
} | |
} | |
static void sgnvg__generateTriangleStripIndexes(uint32_t* indexes, int offset, int nverts) | |
{ | |
SGNVG_INTLOG("sgnvg__generateTriangleStripIndexes(indexes: %p, offset: %d, nverts: %d)\n", indexes, offset, nverts); | |
// following triangles all use previous 2 vertices, and current vertex | |
// we use bit-shifts to get the sequence: | |
// i idx i(bits) i-1(bits) i-2(bits) | |
// 2: 012 0010 0001 0000 | |
// 3: 213 0011 0010 0001 | |
// 4: 234 0100 0011 0010 | |
// 5: 435 0101 0100 0011 | |
// 6: 456 0110 0101 0100 | |
// 7: 657 0111 0110 0101 | |
// first index = above & ~1 = floor_to_even(i-1) | |
// second index = above | 1 = ceil_to_even(i-2) | |
// all this trickery ensures that we maintain correct (CCW) vertex order | |
for(int i = 2; i < nverts; i++) | |
{ | |
indexes[3*(i-2)+0] = offset+((i-1)&~1); | |
indexes[3*(i-2)+1] = offset+((i-2)|1); | |
indexes[3*(i-2)+2] = offset+i; | |
} | |
} | |
static void sgnvg__renderFill(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, float fringe, | |
const float* bounds, const NVGpath* paths, int npaths) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderFill(uptr: %p, paint: %p, compositeOperation: (%d, %d, %d, %d), scissor: %p, fringe: %f, bounds: %f, paths: %p, npaths: %d)\n", uptr, paint, compositeOperation.srcRGB, compositeOperation.dstRGB, compositeOperation.srcAlpha, compositeOperation.dstAlpha, scissor, fringe, *bounds, paths, npaths); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
SGNVGcall* call = sgnvg__allocCall(sg); | |
SGNVGattribute* quad; | |
SGNVGfragUniforms* frag; | |
int i, maxverts, offset, maxindexes, ioffset; | |
if (call == NULL) return; | |
call->type = SGNVG_FILL; | |
call->triangleCount = 4; | |
call->pathOffset = sgnvg__allocPaths(sg, npaths); | |
if (call->pathOffset == -1) goto error; | |
call->pathCount = npaths; | |
call->image = paint->image; | |
call->blendFunc = sgnvg__blendCompositeOperation(compositeOperation); | |
if (npaths == 1 && paths[0].convex) | |
{ | |
call->type = SGNVG_CONVEXFILL; | |
call->triangleCount = 0; // Bounding box fill quad not needed for convex fill | |
} | |
// Allocate vertices for all the paths. | |
maxverts = sgnvg__maxVertCount(paths, npaths) + call->triangleCount; | |
offset = sgnvg__allocVerts(sg, maxverts); | |
if (offset == -1) goto error; | |
maxindexes = sgnvg__maxIndexCount(paths, npaths) + sgnvg__maxi(call->triangleCount - 2, 0) * 3; | |
ioffset = sgnvg__allocIndexes(sg, maxindexes); | |
if (ioffset == -1) goto error; | |
for (i = 0; i < npaths; i++) { | |
SGNVGpath* copy = &sg->paths[call->pathOffset + i]; | |
const NVGpath* path = &paths[i]; | |
memset(copy, 0, sizeof(SGNVGpath)); | |
if (path->nfill > 0) { | |
// fill: triangle fan | |
copy->fillOffset = ioffset; | |
copy->fillCount = (path->nfill - 2) * 3; | |
memcpy(&sg->verts[offset], path->fill, sizeof(NVGvertex) * path->nfill); | |
sgnvg__generateTriangleFanIndexes(&sg->indexes[ioffset], offset, path->nfill); | |
offset += path->nfill; | |
ioffset += copy->fillCount; | |
} | |
if (path->nstroke > 0) { | |
// stroke: triangle strip | |
copy->strokeOffset = ioffset; | |
copy->strokeCount = (path->nstroke - 2) * 3; | |
memcpy(&sg->verts[offset], path->stroke, sizeof(NVGvertex) * path->nstroke); | |
sgnvg__generateTriangleStripIndexes(&sg->indexes[ioffset], offset, path->nstroke); | |
offset += path->nstroke; | |
ioffset += copy->strokeCount; | |
} | |
} | |
// Setup uniforms for draw calls | |
if (call->type == SGNVG_FILL) { | |
// Quad | |
call->triangleOffset = ioffset; | |
call->triangleCount = (call->triangleCount - 2) * 3; // convert vertex count into index | |
quad = &sg->verts[offset]; | |
sgnvg__vset(&quad[0], bounds[2], bounds[3], 0.5f, 1.0f); | |
sgnvg__vset(&quad[1], bounds[2], bounds[1], 0.5f, 1.0f); | |
sgnvg__vset(&quad[2], bounds[0], bounds[3], 0.5f, 1.0f); | |
sgnvg__vset(&quad[3], bounds[0], bounds[1], 0.5f, 1.0f); | |
sgnvg__generateTriangleStripIndexes(&sg->indexes[ioffset], offset, 4); | |
call->uniformOffset = sgnvg__allocFragUniforms(sg, 2); | |
if (call->uniformOffset == -1) goto error; | |
// Simple shader for stencil | |
frag = nvg__fragUniformPtr(sg, call->uniformOffset); | |
memset(frag, 0, sizeof(*frag)); | |
frag->strokeThr = -1.0f; | |
frag->type = NSVG_SHADER_SIMPLE; | |
// Fill shader | |
sgnvg__convertPaint(sg, nvg__fragUniformPtr(sg, call->uniformOffset + sg->fragSize), paint, scissor, fringe, fringe, -1.0f); | |
} else { | |
call->uniformOffset = sgnvg__allocFragUniforms(sg, 1); | |
if (call->uniformOffset == -1) goto error; | |
// Fill shader | |
sgnvg__convertPaint(sg, nvg__fragUniformPtr(sg, call->uniformOffset), paint, scissor, fringe, fringe, -1.0f); | |
} | |
return; | |
error: | |
// We get here if call alloc was ok, but something else is not. | |
// Roll back the last call to prevent drawing it. | |
if (sg->ncalls > 0) sg->ncalls--; | |
} | |
static void sgnvg__renderStroke(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, float fringe, | |
float strokeWidth, const NVGpath* paths, int npaths) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderStroke(uptr: %p, paint: %p, compositeOperation: (%d, %d, %d, %d), scissor: %p, fringe: %f, strokeWidth: %f, paths: %p, npaths: %d)\n", uptr, paint, compositeOperation.dstAlpha, compositeOperation.dstRGB, compositeOperation.srcAlpha, compositeOperation.srcRGB, scissor, fringe, strokeWidth, paths, npaths); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
SGNVGcall* call = sgnvg__allocCall(sg); | |
int i, maxverts, offset, maxindexes, ioffset; | |
if (call == NULL) return; | |
call->type = SGNVG_STROKE; | |
call->pathOffset = sgnvg__allocPaths(sg, npaths); | |
if (call->pathOffset == -1) goto error; | |
call->pathCount = npaths; | |
call->image = paint->image; | |
call->blendFunc = sgnvg__blendCompositeOperation(compositeOperation); | |
// Allocate vertices for all the paths. | |
maxverts = sgnvg__maxVertCount(paths, npaths); | |
offset = sgnvg__allocVerts(sg, maxverts); | |
if (offset == -1) goto error; | |
maxindexes = sgnvg__maxIndexCount(paths, npaths); | |
ioffset = sgnvg__allocIndexes(sg, maxindexes); | |
if (ioffset == -1) goto error; | |
for (i = 0; i < npaths; i++) { | |
SGNVGpath* copy = &sg->paths[call->pathOffset + i]; | |
const NVGpath* path = &paths[i]; | |
memset(copy, 0, sizeof(SGNVGpath)); | |
if (path->nstroke) { | |
// stroke: triangle strip | |
copy->strokeOffset = ioffset; | |
copy->strokeCount = (path->nstroke - 2) * 3; | |
memcpy(&sg->verts[offset], path->stroke, sizeof(NVGvertex) * path->nstroke); | |
sgnvg__generateTriangleStripIndexes(&sg->indexes[ioffset], offset, path->nstroke); | |
offset += path->nstroke; | |
ioffset += copy->strokeCount; | |
} | |
} | |
if (sg->flags & NVG_STENCIL_STROKES) { | |
// Fill shader | |
call->uniformOffset = sgnvg__allocFragUniforms(sg, 2); | |
if (call->uniformOffset == -1) goto error; | |
sgnvg__convertPaint(sg, nvg__fragUniformPtr(sg, call->uniformOffset), paint, scissor, strokeWidth, fringe, -1.0f); | |
sgnvg__convertPaint(sg, nvg__fragUniformPtr(sg, call->uniformOffset + sg->fragSize), paint, scissor, strokeWidth, fringe, 1.0f - 0.5f/255.0f); | |
} else { | |
// Fill shader | |
call->uniformOffset = sgnvg__allocFragUniforms(sg, 1); | |
if (call->uniformOffset == -1) goto error; | |
sgnvg__convertPaint(sg, nvg__fragUniformPtr(sg, call->uniformOffset), paint, scissor, strokeWidth, fringe, -1.0f); | |
} | |
return; | |
error: | |
// We get here if call alloc was ok, but something else is not. | |
// Roll back the last call to prevent drawing it. | |
if (sg->ncalls > 0) sg->ncalls--; | |
} | |
static void sgnvg__renderTriangles(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, | |
const NVGvertex* verts, int nverts, float fringe) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderTriangles(uptr: %p, paint: %p, compositeOperation: (%d, %d, %d, %d), scissor: %p, verts: %p, nverts: %d, fringe: %f)\n", uptr, paint, compositeOperation.srcRGB, compositeOperation.dstRGB, compositeOperation.srcAlpha, compositeOperation.dstAlpha, scissor, verts, nverts, fringe); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
SGNVGcall* call = sgnvg__allocCall(sg); | |
SGNVGfragUniforms* frag; | |
if (call == NULL) return; | |
call->type = SGNVG_TRIANGLES; | |
call->image = paint->image; | |
call->blendFunc = sgnvg__blendCompositeOperation(compositeOperation); | |
int offset, ioffset; | |
offset = sgnvg__allocVerts(sg, nverts); | |
if(offset == -1) goto error; | |
ioffset = sgnvg__allocIndexes(sg, nverts); | |
if(ioffset == -1) goto error; | |
// Allocate vertices for all the paths. | |
call->triangleOffset = ioffset; | |
call->triangleCount = nverts; | |
memcpy(&sg->verts[offset], verts, sizeof(NVGvertex) * nverts); | |
for(int i = 0; i < nverts; i++) | |
sg->indexes[ioffset+i] = offset+i; | |
// Fill shader | |
call->uniformOffset = sgnvg__allocFragUniforms(sg, 1); | |
if (call->uniformOffset == -1) goto error; | |
frag = nvg__fragUniformPtr(sg, call->uniformOffset); | |
sgnvg__convertPaint(sg, frag, paint, scissor, 1.0f, fringe, -1.0f); | |
frag->type = NSVG_SHADER_IMG; | |
return; | |
error: | |
// We get here if call alloc was ok, but something else is not. | |
// Roll back the last call to prevent drawing it. | |
if (sg->ncalls > 0) sg->ncalls--; | |
} | |
static void sgnvg__renderDelete(void* uptr) | |
{ | |
SGNVG_EXTLOG("sgnvg__renderDelete(uptr: %p)\n", uptr); | |
SGNVGcontext* sg = (SGNVGcontext*)uptr; | |
int i; | |
if (sg == NULL) return; | |
sg_destroy_shader(sg->shader); | |
for(int i = 0; i < NANOVG_SG_PIPELINE_CACHE_SIZE; i++) | |
{ | |
for(uint32_t t = 0; t < SGNVG_PIP_NUM_; t++) | |
{ | |
// only uninitialize if correct flags are set | |
if(!sgnvg__pipelineTypeIsInUse(sg, (SGNVGpipelineType)t)) | |
continue; | |
if(sg->pipelineCache.pipelinesActive[i] & (1 << t)) | |
sg_uninit_pipeline(sg->pipelineCache.pipelines[i][t]); | |
sg_dealloc_pipeline(sg->pipelineCache.pipelines[i][t]); | |
} | |
} | |
if(sg->cverts_gpu) | |
sg_uninit_buffer(sg->vertBuf); | |
sg_dealloc_buffer(sg->vertBuf); | |
if(sg->cindexes_gpu) | |
sg_uninit_buffer(sg->indexBuf); | |
sg_dealloc_buffer(sg->indexBuf); | |
for (i = 0; i < sg->ntextures; i++) { | |
if (sg->textures[i].img.id != 0 && (sg->textures[i].flags & NVG_IMAGE_NODELETE) == 0) | |
sg_destroy_image(sg->textures[i].img); | |
} | |
free(sg->textures); | |
free(sg->paths); | |
free(sg->verts); | |
free(sg->indexes); | |
free(sg->uniforms); | |
free(sg->calls); | |
free(sg); | |
} | |
NVGcontext* nvgCreateSokol(int flags) | |
{ | |
SGNVG_EXTLOG("nvgCreateSokol(flags: %d)\n", flags); | |
NVGparams params; | |
NVGcontext* ctx = NULL; | |
SGNVGcontext* sg = (SGNVGcontext*)malloc(sizeof(SGNVGcontext)); | |
if(sg == NULL) goto error; | |
memset(sg, 0, sizeof(SGNVGcontext)); | |
memset(¶ms, 0, sizeof(params)); | |
params.renderCreate = sgnvg__renderCreate; | |
params.renderCreateTexture = sgnvg__renderCreateTexture; | |
params.renderDeleteTexture = sgnvg__renderDeleteTexture; | |
params.renderUpdateTexture = sgnvg__renderUpdateTexture; | |
params.renderGetTextureSize = sgnvg__renderGetTextureSize; | |
params.renderViewport = sgnvg__renderViewport; | |
params.renderCancel = sgnvg__renderCancel; | |
params.renderFlush = sgnvg__renderFlush; | |
params.renderFill = sgnvg__renderFill; | |
params.renderStroke = sgnvg__renderStroke; | |
params.renderTriangles = sgnvg__renderTriangles; | |
params.renderDelete = sgnvg__renderDelete; | |
params.userPtr = sg; | |
params.edgeAntiAlias = flags & NVG_ANTIALIAS ? 1 : 0; | |
sg->flags = flags; | |
ctx = nvgCreateInternal(¶ms); | |
if(ctx == NULL) goto error; | |
return ctx; | |
error: | |
if(ctx != NULL) nvgDeleteInternal(ctx); | |
return NULL; | |
} | |
void nvgDeleteSokol(NVGcontext* ctx) | |
{ | |
nvgDeleteInternal(ctx); | |
} | |
int nvsgCreateImageFromHandleSokol(NVGcontext* ctx, sg_image imageSokol, sg_sampler samplerSokol, int type, int w, int h, int flags) | |
{ | |
SGNVG_INTLOG("nvsgCreateImageFromHandleSokol(ctx: %p, imageSokol: %d, samplerSokol: %d, type: %d, w: %d, h: %d, flags: %d)\n", ctx, imageSokol.id, samplerSokol.id, type, w, h, flags); | |
SGNVGcontext* sg = (SGNVGcontext*)nvgInternalParams(ctx)->userPtr; | |
SGNVGtexture* tex = sgnvg__allocTexture(sg); | |
if (tex == NULL) return 0; | |
tex->type = type; | |
tex->img = imageSokol; | |
tex->smp = samplerSokol; | |
tex->flags = flags; | |
tex->width = w; | |
tex->height = h; | |
return tex->id; | |
} | |
sg_image nvsgImageHandleSokol(NVGcontext* ctx, int image) | |
{ | |
SGNVG_INTLOG("nvsgImageHandleSokol(ctx: %p, image: %d)\n", ctx, image); | |
SGNVGcontext* sg = (SGNVGcontext*)nvgInternalParams(ctx)->userPtr; | |
SGNVGtexture* tex = sgnvg__findTexture(sg, image); | |
return tex->img; | |
} | |
#endif /* NANOVG_SOKOL_IMPLEMENTATION */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment