1384 lines
84 KiB
C++
1384 lines
84 KiB
C++
#pragma once
|
|
/*
|
|
#version:1# (machine generated, don't edit!)
|
|
|
|
Generated by sokol-shdc (https://github.com/floooh/sokol-tools)
|
|
|
|
Cmdline:
|
|
sokol-shdc --input E:/box/box3d/samples/shaders/shapes/edge.glsl --output E:/box/box3d/samples/shaders/generated/edge.glsl.h --slang hlsl5:metal_macos:glsl430
|
|
|
|
Overview:
|
|
=========
|
|
Shader program: 'edge_overlay':
|
|
Get shader desc: edge_edge_overlay_shader_desc(sg_query_backend());
|
|
Vertex Shader: vs
|
|
Fragment Shader: fs
|
|
Attributes:
|
|
Bindings:
|
|
Uniform block 'ub_draw':
|
|
C struct: edge_ub_draw_t
|
|
Bind slot: UB_edge_ub_draw => 2
|
|
Uniform block 'ub_frame':
|
|
C struct: edge_ub_frame_t
|
|
Bind slot: UB_edge_ub_frame => 0
|
|
Uniform block 'ub_pass':
|
|
C struct: edge_ub_pass_t
|
|
Bind slot: UB_edge_ub_pass => 1
|
|
Storage buffer 'geom_instances':
|
|
C struct: edge_geom_instance_t
|
|
Bind slot: VIEW_edge_geom_instances => 0
|
|
Readonly: true
|
|
Storage buffer 'edge_endpoints':
|
|
C struct: edge_edge_endpoint_t
|
|
Bind slot: VIEW_edge_edge_endpoints => 1
|
|
Readonly: true
|
|
*/
|
|
#if !defined(SOKOL_GFX_INCLUDED)
|
|
#error "Please include sokol_gfx.h before edge.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 UB_edge_ub_draw (2)
|
|
#define UB_edge_ub_frame (0)
|
|
#define UB_edge_ub_pass (1)
|
|
#define VIEW_edge_geom_instances (0)
|
|
#define VIEW_edge_edge_endpoints (1)
|
|
#pragma pack(push,1)
|
|
SOKOL_SHDC_ALIGN(16) typedef struct edge_ub_draw_t {
|
|
int inst_base[4];
|
|
Vec4 edge_params;
|
|
} edge_ub_draw_t;
|
|
#pragma pack(pop)
|
|
#pragma pack(push,1)
|
|
SOKOL_SHDC_ALIGN(16) typedef struct edge_ub_frame_t {
|
|
Mat4 view_proj;
|
|
Vec4 viewport;
|
|
} edge_ub_frame_t;
|
|
#pragma pack(pop)
|
|
#pragma pack(push,1)
|
|
SOKOL_SHDC_ALIGN(16) typedef struct edge_ub_pass_t {
|
|
Vec4 convex_color;
|
|
Vec4 concave_color;
|
|
Vec4 flat_color;
|
|
} edge_ub_pass_t;
|
|
#pragma pack(pop)
|
|
#pragma pack(push,1)
|
|
SOKOL_SHDC_ALIGN(16) typedef struct edge_geom_instance_t {
|
|
Vec4 xform_row0;
|
|
Vec4 xform_row1;
|
|
Vec4 xform_row2;
|
|
Vec4 base_color;
|
|
Vec4 scale;
|
|
Vec4 material;
|
|
} edge_geom_instance_t;
|
|
#pragma pack(pop)
|
|
#pragma pack(push,1)
|
|
SOKOL_SHDC_ALIGN(16) typedef struct edge_edge_endpoint_t {
|
|
Vec4 pos_and_flag;
|
|
} edge_edge_endpoint_t;
|
|
#pragma pack(pop)
|
|
/*
|
|
#version 430
|
|
|
|
struct geom_instance
|
|
{
|
|
vec4 xform_row0;
|
|
vec4 xform_row1;
|
|
vec4 xform_row2;
|
|
vec4 base_color;
|
|
vec4 scale;
|
|
vec4 material;
|
|
};
|
|
|
|
struct edge_endpoint
|
|
{
|
|
vec4 pos_and_flag;
|
|
};
|
|
|
|
layout(binding = 0, std430) readonly buffer geom_instances
|
|
{
|
|
geom_instance gi_items[];
|
|
} _60;
|
|
|
|
struct ub_draw
|
|
{
|
|
ivec4 inst_base;
|
|
vec4 edge_params;
|
|
};
|
|
|
|
uniform ub_draw _65;
|
|
|
|
layout(binding = 1, std430) readonly buffer edge_endpoints
|
|
{
|
|
edge_endpoint ee_items[];
|
|
} _95;
|
|
|
|
uniform vec4 ub_frame[5];
|
|
layout(location = 0) noperspective out float v_dist_from_axis_px;
|
|
layout(location = 1) flat out float v_half_width_px;
|
|
layout(location = 2) flat out float v_flag;
|
|
|
|
void main()
|
|
{
|
|
int _16 = int(uint(gl_VertexID) / 6u);
|
|
int _22 = gl_VertexID - (_16 * 6);
|
|
bool _31 = _22 == 2;
|
|
bool _35 = _22 == 4;
|
|
float _51 = ((_31 || _35) || (_22 == 5)) ? 1.0 : (-1.0);
|
|
int _72 = _65.inst_base.x + gl_InstanceID;
|
|
int _97 = 2 * _16;
|
|
vec4 _131 = vec4(_95.ee_items[_97].pos_and_flag.xyz * _60.gi_items[_72].scale.xyz, 1.0);
|
|
vec4 _157 = vec4(_95.ee_items[_97 + 1].pos_and_flag.xyz * _60.gi_items[_72].scale.xyz, 1.0);
|
|
mat4 _183 = mat4(ub_frame[0], ub_frame[1], ub_frame[2], ub_frame[3]);
|
|
vec4 _189 = _183 * vec4(dot(_60.gi_items[_72].xform_row0, _131), dot(_60.gi_items[_72].xform_row1, _131), dot(_60.gi_items[_72].xform_row2, _131), 1.0);
|
|
vec4 _198 = _183 * vec4(dot(_60.gi_items[_72].xform_row0, _157), dot(_60.gi_items[_72].xform_row1, _157), dot(_60.gi_items[_72].xform_row2, _157), 1.0);
|
|
bvec4 _204 = bvec4(((_22 == 1) || _31) || _35);
|
|
vec4 _205 = vec4(_204.x ? _198.x : _189.x, _204.y ? _198.y : _189.y, _204.z ? _198.z : _189.z, _204.w ? _198.w : _189.w);
|
|
vec2 _245 = ((((_198.xy / vec2(_198.w)) * 0.5) + vec2(0.5)) * ub_frame[4].xy) - ((((_189.xy / vec2(_189.w)) * 0.5) + vec2(0.5)) * ub_frame[4].xy);
|
|
float _248 = length(_245);
|
|
vec2 _253;
|
|
if (_248 > 9.9999999747524270787835121154785e-07)
|
|
{
|
|
_253 = _245 / vec2(_248);
|
|
}
|
|
else
|
|
{
|
|
_253 = vec2(1.0, 0.0);
|
|
}
|
|
float _277 = max(_65.edge_params.x * 0.5, 0.5);
|
|
float _281 = _277 + 1.5;
|
|
float _300 = _205.w;
|
|
vec2 _304 = _205.xy + ((((vec2(-_253.y, _253.x) * _51) * _281) * (ub_frame[4].zw * 2.0)) * _300);
|
|
vec4 _348 = _205;
|
|
_348.x = _304.x;
|
|
_348.y = _304.y;
|
|
_348.z = _205.z + (_65.edge_params.y * _300);
|
|
gl_Position = _348;
|
|
v_dist_from_axis_px = _51 * _281;
|
|
v_half_width_px = _277;
|
|
v_flag = _95.ee_items[_97].pos_and_flag.w;
|
|
}
|
|
|
|
*/
|
|
static const uint8_t edge_vs_source_glsl430[2529] = {
|
|
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x73,0x74,
|
|
0x72,0x75,0x63,0x74,0x20,0x67,0x65,0x6f,0x6d,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,
|
|
0x63,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x78,0x66,
|
|
0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,
|
|
0x63,0x34,0x20,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x31,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,
|
|
0x77,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x62,0x61,0x73,
|
|
0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,
|
|
0x34,0x20,0x73,0x63,0x61,0x6c,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,
|
|
0x34,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,
|
|
0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x65,0x64,0x67,0x65,0x5f,0x65,0x6e,0x64,0x70,
|
|
0x6f,0x69,0x6e,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,
|
|
0x70,0x6f,0x73,0x5f,0x61,0x6e,0x64,0x5f,0x66,0x6c,0x61,0x67,0x3b,0x0a,0x7d,0x3b,
|
|
0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,
|
|
0x20,0x3d,0x20,0x30,0x2c,0x20,0x73,0x74,0x64,0x34,0x33,0x30,0x29,0x20,0x72,0x65,
|
|
0x61,0x64,0x6f,0x6e,0x6c,0x79,0x20,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x67,0x65,
|
|
0x6f,0x6d,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x0a,0x7b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x67,0x65,0x6f,0x6d,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,
|
|
0x20,0x67,0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5d,0x3b,0x0a,0x7d,0x20,0x5f,
|
|
0x36,0x30,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x75,0x62,0x5f,0x64,
|
|
0x72,0x61,0x77,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x34,0x20,
|
|
0x69,0x6e,0x73,0x74,0x5f,0x62,0x61,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,
|
|
0x65,0x63,0x34,0x20,0x65,0x64,0x67,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,
|
|
0x0a,0x7d,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x75,0x62,0x5f,
|
|
0x64,0x72,0x61,0x77,0x20,0x5f,0x36,0x35,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,
|
|
0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x31,0x2c,0x20,0x73,
|
|
0x74,0x64,0x34,0x33,0x30,0x29,0x20,0x72,0x65,0x61,0x64,0x6f,0x6e,0x6c,0x79,0x20,
|
|
0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x65,0x64,0x67,0x65,0x5f,0x65,0x6e,0x64,0x70,
|
|
0x6f,0x69,0x6e,0x74,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x65,0x64,0x67,0x65,
|
|
0x5f,0x65,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74,0x20,0x65,0x65,0x5f,0x69,0x74,0x65,
|
|
0x6d,0x73,0x5b,0x5d,0x3b,0x0a,0x7d,0x20,0x5f,0x39,0x35,0x3b,0x0a,0x0a,0x75,0x6e,
|
|
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x75,0x62,0x5f,0x66,0x72,
|
|
0x61,0x6d,0x65,0x5b,0x35,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
|
|
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6e,0x6f,0x70,
|
|
0x65,0x72,0x73,0x70,0x65,0x63,0x74,0x69,0x76,0x65,0x20,0x6f,0x75,0x74,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,
|
|
0x5f,0x61,0x78,0x69,0x73,0x5f,0x70,0x78,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,
|
|
0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x66,
|
|
0x6c,0x61,0x74,0x20,0x6f,0x75,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,
|
|
0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x3b,0x0a,0x6c,
|
|
0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,
|
|
0x20,0x32,0x29,0x20,0x66,0x6c,0x61,0x74,0x20,0x6f,0x75,0x74,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x20,0x76,0x5f,0x66,0x6c,0x61,0x67,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,
|
|
0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,
|
|
0x74,0x20,0x5f,0x31,0x36,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x75,0x69,0x6e,0x74,
|
|
0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x29,0x20,0x2f,0x20,
|
|
0x36,0x75,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x32,
|
|
0x20,0x3d,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x20,0x2d,
|
|
0x20,0x28,0x5f,0x31,0x36,0x20,0x2a,0x20,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x31,0x20,0x3d,0x20,0x5f,0x32,0x32,0x20,0x3d,
|
|
0x3d,0x20,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,
|
|
0x35,0x20,0x3d,0x20,0x5f,0x32,0x32,0x20,0x3d,0x3d,0x20,0x34,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x31,0x20,0x3d,0x20,0x28,0x28,
|
|
0x5f,0x33,0x31,0x20,0x7c,0x7c,0x20,0x5f,0x33,0x35,0x29,0x20,0x7c,0x7c,0x20,0x28,
|
|
0x5f,0x32,0x32,0x20,0x3d,0x3d,0x20,0x35,0x29,0x29,0x20,0x3f,0x20,0x31,0x2e,0x30,
|
|
0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,
|
|
0x6e,0x74,0x20,0x5f,0x37,0x32,0x20,0x3d,0x20,0x5f,0x36,0x35,0x2e,0x69,0x6e,0x73,
|
|
0x74,0x5f,0x62,0x61,0x73,0x65,0x2e,0x78,0x20,0x2b,0x20,0x67,0x6c,0x5f,0x49,0x6e,
|
|
0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x44,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,
|
|
0x74,0x20,0x5f,0x39,0x37,0x20,0x3d,0x20,0x32,0x20,0x2a,0x20,0x5f,0x31,0x36,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x33,0x31,0x20,0x3d,
|
|
0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x39,0x35,0x2e,0x65,0x65,0x5f,0x69,0x74,0x65,
|
|
0x6d,0x73,0x5b,0x5f,0x39,0x37,0x5d,0x2e,0x70,0x6f,0x73,0x5f,0x61,0x6e,0x64,0x5f,
|
|
0x66,0x6c,0x61,0x67,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x36,0x30,0x2e,0x67,
|
|
0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,0x2e,0x73,0x63,0x61,
|
|
0x6c,0x65,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x35,0x37,0x20,0x3d,0x20,0x76,0x65,
|
|
0x63,0x34,0x28,0x5f,0x39,0x35,0x2e,0x65,0x65,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,
|
|
0x5f,0x39,0x37,0x20,0x2b,0x20,0x31,0x5d,0x2e,0x70,0x6f,0x73,0x5f,0x61,0x6e,0x64,
|
|
0x5f,0x66,0x6c,0x61,0x67,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x36,0x30,0x2e,
|
|
0x67,0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,0x2e,0x73,0x63,
|
|
0x61,0x6c,0x65,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x6d,0x61,0x74,0x34,0x20,0x5f,0x31,0x38,0x33,0x20,0x3d,0x20,0x6d,
|
|
0x61,0x74,0x34,0x28,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x30,0x5d,0x2c,
|
|
0x20,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x31,0x5d,0x2c,0x20,0x75,0x62,
|
|
0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x32,0x5d,0x2c,0x20,0x75,0x62,0x5f,0x66,0x72,
|
|
0x61,0x6d,0x65,0x5b,0x33,0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,
|
|
0x34,0x20,0x5f,0x31,0x38,0x39,0x20,0x3d,0x20,0x5f,0x31,0x38,0x33,0x20,0x2a,0x20,
|
|
0x76,0x65,0x63,0x34,0x28,0x64,0x6f,0x74,0x28,0x5f,0x36,0x30,0x2e,0x67,0x69,0x5f,
|
|
0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,0x2e,0x78,0x66,0x6f,0x72,0x6d,
|
|
0x5f,0x72,0x6f,0x77,0x30,0x2c,0x20,0x5f,0x31,0x33,0x31,0x29,0x2c,0x20,0x64,0x6f,
|
|
0x74,0x28,0x5f,0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,
|
|
0x37,0x32,0x5d,0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x31,0x2c,0x20,
|
|
0x5f,0x31,0x33,0x31,0x29,0x2c,0x20,0x64,0x6f,0x74,0x28,0x5f,0x36,0x30,0x2e,0x67,
|
|
0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,0x2e,0x78,0x66,0x6f,
|
|
0x72,0x6d,0x5f,0x72,0x6f,0x77,0x32,0x2c,0x20,0x5f,0x31,0x33,0x31,0x29,0x2c,0x20,
|
|
0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,
|
|
0x31,0x39,0x38,0x20,0x3d,0x20,0x5f,0x31,0x38,0x33,0x20,0x2a,0x20,0x76,0x65,0x63,
|
|
0x34,0x28,0x64,0x6f,0x74,0x28,0x5f,0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,0x74,0x65,
|
|
0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,
|
|
0x77,0x30,0x2c,0x20,0x5f,0x31,0x35,0x37,0x29,0x2c,0x20,0x64,0x6f,0x74,0x28,0x5f,
|
|
0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,
|
|
0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x31,0x2c,0x20,0x5f,0x31,0x35,
|
|
0x37,0x29,0x2c,0x20,0x64,0x6f,0x74,0x28,0x5f,0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,
|
|
0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,
|
|
0x72,0x6f,0x77,0x32,0x2c,0x20,0x5f,0x31,0x35,0x37,0x29,0x2c,0x20,0x31,0x2e,0x30,
|
|
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x30,
|
|
0x34,0x20,0x3d,0x20,0x62,0x76,0x65,0x63,0x34,0x28,0x28,0x28,0x5f,0x32,0x32,0x20,
|
|
0x3d,0x3d,0x20,0x31,0x29,0x20,0x7c,0x7c,0x20,0x5f,0x33,0x31,0x29,0x20,0x7c,0x7c,
|
|
0x20,0x5f,0x33,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,
|
|
0x5f,0x32,0x30,0x35,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x32,0x30,0x34,
|
|
0x2e,0x78,0x20,0x3f,0x20,0x5f,0x31,0x39,0x38,0x2e,0x78,0x20,0x3a,0x20,0x5f,0x31,
|
|
0x38,0x39,0x2e,0x78,0x2c,0x20,0x5f,0x32,0x30,0x34,0x2e,0x79,0x20,0x3f,0x20,0x5f,
|
|
0x31,0x39,0x38,0x2e,0x79,0x20,0x3a,0x20,0x5f,0x31,0x38,0x39,0x2e,0x79,0x2c,0x20,
|
|
0x5f,0x32,0x30,0x34,0x2e,0x7a,0x20,0x3f,0x20,0x5f,0x31,0x39,0x38,0x2e,0x7a,0x20,
|
|
0x3a,0x20,0x5f,0x31,0x38,0x39,0x2e,0x7a,0x2c,0x20,0x5f,0x32,0x30,0x34,0x2e,0x77,
|
|
0x20,0x3f,0x20,0x5f,0x31,0x39,0x38,0x2e,0x77,0x20,0x3a,0x20,0x5f,0x31,0x38,0x39,
|
|
0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x32,
|
|
0x34,0x35,0x20,0x3d,0x20,0x28,0x28,0x28,0x28,0x5f,0x31,0x39,0x38,0x2e,0x78,0x79,
|
|
0x20,0x2f,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x31,0x39,0x38,0x2e,0x77,0x29,0x29,
|
|
0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x30,
|
|
0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,
|
|
0x34,0x5d,0x2e,0x78,0x79,0x29,0x20,0x2d,0x20,0x28,0x28,0x28,0x28,0x5f,0x31,0x38,
|
|
0x39,0x2e,0x78,0x79,0x20,0x2f,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x31,0x38,0x39,
|
|
0x2e,0x77,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,
|
|
0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x75,0x62,0x5f,0x66,0x72,
|
|
0x61,0x6d,0x65,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x38,0x20,0x3d,0x20,0x6c,0x65,0x6e,
|
|
0x67,0x74,0x68,0x28,0x5f,0x32,0x34,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,
|
|
0x65,0x63,0x32,0x20,0x5f,0x32,0x35,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,
|
|
0x20,0x28,0x5f,0x32,0x34,0x38,0x20,0x3e,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,
|
|
0x39,0x39,0x37,0x34,0x37,0x35,0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33,
|
|
0x35,0x31,0x32,0x31,0x31,0x35,0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37,0x29,0x0a,
|
|
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,
|
|
0x35,0x33,0x20,0x3d,0x20,0x5f,0x32,0x34,0x35,0x20,0x2f,0x20,0x76,0x65,0x63,0x32,
|
|
0x28,0x5f,0x32,0x34,0x38,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,0x5f,0x32,0x35,0x33,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,
|
|
0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x37,0x37,
|
|
0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x5f,0x36,0x35,0x2e,0x65,0x64,0x67,0x65,0x5f,
|
|
0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x78,0x20,0x2a,0x20,0x30,0x2e,0x35,0x2c,0x20,
|
|
0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,
|
|
0x5f,0x32,0x38,0x31,0x20,0x3d,0x20,0x5f,0x32,0x37,0x37,0x20,0x2b,0x20,0x31,0x2e,
|
|
0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x30,
|
|
0x30,0x20,0x3d,0x20,0x5f,0x32,0x30,0x35,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x76,0x65,0x63,0x32,0x20,0x5f,0x33,0x30,0x34,0x20,0x3d,0x20,0x5f,0x32,0x30,0x35,
|
|
0x2e,0x78,0x79,0x20,0x2b,0x20,0x28,0x28,0x28,0x28,0x76,0x65,0x63,0x32,0x28,0x2d,
|
|
0x5f,0x32,0x35,0x33,0x2e,0x79,0x2c,0x20,0x5f,0x32,0x35,0x33,0x2e,0x78,0x29,0x20,
|
|
0x2a,0x20,0x5f,0x35,0x31,0x29,0x20,0x2a,0x20,0x5f,0x32,0x38,0x31,0x29,0x20,0x2a,
|
|
0x20,0x28,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x34,0x5d,0x2e,0x7a,0x77,
|
|
0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x33,0x30,0x30,0x29,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x34,0x38,0x20,
|
|
0x3d,0x20,0x5f,0x32,0x30,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x33,0x34,0x38,
|
|
0x2e,0x78,0x20,0x3d,0x20,0x5f,0x33,0x30,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x5f,0x33,0x34,0x38,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x33,0x30,0x34,0x2e,0x79,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x33,0x34,0x38,0x2e,0x7a,0x20,0x3d,0x20,0x5f,
|
|
0x32,0x30,0x35,0x2e,0x7a,0x20,0x2b,0x20,0x28,0x5f,0x36,0x35,0x2e,0x65,0x64,0x67,
|
|
0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x79,0x20,0x2a,0x20,0x5f,0x33,0x30,
|
|
0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,
|
|
0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x33,0x34,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,0x73,
|
|
0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x35,0x31,0x20,0x2a,0x20,0x5f,0x32,0x38,0x31,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,
|
|
0x74,0x68,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x32,0x37,0x37,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x3d,0x20,0x5f,0x39,0x35,0x2e,0x65,
|
|
0x65,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x39,0x37,0x5d,0x2e,0x70,0x6f,0x73,
|
|
0x5f,0x61,0x6e,0x64,0x5f,0x66,0x6c,0x61,0x67,0x2e,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,
|
|
0x00,
|
|
};
|
|
/*
|
|
#version 430
|
|
|
|
uniform vec4 ub_pass[3];
|
|
layout(location = 0) noperspective in float v_dist_from_axis_px;
|
|
layout(location = 1) flat in float v_half_width_px;
|
|
layout(location = 2) flat in float v_flag;
|
|
layout(location = 0) out vec4 out_color;
|
|
|
|
void main()
|
|
{
|
|
float _15 = fwidth(v_dist_from_axis_px);
|
|
vec4 col;
|
|
if (v_flag > 1.5)
|
|
{
|
|
col = ub_pass[2];
|
|
}
|
|
else
|
|
{
|
|
if (v_flag > 0.5)
|
|
{
|
|
col = ub_pass[0];
|
|
}
|
|
else
|
|
{
|
|
col = ub_pass[1];
|
|
}
|
|
}
|
|
out_color = col * (1.0 - smoothstep(v_half_width_px - _15, v_half_width_px + _15, abs(v_dist_from_axis_px)));
|
|
}
|
|
|
|
*/
|
|
static const uint8_t edge_fs_source_glsl430[652] = {
|
|
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x75,0x6e,
|
|
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x75,0x62,0x5f,0x70,0x61,
|
|
0x73,0x73,0x5b,0x33,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,
|
|
0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6e,0x6f,0x70,0x65,
|
|
0x72,0x73,0x70,0x65,0x63,0x74,0x69,0x76,0x65,0x20,0x69,0x6e,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x20,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,
|
|
0x78,0x69,0x73,0x5f,0x70,0x78,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
|
|
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x66,0x6c,0x61,
|
|
0x74,0x20,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x68,0x61,0x6c,
|
|
0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x3b,0x0a,0x6c,0x61,0x79,0x6f,
|
|
0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,
|
|
0x20,0x66,0x6c,0x61,0x74,0x20,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,
|
|
0x5f,0x66,0x6c,0x61,0x67,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,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,
|
|
0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x20,0x3d,0x20,0x66,
|
|
0x77,0x69,0x64,0x74,0x68,0x28,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,
|
|
0x6d,0x5f,0x61,0x78,0x69,0x73,0x5f,0x70,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,
|
|
0x20,0x28,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x3e,0x20,0x31,0x2e,0x35,0x29,0x0a,
|
|
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,
|
|
0x6c,0x20,0x3d,0x20,0x75,0x62,0x5f,0x70,0x61,0x73,0x73,0x5b,0x32,0x5d,0x3b,0x0a,
|
|
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,
|
|
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,
|
|
0x28,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x3e,0x20,0x30,0x2e,0x35,0x29,0x0a,0x20,
|
|
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
|
|
0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x20,0x3d,0x20,0x75,0x62,0x5f,0x70,0x61,
|
|
0x73,0x73,0x5b,0x30,0x5d,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,0x63,0x6f,0x6c,0x20,0x3d,0x20,0x75,0x62,0x5f,0x70,0x61,0x73,
|
|
0x73,0x5b,0x31,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,
|
|
0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,
|
|
0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,
|
|
0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x76,0x5f,
|
|
0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x20,0x2d,0x20,
|
|
0x5f,0x31,0x35,0x2c,0x20,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,
|
|
0x68,0x5f,0x70,0x78,0x20,0x2b,0x20,0x5f,0x31,0x35,0x2c,0x20,0x61,0x62,0x73,0x28,
|
|
0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,0x73,
|
|
0x5f,0x70,0x78,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
|
};
|
|
/*
|
|
struct geom_instance
|
|
{
|
|
float4 xform_row0;
|
|
float4 xform_row1;
|
|
float4 xform_row2;
|
|
float4 base_color;
|
|
float4 scale;
|
|
float4 material;
|
|
};
|
|
|
|
struct edge_endpoint
|
|
{
|
|
float4 pos_and_flag;
|
|
};
|
|
|
|
ByteAddressBuffer _60 : register(t0);
|
|
cbuffer ub_draw : register(b2)
|
|
{
|
|
int4 _65_inst_base : packoffset(c0);
|
|
float4 _65_edge_params : packoffset(c1);
|
|
};
|
|
|
|
ByteAddressBuffer _95 : register(t1);
|
|
cbuffer ub_frame : register(b0)
|
|
{
|
|
row_major float4x4 _180_view_proj : packoffset(c0);
|
|
float4 _180_viewport : packoffset(c4);
|
|
};
|
|
|
|
|
|
static float4 gl_Position;
|
|
static int gl_VertexIndex;
|
|
static int gl_InstanceIndex;
|
|
static float v_dist_from_axis_px;
|
|
static float v_half_width_px;
|
|
static float v_flag;
|
|
|
|
struct SPIRV_Cross_Input
|
|
{
|
|
uint gl_VertexIndex : SV_VertexID;
|
|
uint gl_InstanceIndex : SV_InstanceID;
|
|
};
|
|
|
|
struct SPIRV_Cross_Output
|
|
{
|
|
noperspective float v_dist_from_axis_px : TEXCOORD0;
|
|
nointerpolation float v_half_width_px : TEXCOORD1;
|
|
nointerpolation float v_flag : TEXCOORD2;
|
|
float4 gl_Position : SV_Position;
|
|
};
|
|
|
|
void vert_main()
|
|
{
|
|
int _16 = int(uint(gl_VertexIndex) / 6u);
|
|
int _22 = gl_VertexIndex - (_16 * 6);
|
|
bool _31 = _22 == 2;
|
|
bool _35 = _22 == 4;
|
|
float _51 = ((_31 || _35) || (_22 == 5)) ? 1.0f : (-1.0f);
|
|
geom_instance _75;
|
|
_75.xform_row0 = asfloat(_60.Load4((_65_inst_base.x + gl_InstanceIndex) * 96 + 0));
|
|
_75.xform_row1 = asfloat(_60.Load4((_65_inst_base.x + gl_InstanceIndex) * 96 + 16));
|
|
_75.xform_row2 = asfloat(_60.Load4((_65_inst_base.x + gl_InstanceIndex) * 96 + 32));
|
|
_75.base_color = asfloat(_60.Load4((_65_inst_base.x + gl_InstanceIndex) * 96 + 48));
|
|
_75.scale = asfloat(_60.Load4((_65_inst_base.x + gl_InstanceIndex) * 96 + 64));
|
|
_75.material = asfloat(_60.Load4((_65_inst_base.x + gl_InstanceIndex) * 96 + 80));
|
|
int _97 = 2 * _16;
|
|
float4 _131 = float4(asfloat(_95.Load4(_97 * 16 + 0)).xyz * _75.scale.xyz, 1.0f);
|
|
float4 _157 = float4(asfloat(_95.Load4((_97 + 1) * 16 + 0)).xyz * _75.scale.xyz, 1.0f);
|
|
float4 _189 = mul(float4(dot(_75.xform_row0, _131), dot(_75.xform_row1, _131), dot(_75.xform_row2, _131), 1.0f), _180_view_proj);
|
|
float4 _198 = mul(float4(dot(_75.xform_row0, _157), dot(_75.xform_row1, _157), dot(_75.xform_row2, _157), 1.0f), _180_view_proj);
|
|
bool4 _204 = (((_22 == 1) || _31) || _35).xxxx;
|
|
float4 _205 = float4(_204.x ? _198.x : _189.x, _204.y ? _198.y : _189.y, _204.z ? _198.z : _189.z, _204.w ? _198.w : _189.w);
|
|
float2 _245 = ((((_198.xy / _198.w.xx) * 0.5f) + 0.5f.xx) * _180_viewport.xy) - ((((_189.xy / _189.w.xx) * 0.5f) + 0.5f.xx) * _180_viewport.xy);
|
|
float _248 = length(_245);
|
|
float2 _253;
|
|
if (_248 > 9.9999999747524270787835121154785e-07f)
|
|
{
|
|
_253 = _245 / _248.xx;
|
|
}
|
|
else
|
|
{
|
|
_253 = float2(1.0f, 0.0f);
|
|
}
|
|
float _277 = max(_65_edge_params.x * 0.5f, 0.5f);
|
|
float _281 = _277 + 1.5f;
|
|
float _300 = _205.w;
|
|
float2 _304 = _205.xy + ((((float2(-_253.y, _253.x) * _51) * _281) * (_180_viewport.zw * 2.0f)) * _300);
|
|
float4 _348 = _205;
|
|
_348.x = _304.x;
|
|
_348.y = _304.y;
|
|
_348.z = _205.z + (_65_edge_params.y * _300);
|
|
gl_Position = _348;
|
|
v_dist_from_axis_px = _51 * _281;
|
|
v_half_width_px = _277;
|
|
v_flag = asfloat(_95.Load4(_97 * 16 + 0)).w;
|
|
}
|
|
|
|
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
|
{
|
|
gl_VertexIndex = int(stage_input.gl_VertexIndex);
|
|
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
|
|
vert_main();
|
|
SPIRV_Cross_Output stage_output;
|
|
stage_output.gl_Position = gl_Position;
|
|
stage_output.v_dist_from_axis_px = v_dist_from_axis_px;
|
|
stage_output.v_half_width_px = v_half_width_px;
|
|
stage_output.v_flag = v_flag;
|
|
return stage_output;
|
|
}
|
|
*/
|
|
static const uint8_t edge_vs_source_hlsl5[3745] = {
|
|
0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x67,0x65,0x6f,0x6d,0x5f,0x69,0x6e,0x73,0x74,
|
|
0x61,0x6e,0x63,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x34,0x20,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x30,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,
|
|
0x6f,0x77,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
|
|
0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x62,0x61,0x73,0x65,0x5f,0x63,0x6f,0x6c,0x6f,
|
|
0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x63,
|
|
0x61,0x6c,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
|
|
0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,
|
|
0x72,0x75,0x63,0x74,0x20,0x65,0x64,0x67,0x65,0x5f,0x65,0x6e,0x64,0x70,0x6f,0x69,
|
|
0x6e,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
|
|
0x70,0x6f,0x73,0x5f,0x61,0x6e,0x64,0x5f,0x66,0x6c,0x61,0x67,0x3b,0x0a,0x7d,0x3b,
|
|
0x0a,0x0a,0x42,0x79,0x74,0x65,0x41,0x64,0x64,0x72,0x65,0x73,0x73,0x42,0x75,0x66,
|
|
0x66,0x65,0x72,0x20,0x5f,0x36,0x30,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,
|
|
0x65,0x72,0x28,0x74,0x30,0x29,0x3b,0x0a,0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,
|
|
0x75,0x62,0x5f,0x64,0x72,0x61,0x77,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,
|
|
0x65,0x72,0x28,0x62,0x32,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,
|
|
0x34,0x20,0x5f,0x36,0x35,0x5f,0x69,0x6e,0x73,0x74,0x5f,0x62,0x61,0x73,0x65,0x20,
|
|
0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x36,0x35,
|
|
0x5f,0x65,0x64,0x67,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x70,
|
|
0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x31,0x29,0x3b,0x0a,0x7d,
|
|
0x3b,0x0a,0x0a,0x42,0x79,0x74,0x65,0x41,0x64,0x64,0x72,0x65,0x73,0x73,0x42,0x75,
|
|
0x66,0x66,0x65,0x72,0x20,0x5f,0x39,0x35,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,
|
|
0x74,0x65,0x72,0x28,0x74,0x31,0x29,0x3b,0x0a,0x63,0x62,0x75,0x66,0x66,0x65,0x72,
|
|
0x20,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,
|
|
0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,
|
|
0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,
|
|
0x34,0x20,0x5f,0x31,0x38,0x30,0x5f,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,
|
|
0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,
|
|
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,
|
|
0x38,0x30,0x5f,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,0x20,0x3a,0x20,0x70,0x61,
|
|
0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x34,0x29,0x3b,0x0a,0x7d,0x3b,
|
|
0x0a,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
|
0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,
|
|
0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,
|
|
0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,
|
|
0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,
|
|
0x6e,0x64,0x65,0x78,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x20,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,
|
|
0x78,0x69,0x73,0x5f,0x70,0x78,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,
|
|
0x68,0x5f,0x70,0x78,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x20,0x76,0x5f,0x66,0x6c,0x61,0x67,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,0x75,0x69,0x6e,0x74,0x20,
|
|
0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x3a,
|
|
0x20,0x53,0x56,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x75,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,
|
|
0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x3a,0x20,0x53,0x56,0x5f,0x49,0x6e,0x73,
|
|
0x74,0x61,0x6e,0x63,0x65,0x49,0x44,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,0x6e,0x6f,0x70,
|
|
0x65,0x72,0x73,0x70,0x65,0x63,0x74,0x69,0x76,0x65,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x20,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,
|
|
0x73,0x5f,0x70,0x78,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x69,0x6e,0x74,0x65,0x72,0x70,0x6f,0x6c,
|
|
0x61,0x74,0x69,0x6f,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x68,0x61,
|
|
0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x20,0x3a,0x20,0x54,0x45,
|
|
0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x69,
|
|
0x6e,0x74,0x65,0x72,0x70,0x6f,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x20,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,
|
|
0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,
|
|
0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,
|
|
0x0a,0x76,0x6f,0x69,0x64,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,
|
|
0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x36,0x20,
|
|
0x3d,0x20,0x69,0x6e,0x74,0x28,0x75,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,
|
|
0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x2f,0x20,0x36,0x75,0x29,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x32,0x20,0x3d,0x20,
|
|
0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x2d,
|
|
0x20,0x28,0x5f,0x31,0x36,0x20,0x2a,0x20,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x31,0x20,0x3d,0x20,0x5f,0x32,0x32,0x20,0x3d,
|
|
0x3d,0x20,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,
|
|
0x35,0x20,0x3d,0x20,0x5f,0x32,0x32,0x20,0x3d,0x3d,0x20,0x34,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x31,0x20,0x3d,0x20,0x28,0x28,
|
|
0x5f,0x33,0x31,0x20,0x7c,0x7c,0x20,0x5f,0x33,0x35,0x29,0x20,0x7c,0x7c,0x20,0x28,
|
|
0x5f,0x32,0x32,0x20,0x3d,0x3d,0x20,0x35,0x29,0x29,0x20,0x3f,0x20,0x31,0x2e,0x30,
|
|
0x66,0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x67,0x65,0x6f,0x6d,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x20,0x5f,
|
|
0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x37,0x35,0x2e,0x78,0x66,0x6f,0x72,
|
|
0x6d,0x5f,0x72,0x6f,0x77,0x30,0x20,0x3d,0x20,0x61,0x73,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x28,0x5f,0x36,0x30,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,0x28,0x5f,0x36,0x35,0x5f,
|
|
0x69,0x6e,0x73,0x74,0x5f,0x62,0x61,0x73,0x65,0x2e,0x78,0x20,0x2b,0x20,0x67,0x6c,
|
|
0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,
|
|
0x2a,0x20,0x39,0x36,0x20,0x2b,0x20,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x5f,0x37,0x35,0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x31,0x20,0x3d,
|
|
0x20,0x61,0x73,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x36,0x30,0x2e,0x4c,0x6f,0x61,
|
|
0x64,0x34,0x28,0x28,0x5f,0x36,0x35,0x5f,0x69,0x6e,0x73,0x74,0x5f,0x62,0x61,0x73,
|
|
0x65,0x2e,0x78,0x20,0x2b,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,
|
|
0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x2a,0x20,0x39,0x36,0x20,0x2b,0x20,0x31,
|
|
0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x37,0x35,0x2e,0x78,0x66,0x6f,
|
|
0x72,0x6d,0x5f,0x72,0x6f,0x77,0x32,0x20,0x3d,0x20,0x61,0x73,0x66,0x6c,0x6f,0x61,
|
|
0x74,0x28,0x5f,0x36,0x30,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,0x28,0x5f,0x36,0x35,
|
|
0x5f,0x69,0x6e,0x73,0x74,0x5f,0x62,0x61,0x73,0x65,0x2e,0x78,0x20,0x2b,0x20,0x67,
|
|
0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,
|
|
0x20,0x2a,0x20,0x39,0x36,0x20,0x2b,0x20,0x33,0x32,0x29,0x29,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x5f,0x37,0x35,0x2e,0x62,0x61,0x73,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
|
|
0x20,0x3d,0x20,0x61,0x73,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x36,0x30,0x2e,0x4c,
|
|
0x6f,0x61,0x64,0x34,0x28,0x28,0x5f,0x36,0x35,0x5f,0x69,0x6e,0x73,0x74,0x5f,0x62,
|
|
0x61,0x73,0x65,0x2e,0x78,0x20,0x2b,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,
|
|
0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x2a,0x20,0x39,0x36,0x20,0x2b,
|
|
0x20,0x34,0x38,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x37,0x35,0x2e,0x73,
|
|
0x63,0x61,0x6c,0x65,0x20,0x3d,0x20,0x61,0x73,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,
|
|
0x36,0x30,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,0x28,0x5f,0x36,0x35,0x5f,0x69,0x6e,
|
|
0x73,0x74,0x5f,0x62,0x61,0x73,0x65,0x2e,0x78,0x20,0x2b,0x20,0x67,0x6c,0x5f,0x49,
|
|
0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x2a,0x20,
|
|
0x39,0x36,0x20,0x2b,0x20,0x36,0x34,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,
|
|
0x37,0x35,0x2e,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3d,0x20,0x61,0x73,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x36,0x30,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,
|
|
0x28,0x5f,0x36,0x35,0x5f,0x69,0x6e,0x73,0x74,0x5f,0x62,0x61,0x73,0x65,0x2e,0x78,
|
|
0x20,0x2b,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,
|
|
0x64,0x65,0x78,0x29,0x20,0x2a,0x20,0x39,0x36,0x20,0x2b,0x20,0x38,0x30,0x29,0x29,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x39,0x37,0x20,0x3d,0x20,
|
|
0x32,0x20,0x2a,0x20,0x5f,0x31,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x34,0x20,0x5f,0x31,0x33,0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x34,0x28,0x61,0x73,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x39,0x35,0x2e,0x4c,0x6f,
|
|
0x61,0x64,0x34,0x28,0x5f,0x39,0x37,0x20,0x2a,0x20,0x31,0x36,0x20,0x2b,0x20,0x30,
|
|
0x29,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x73,0x63,0x61,
|
|
0x6c,0x65,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x35,0x37,0x20,0x3d,
|
|
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x61,0x73,0x66,0x6c,0x6f,0x61,0x74,0x28,
|
|
0x5f,0x39,0x35,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,0x28,0x5f,0x39,0x37,0x20,0x2b,
|
|
0x20,0x31,0x29,0x20,0x2a,0x20,0x31,0x36,0x20,0x2b,0x20,0x30,0x29,0x29,0x2e,0x78,
|
|
0x79,0x7a,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x73,0x63,0x61,0x6c,0x65,0x2e,0x78,
|
|
0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x38,0x39,0x20,0x3d,0x20,0x6d,0x75,0x6c,
|
|
0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x64,0x6f,0x74,0x28,0x5f,0x37,0x35,0x2e,
|
|
0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x30,0x2c,0x20,0x5f,0x31,0x33,0x31,
|
|
0x29,0x2c,0x20,0x64,0x6f,0x74,0x28,0x5f,0x37,0x35,0x2e,0x78,0x66,0x6f,0x72,0x6d,
|
|
0x5f,0x72,0x6f,0x77,0x31,0x2c,0x20,0x5f,0x31,0x33,0x31,0x29,0x2c,0x20,0x64,0x6f,
|
|
0x74,0x28,0x5f,0x37,0x35,0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x32,
|
|
0x2c,0x20,0x5f,0x31,0x33,0x31,0x29,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,
|
|
0x5f,0x31,0x38,0x30,0x5f,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,0x29,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x39,0x38,
|
|
0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x64,0x6f,
|
|
0x74,0x28,0x5f,0x37,0x35,0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x30,
|
|
0x2c,0x20,0x5f,0x31,0x35,0x37,0x29,0x2c,0x20,0x64,0x6f,0x74,0x28,0x5f,0x37,0x35,
|
|
0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x31,0x2c,0x20,0x5f,0x31,0x35,
|
|
0x37,0x29,0x2c,0x20,0x64,0x6f,0x74,0x28,0x5f,0x37,0x35,0x2e,0x78,0x66,0x6f,0x72,
|
|
0x6d,0x5f,0x72,0x6f,0x77,0x32,0x2c,0x20,0x5f,0x31,0x35,0x37,0x29,0x2c,0x20,0x31,
|
|
0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x31,0x38,0x30,0x5f,0x76,0x69,0x65,0x77,0x5f,
|
|
0x70,0x72,0x6f,0x6a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x34,
|
|
0x20,0x5f,0x32,0x30,0x34,0x20,0x3d,0x20,0x28,0x28,0x28,0x5f,0x32,0x32,0x20,0x3d,
|
|
0x3d,0x20,0x31,0x29,0x20,0x7c,0x7c,0x20,0x5f,0x33,0x31,0x29,0x20,0x7c,0x7c,0x20,
|
|
0x5f,0x33,0x35,0x29,0x2e,0x78,0x78,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x30,0x35,0x20,0x3d,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x34,0x28,0x5f,0x32,0x30,0x34,0x2e,0x78,0x20,0x3f,0x20,0x5f,0x31,0x39,
|
|
0x38,0x2e,0x78,0x20,0x3a,0x20,0x5f,0x31,0x38,0x39,0x2e,0x78,0x2c,0x20,0x5f,0x32,
|
|
0x30,0x34,0x2e,0x79,0x20,0x3f,0x20,0x5f,0x31,0x39,0x38,0x2e,0x79,0x20,0x3a,0x20,
|
|
0x5f,0x31,0x38,0x39,0x2e,0x79,0x2c,0x20,0x5f,0x32,0x30,0x34,0x2e,0x7a,0x20,0x3f,
|
|
0x20,0x5f,0x31,0x39,0x38,0x2e,0x7a,0x20,0x3a,0x20,0x5f,0x31,0x38,0x39,0x2e,0x7a,
|
|
0x2c,0x20,0x5f,0x32,0x30,0x34,0x2e,0x77,0x20,0x3f,0x20,0x5f,0x31,0x39,0x38,0x2e,
|
|
0x77,0x20,0x3a,0x20,0x5f,0x31,0x38,0x39,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x32,0x34,0x35,0x20,0x3d,0x20,0x28,
|
|
0x28,0x28,0x28,0x5f,0x31,0x39,0x38,0x2e,0x78,0x79,0x20,0x2f,0x20,0x5f,0x31,0x39,
|
|
0x38,0x2e,0x77,0x2e,0x78,0x78,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x66,0x29,0x20,
|
|
0x2b,0x20,0x30,0x2e,0x35,0x66,0x2e,0x78,0x78,0x29,0x20,0x2a,0x20,0x5f,0x31,0x38,
|
|
0x30,0x5f,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,0x2e,0x78,0x79,0x29,0x20,0x2d,
|
|
0x20,0x28,0x28,0x28,0x28,0x5f,0x31,0x38,0x39,0x2e,0x78,0x79,0x20,0x2f,0x20,0x5f,
|
|
0x31,0x38,0x39,0x2e,0x77,0x2e,0x78,0x78,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x66,
|
|
0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x66,0x2e,0x78,0x78,0x29,0x20,0x2a,0x20,0x5f,
|
|
0x31,0x38,0x30,0x5f,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,0x2e,0x78,0x79,0x29,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x38,
|
|
0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x32,0x34,0x35,0x29,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x32,0x35,0x33,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x34,0x38,0x20,0x3e,
|
|
0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x35,0x32,0x34,
|
|
0x32,0x37,0x30,0x37,0x38,0x37,0x38,0x33,0x35,0x31,0x32,0x31,0x31,0x35,0x34,0x37,
|
|
0x38,0x35,0x65,0x2d,0x30,0x37,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x35,0x33,0x20,0x3d,0x20,0x5f,0x32,
|
|
0x34,0x35,0x20,0x2f,0x20,0x5f,0x32,0x34,0x38,0x2e,0x78,0x78,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,0x5f,0x32,0x35,0x33,0x20,
|
|
0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x2e,0x30,0x66,0x2c,0x20,0x30,
|
|
0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x37,0x37,0x20,0x3d,0x20,0x6d,0x61,0x78,
|
|
0x28,0x5f,0x36,0x35,0x5f,0x65,0x64,0x67,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
|
|
0x2e,0x78,0x20,0x2a,0x20,0x30,0x2e,0x35,0x66,0x2c,0x20,0x30,0x2e,0x35,0x66,0x29,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x38,0x31,
|
|
0x20,0x3d,0x20,0x5f,0x32,0x37,0x37,0x20,0x2b,0x20,0x31,0x2e,0x35,0x66,0x3b,0x0a,
|
|
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x30,0x30,0x20,0x3d,
|
|
0x20,0x5f,0x32,0x30,0x35,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x32,0x20,0x5f,0x33,0x30,0x34,0x20,0x3d,0x20,0x5f,0x32,0x30,0x35,0x2e,
|
|
0x78,0x79,0x20,0x2b,0x20,0x28,0x28,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,
|
|
0x2d,0x5f,0x32,0x35,0x33,0x2e,0x79,0x2c,0x20,0x5f,0x32,0x35,0x33,0x2e,0x78,0x29,
|
|
0x20,0x2a,0x20,0x5f,0x35,0x31,0x29,0x20,0x2a,0x20,0x5f,0x32,0x38,0x31,0x29,0x20,
|
|
0x2a,0x20,0x28,0x5f,0x31,0x38,0x30,0x5f,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,
|
|
0x2e,0x7a,0x77,0x20,0x2a,0x20,0x32,0x2e,0x30,0x66,0x29,0x29,0x20,0x2a,0x20,0x5f,
|
|
0x33,0x30,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
|
0x20,0x5f,0x33,0x34,0x38,0x20,0x3d,0x20,0x5f,0x32,0x30,0x35,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x5f,0x33,0x34,0x38,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x33,0x30,0x34,0x2e,
|
|
0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x33,0x34,0x38,0x2e,0x79,0x20,0x3d,0x20,
|
|
0x5f,0x33,0x30,0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x33,0x34,0x38,
|
|
0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x35,0x2e,0x7a,0x20,0x2b,0x20,0x28,0x5f,
|
|
0x36,0x35,0x5f,0x65,0x64,0x67,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x79,
|
|
0x20,0x2a,0x20,0x5f,0x33,0x30,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,
|
|
0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x33,0x34,0x38,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,
|
|
0x6d,0x5f,0x61,0x78,0x69,0x73,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x35,0x31,0x20,
|
|
0x2a,0x20,0x5f,0x32,0x38,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x68,0x61,
|
|
0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x32,
|
|
0x37,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x3d,
|
|
0x20,0x61,0x73,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x39,0x35,0x2e,0x4c,0x6f,0x61,
|
|
0x64,0x34,0x28,0x5f,0x39,0x37,0x20,0x2a,0x20,0x31,0x36,0x20,0x2b,0x20,0x30,0x29,
|
|
0x29,0x2e,0x77,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,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,
|
|
0x64,0x65,0x78,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x73,0x74,0x61,0x67,0x65,0x5f,
|
|
0x69,0x6e,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,
|
|
0x6e,0x64,0x65,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x49,0x6e,
|
|
0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x69,0x6e,
|
|
0x74,0x28,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x67,0x6c,
|
|
0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,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,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,
|
|
0x61,0x78,0x69,0x73,0x5f,0x70,0x78,0x20,0x3d,0x20,0x76,0x5f,0x64,0x69,0x73,0x74,
|
|
0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,0x73,0x5f,0x70,0x78,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,
|
|
0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x20,
|
|
0x3d,0x20,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,
|
|
0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,
|
|
0x70,0x75,0x74,0x2e,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x3d,0x20,0x76,0x5f,0x66,
|
|
0x6c,0x61,0x67,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,
|
|
0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,
|
|
0x00,
|
|
};
|
|
/*
|
|
cbuffer ub_pass : register(b1)
|
|
{
|
|
float4 _40_convex_color : packoffset(c0);
|
|
float4 _40_concave_color : packoffset(c1);
|
|
float4 _40_flat_color : packoffset(c2);
|
|
};
|
|
|
|
|
|
static float v_dist_from_axis_px;
|
|
static float v_half_width_px;
|
|
static float v_flag;
|
|
static float4 out_color;
|
|
|
|
struct SPIRV_Cross_Input
|
|
{
|
|
noperspective float v_dist_from_axis_px : TEXCOORD0;
|
|
nointerpolation float v_half_width_px : TEXCOORD1;
|
|
nointerpolation float v_flag : TEXCOORD2;
|
|
};
|
|
|
|
struct SPIRV_Cross_Output
|
|
{
|
|
float4 out_color : SV_Target0;
|
|
};
|
|
|
|
void frag_main()
|
|
{
|
|
float _15 = fwidth(v_dist_from_axis_px);
|
|
float4 col;
|
|
if (v_flag > 1.5f)
|
|
{
|
|
col = _40_flat_color;
|
|
}
|
|
else
|
|
{
|
|
if (v_flag > 0.5f)
|
|
{
|
|
col = _40_convex_color;
|
|
}
|
|
else
|
|
{
|
|
col = _40_concave_color;
|
|
}
|
|
}
|
|
out_color = col * (1.0f - smoothstep(v_half_width_px - _15, v_half_width_px + _15, abs(v_dist_from_axis_px)));
|
|
}
|
|
|
|
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
|
{
|
|
v_dist_from_axis_px = stage_input.v_dist_from_axis_px;
|
|
v_half_width_px = stage_input.v_half_width_px;
|
|
v_flag = stage_input.v_flag;
|
|
frag_main();
|
|
SPIRV_Cross_Output stage_output;
|
|
stage_output.out_color = out_color;
|
|
return stage_output;
|
|
}
|
|
*/
|
|
static const uint8_t edge_fs_source_hlsl5[1301] = {
|
|
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x75,0x62,0x5f,0x70,0x61,0x73,0x73,0x20,
|
|
0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x31,0x29,0x0a,0x7b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x34,0x30,0x5f,
|
|
0x63,0x6f,0x6e,0x76,0x65,0x78,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x70,
|
|
0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x34,0x30,0x5f,0x63,0x6f,
|
|
0x6e,0x63,0x61,0x76,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x70,0x61,
|
|
0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x31,0x29,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x34,0x30,0x5f,0x66,0x6c,0x61,
|
|
0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,
|
|
0x66,0x73,0x65,0x74,0x28,0x63,0x32,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x0a,0x73,
|
|
0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x64,0x69,
|
|
0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,0x73,0x5f,0x70,0x78,0x3b,
|
|
0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,
|
|
0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x3b,0x0a,0x73,
|
|
0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x66,0x6c,
|
|
0x61,0x67,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x34,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x73,0x74,
|
|
0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,
|
|
0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x70,
|
|
0x65,0x72,0x73,0x70,0x65,0x63,0x74,0x69,0x76,0x65,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x20,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,
|
|
0x73,0x5f,0x70,0x78,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x69,0x6e,0x74,0x65,0x72,0x70,0x6f,0x6c,
|
|
0x61,0x74,0x69,0x6f,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x68,0x61,
|
|
0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x20,0x3a,0x20,0x54,0x45,
|
|
0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x69,
|
|
0x6e,0x74,0x65,0x72,0x70,0x6f,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x20,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,
|
|
0x4f,0x4f,0x52,0x44,0x32,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,
|
|
0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,
|
|
0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x34,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x53,0x56,
|
|
0x5f,0x54,0x61,0x72,0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x6f,
|
|
0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x20,0x3d,
|
|
0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,
|
|
0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,0x73,0x5f,0x70,0x78,0x29,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x69,0x66,0x20,0x28,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x3e,0x20,0x31,
|
|
0x2e,0x35,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,
|
|
0x20,0x20,0x20,0x63,0x6f,0x6c,0x20,0x3d,0x20,0x5f,0x34,0x30,0x5f,0x66,0x6c,0x61,
|
|
0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,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,0x76,0x5f,0x66,0x6c,0x61,0x67,
|
|
0x20,0x3e,0x20,0x30,0x2e,0x35,0x66,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
|
|
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,
|
|
0x6f,0x6c,0x20,0x3d,0x20,0x5f,0x34,0x30,0x5f,0x63,0x6f,0x6e,0x76,0x65,0x78,0x5f,
|
|
0x63,0x6f,0x6c,0x6f,0x72,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,0x63,0x6f,0x6c,0x20,0x3d,0x20,0x5f,0x34,0x30,0x5f,0x63,0x6f,
|
|
0x6e,0x63,0x61,0x76,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,
|
|
0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,
|
|
0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f,0x74,
|
|
0x68,0x73,0x74,0x65,0x70,0x28,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,
|
|
0x74,0x68,0x5f,0x70,0x78,0x20,0x2d,0x20,0x5f,0x31,0x35,0x2c,0x20,0x76,0x5f,0x68,
|
|
0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x20,0x2b,0x20,0x5f,
|
|
0x31,0x35,0x2c,0x20,0x61,0x62,0x73,0x28,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,
|
|
0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,0x73,0x5f,0x70,0x78,0x29,0x29,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,
|
|
0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,0x73,
|
|
0x5f,0x70,0x78,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,
|
|
0x74,0x2e,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,
|
|
0x69,0x73,0x5f,0x70,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x68,0x61,0x6c,
|
|
0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x20,0x3d,0x20,0x73,0x74,0x61,
|
|
0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,
|
|
0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,
|
|
0x66,0x6c,0x61,0x67,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,
|
|
0x75,0x74,0x2e,0x76,0x5f,0x66,0x6c,0x61,0x67,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,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6f,0x75,
|
|
0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,
|
|
0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,
|
|
0x3b,0x0a,0x7d,0x0a,0x00,
|
|
};
|
|
/*
|
|
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
|
|
|
struct geom_instance
|
|
{
|
|
float4 xform_row0;
|
|
float4 xform_row1;
|
|
float4 xform_row2;
|
|
float4 base_color;
|
|
float4 scale;
|
|
float4 material;
|
|
};
|
|
|
|
struct geom_instances
|
|
{
|
|
geom_instance gi_items[1];
|
|
};
|
|
|
|
struct ub_draw
|
|
{
|
|
int4 inst_base;
|
|
float4 edge_params;
|
|
};
|
|
|
|
struct edge_endpoint
|
|
{
|
|
float4 pos_and_flag;
|
|
};
|
|
|
|
struct edge_endpoints
|
|
{
|
|
edge_endpoint ee_items[1];
|
|
};
|
|
|
|
struct ub_frame
|
|
{
|
|
float4x4 view_proj;
|
|
float4 viewport;
|
|
};
|
|
|
|
struct main0_out
|
|
{
|
|
float v_dist_from_axis_px [[user(locn0)]];
|
|
float v_half_width_px [[user(locn1)]];
|
|
float v_flag [[user(locn2)]];
|
|
float4 gl_Position [[position]];
|
|
};
|
|
|
|
vertex main0_out main0(constant ub_frame& _180 [[buffer(0)]], constant ub_draw& _65 [[buffer(2)]], const device geom_instances& _60 [[buffer(8)]], const device edge_endpoints& _95 [[buffer(9)]], uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]])
|
|
{
|
|
main0_out out = {};
|
|
int _16 = int(uint(int(gl_VertexIndex)) / 6u);
|
|
int _22 = int(gl_VertexIndex) - (_16 * 6);
|
|
bool _31 = _22 == 2;
|
|
bool _35 = _22 == 4;
|
|
float _51 = ((_31 || _35) || (_22 == 5)) ? 1.0 : (-1.0);
|
|
int _72 = _65.inst_base.x + int(gl_InstanceIndex);
|
|
int _97 = 2 * _16;
|
|
float4 _131 = float4(_95.ee_items[_97].pos_and_flag.xyz * _60.gi_items[_72].scale.xyz, 1.0);
|
|
float4 _157 = float4(_95.ee_items[_97 + 1].pos_and_flag.xyz * _60.gi_items[_72].scale.xyz, 1.0);
|
|
float4 _189 = _180.view_proj * float4(dot(_60.gi_items[_72].xform_row0, _131), dot(_60.gi_items[_72].xform_row1, _131), dot(_60.gi_items[_72].xform_row2, _131), 1.0);
|
|
float4 _198 = _180.view_proj * float4(dot(_60.gi_items[_72].xform_row0, _157), dot(_60.gi_items[_72].xform_row1, _157), dot(_60.gi_items[_72].xform_row2, _157), 1.0);
|
|
float4 _205 = select(_189, _198, bool4(((_22 == 1) || _31) || _35));
|
|
float2 _245 = ((((_198.xy / float2(_198.w)) * 0.5) + float2(0.5)) * _180.viewport.xy) - ((((_189.xy / float2(_189.w)) * 0.5) + float2(0.5)) * _180.viewport.xy);
|
|
float _248 = length(_245);
|
|
float2 _253;
|
|
if (_248 > 9.9999999747524270787835121154785e-07)
|
|
{
|
|
_253 = _245 / float2(_248);
|
|
}
|
|
else
|
|
{
|
|
_253 = float2(1.0, 0.0);
|
|
}
|
|
float _277 = fast::max(_65.edge_params.x * 0.5, 0.5);
|
|
float _281 = _277 + 1.5;
|
|
float _300 = _205.w;
|
|
float2 _304 = _205.xy + ((((float2(-_253.y, _253.x) * _51) * _281) * (_180.viewport.zw * 2.0)) * _300);
|
|
float4 _348 = _205;
|
|
_348.x = _304.x;
|
|
_348.y = _304.y;
|
|
_348.z = _205.z + (_65.edge_params.y * _300);
|
|
out.gl_Position = _348;
|
|
out.v_dist_from_axis_px = _51 * _281;
|
|
out.v_half_width_px = _277;
|
|
out.v_flag = _95.ee_items[_97].pos_and_flag.w;
|
|
return out;
|
|
}
|
|
|
|
*/
|
|
static const uint8_t edge_vs_source_metal_macos[2789] = {
|
|
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
|
|
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
|
|
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
|
|
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
|
|
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x67,
|
|
0x65,0x6f,0x6d,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x0a,0x7b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x78,0x66,0x6f,0x72,0x6d,0x5f,
|
|
0x72,0x6f,0x77,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
|
0x20,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x31,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,
|
|
0x77,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x62,
|
|
0x61,0x73,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x63,0x61,0x6c,0x65,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,
|
|
0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x67,0x65,0x6f,
|
|
0x6d,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x0a,0x7b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x67,0x65,0x6f,0x6d,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x20,
|
|
0x67,0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x31,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,
|
|
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x75,0x62,0x5f,0x64,0x72,0x61,0x77,0x0a,
|
|
0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x34,0x20,0x69,0x6e,0x73,0x74,0x5f,
|
|
0x62,0x61,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
|
0x20,0x65,0x64,0x67,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x7d,0x3b,
|
|
0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x65,0x64,0x67,0x65,0x5f,0x65,0x6e,
|
|
0x64,0x70,0x6f,0x69,0x6e,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x34,0x20,0x70,0x6f,0x73,0x5f,0x61,0x6e,0x64,0x5f,0x66,0x6c,0x61,0x67,
|
|
0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x65,0x64,0x67,
|
|
0x65,0x5f,0x65,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74,0x73,0x0a,0x7b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x65,0x64,0x67,0x65,0x5f,0x65,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74,0x20,
|
|
0x65,0x65,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x31,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,
|
|
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,
|
|
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,
|
|
0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,0x3b,0x0a,
|
|
0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,
|
|
0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x20,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,
|
|
0x73,0x5f,0x70,0x78,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,
|
|
0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,
|
|
0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x20,
|
|
0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x66,0x6c,0x61,
|
|
0x67,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,
|
|
0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,
|
|
0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,
|
|
0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,
|
|
0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,
|
|
0x6e,0x30,0x28,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x75,0x62,0x5f,0x66,
|
|
0x72,0x61,0x6d,0x65,0x26,0x20,0x5f,0x31,0x38,0x30,0x20,0x5b,0x5b,0x62,0x75,0x66,
|
|
0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,
|
|
0x6e,0x74,0x20,0x75,0x62,0x5f,0x64,0x72,0x61,0x77,0x26,0x20,0x5f,0x36,0x35,0x20,
|
|
0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x32,0x29,0x5d,0x5d,0x2c,0x20,0x63,
|
|
0x6f,0x6e,0x73,0x74,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20,0x67,0x65,0x6f,0x6d,
|
|
0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x26,0x20,0x5f,0x36,0x30,0x20,
|
|
0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x38,0x29,0x5d,0x5d,0x2c,0x20,0x63,
|
|
0x6f,0x6e,0x73,0x74,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20,0x65,0x64,0x67,0x65,
|
|
0x5f,0x65,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74,0x73,0x26,0x20,0x5f,0x39,0x35,0x20,
|
|
0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x39,0x29,0x5d,0x5d,0x2c,0x20,0x75,
|
|
0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,
|
|
0x65,0x78,0x20,0x5b,0x5b,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x69,0x64,0x5d,0x5d,
|
|
0x2c,0x20,0x75,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,
|
|
0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x5b,0x5b,0x69,0x6e,0x73,0x74,0x61,0x6e,
|
|
0x63,0x65,0x5f,0x69,0x64,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,0x69,0x6e,0x74,0x20,0x5f,0x31,0x36,0x20,0x3d,
|
|
0x20,0x69,0x6e,0x74,0x28,0x75,0x69,0x6e,0x74,0x28,0x69,0x6e,0x74,0x28,0x67,0x6c,
|
|
0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x29,0x20,0x2f,
|
|
0x20,0x36,0x75,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,
|
|
0x32,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,
|
|
0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x2d,0x20,0x28,0x5f,0x31,0x36,0x20,0x2a,
|
|
0x20,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,
|
|
0x31,0x20,0x3d,0x20,0x5f,0x32,0x32,0x20,0x3d,0x3d,0x20,0x32,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x35,0x20,0x3d,0x20,0x5f,0x32,0x32,
|
|
0x20,0x3d,0x3d,0x20,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x20,0x5f,0x35,0x31,0x20,0x3d,0x20,0x28,0x28,0x5f,0x33,0x31,0x20,0x7c,0x7c,0x20,
|
|
0x5f,0x33,0x35,0x29,0x20,0x7c,0x7c,0x20,0x28,0x5f,0x32,0x32,0x20,0x3d,0x3d,0x20,
|
|
0x35,0x29,0x29,0x20,0x3f,0x20,0x31,0x2e,0x30,0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,
|
|
0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x37,0x32,0x20,
|
|
0x3d,0x20,0x5f,0x36,0x35,0x2e,0x69,0x6e,0x73,0x74,0x5f,0x62,0x61,0x73,0x65,0x2e,
|
|
0x78,0x20,0x2b,0x20,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,
|
|
0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,
|
|
0x6e,0x74,0x20,0x5f,0x39,0x37,0x20,0x3d,0x20,0x32,0x20,0x2a,0x20,0x5f,0x31,0x36,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x33,
|
|
0x31,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x39,0x35,0x2e,0x65,
|
|
0x65,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x39,0x37,0x5d,0x2e,0x70,0x6f,0x73,
|
|
0x5f,0x61,0x6e,0x64,0x5f,0x66,0x6c,0x61,0x67,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,
|
|
0x5f,0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,0x32,
|
|
0x5d,0x2e,0x73,0x63,0x61,0x6c,0x65,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,
|
|
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,
|
|
0x35,0x37,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x39,0x35,0x2e,
|
|
0x65,0x65,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x39,0x37,0x20,0x2b,0x20,0x31,
|
|
0x5d,0x2e,0x70,0x6f,0x73,0x5f,0x61,0x6e,0x64,0x5f,0x66,0x6c,0x61,0x67,0x2e,0x78,
|
|
0x79,0x7a,0x20,0x2a,0x20,0x5f,0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,0x74,0x65,0x6d,
|
|
0x73,0x5b,0x5f,0x37,0x32,0x5d,0x2e,0x73,0x63,0x61,0x6c,0x65,0x2e,0x78,0x79,0x7a,
|
|
0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
|
0x74,0x34,0x20,0x5f,0x31,0x38,0x39,0x20,0x3d,0x20,0x5f,0x31,0x38,0x30,0x2e,0x76,
|
|
0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x34,0x28,0x64,0x6f,0x74,0x28,0x5f,0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,0x74,0x65,
|
|
0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,
|
|
0x77,0x30,0x2c,0x20,0x5f,0x31,0x33,0x31,0x29,0x2c,0x20,0x64,0x6f,0x74,0x28,0x5f,
|
|
0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,
|
|
0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x31,0x2c,0x20,0x5f,0x31,0x33,
|
|
0x31,0x29,0x2c,0x20,0x64,0x6f,0x74,0x28,0x5f,0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,
|
|
0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,
|
|
0x72,0x6f,0x77,0x32,0x2c,0x20,0x5f,0x31,0x33,0x31,0x29,0x2c,0x20,0x31,0x2e,0x30,
|
|
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,
|
|
0x39,0x38,0x20,0x3d,0x20,0x5f,0x31,0x38,0x30,0x2e,0x76,0x69,0x65,0x77,0x5f,0x70,
|
|
0x72,0x6f,0x6a,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x64,0x6f,0x74,
|
|
0x28,0x5f,0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,
|
|
0x32,0x5d,0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x30,0x2c,0x20,0x5f,
|
|
0x31,0x35,0x37,0x29,0x2c,0x20,0x64,0x6f,0x74,0x28,0x5f,0x36,0x30,0x2e,0x67,0x69,
|
|
0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x37,0x32,0x5d,0x2e,0x78,0x66,0x6f,0x72,
|
|
0x6d,0x5f,0x72,0x6f,0x77,0x31,0x2c,0x20,0x5f,0x31,0x35,0x37,0x29,0x2c,0x20,0x64,
|
|
0x6f,0x74,0x28,0x5f,0x36,0x30,0x2e,0x67,0x69,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,
|
|
0x5f,0x37,0x32,0x5d,0x2e,0x78,0x66,0x6f,0x72,0x6d,0x5f,0x72,0x6f,0x77,0x32,0x2c,
|
|
0x20,0x5f,0x31,0x35,0x37,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x30,0x35,0x20,0x3d,0x20,
|
|
0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x5f,0x31,0x38,0x39,0x2c,0x20,0x5f,0x31,0x39,
|
|
0x38,0x2c,0x20,0x62,0x6f,0x6f,0x6c,0x34,0x28,0x28,0x28,0x5f,0x32,0x32,0x20,0x3d,
|
|
0x3d,0x20,0x31,0x29,0x20,0x7c,0x7c,0x20,0x5f,0x33,0x31,0x29,0x20,0x7c,0x7c,0x20,
|
|
0x5f,0x33,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x32,0x20,0x5f,0x32,0x34,0x35,0x20,0x3d,0x20,0x28,0x28,0x28,0x28,0x5f,0x31,0x39,
|
|
0x38,0x2e,0x78,0x79,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x5f,0x31,
|
|
0x39,0x38,0x2e,0x77,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x5f,
|
|
0x31,0x38,0x30,0x2e,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,0x2e,0x78,0x79,0x29,
|
|
0x20,0x2d,0x20,0x28,0x28,0x28,0x28,0x5f,0x31,0x38,0x39,0x2e,0x78,0x79,0x20,0x2f,
|
|
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x5f,0x31,0x38,0x39,0x2e,0x77,0x29,0x29,
|
|
0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,
|
|
0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x5f,0x31,0x38,0x30,0x2e,0x76,0x69,
|
|
0x65,0x77,0x70,0x6f,0x72,0x74,0x2e,0x78,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x38,0x20,0x3d,0x20,0x6c,0x65,0x6e,
|
|
0x67,0x74,0x68,0x28,0x5f,0x32,0x34,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x32,0x35,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x69,0x66,0x20,0x28,0x5f,0x32,0x34,0x38,0x20,0x3e,0x20,0x39,0x2e,0x39,0x39,0x39,
|
|
0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x35,0x32,0x34,0x32,0x37,0x30,0x37,0x38,0x37,
|
|
0x38,0x33,0x35,0x31,0x32,0x31,0x31,0x35,0x34,0x37,0x38,0x35,0x65,0x2d,0x30,0x37,
|
|
0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
|
|
0x5f,0x32,0x35,0x33,0x20,0x3d,0x20,0x5f,0x32,0x34,0x35,0x20,0x2f,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x32,0x28,0x5f,0x32,0x34,0x38,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,0x5f,0x32,0x35,0x33,0x20,0x3d,0x20,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
|
0x74,0x20,0x5f,0x32,0x37,0x37,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,
|
|
0x61,0x78,0x28,0x5f,0x36,0x35,0x2e,0x65,0x64,0x67,0x65,0x5f,0x70,0x61,0x72,0x61,
|
|
0x6d,0x73,0x2e,0x78,0x20,0x2a,0x20,0x30,0x2e,0x35,0x2c,0x20,0x30,0x2e,0x35,0x29,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x38,0x31,
|
|
0x20,0x3d,0x20,0x5f,0x32,0x37,0x37,0x20,0x2b,0x20,0x31,0x2e,0x35,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x30,0x30,0x20,0x3d,0x20,
|
|
0x5f,0x32,0x30,0x35,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
|
0x74,0x32,0x20,0x5f,0x33,0x30,0x34,0x20,0x3d,0x20,0x5f,0x32,0x30,0x35,0x2e,0x78,
|
|
0x79,0x20,0x2b,0x20,0x28,0x28,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x2d,
|
|
0x5f,0x32,0x35,0x33,0x2e,0x79,0x2c,0x20,0x5f,0x32,0x35,0x33,0x2e,0x78,0x29,0x20,
|
|
0x2a,0x20,0x5f,0x35,0x31,0x29,0x20,0x2a,0x20,0x5f,0x32,0x38,0x31,0x29,0x20,0x2a,
|
|
0x20,0x28,0x5f,0x31,0x38,0x30,0x2e,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,0x2e,
|
|
0x7a,0x77,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x33,0x30,
|
|
0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,
|
|
0x33,0x34,0x38,0x20,0x3d,0x20,0x5f,0x32,0x30,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x5f,0x33,0x34,0x38,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x33,0x30,0x34,0x2e,0x78,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x5f,0x33,0x34,0x38,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x33,
|
|
0x30,0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x33,0x34,0x38,0x2e,0x7a,
|
|
0x20,0x3d,0x20,0x5f,0x32,0x30,0x35,0x2e,0x7a,0x20,0x2b,0x20,0x28,0x5f,0x36,0x35,
|
|
0x2e,0x65,0x64,0x67,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x79,0x20,0x2a,
|
|
0x20,0x5f,0x33,0x30,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,
|
|
0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x33,
|
|
0x34,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x64,0x69,
|
|
0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,0x73,0x5f,0x70,0x78,0x20,
|
|
0x3d,0x20,0x5f,0x35,0x31,0x20,0x2a,0x20,0x5f,0x32,0x38,0x31,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,
|
|
0x74,0x68,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x32,0x37,0x37,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x3d,0x20,0x5f,
|
|
0x39,0x35,0x2e,0x65,0x65,0x5f,0x69,0x74,0x65,0x6d,0x73,0x5b,0x5f,0x39,0x37,0x5d,
|
|
0x2e,0x70,0x6f,0x73,0x5f,0x61,0x6e,0x64,0x5f,0x66,0x6c,0x61,0x67,0x2e,0x77,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,
|
|
0x0a,0x7d,0x0a,0x0a,0x00,
|
|
};
|
|
/*
|
|
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
|
|
using namespace metal;
|
|
|
|
struct ub_pass
|
|
{
|
|
float4 convex_color;
|
|
float4 concave_color;
|
|
float4 flat_color;
|
|
};
|
|
|
|
struct main0_out
|
|
{
|
|
float4 out_color [[color(0)]];
|
|
};
|
|
|
|
struct main0_in
|
|
{
|
|
float v_dist_from_axis_px [[user(locn0), center_no_perspective]];
|
|
float v_half_width_px [[user(locn1), flat]];
|
|
float v_flag [[user(locn2), flat]];
|
|
};
|
|
|
|
fragment main0_out main0(main0_in in [[stage_in]], constant ub_pass& _40 [[buffer(1)]])
|
|
{
|
|
main0_out out = {};
|
|
float _15 = fwidth(in.v_dist_from_axis_px);
|
|
float4 col;
|
|
if (in.v_flag > 1.5)
|
|
{
|
|
col = _40.flat_color;
|
|
}
|
|
else
|
|
{
|
|
if (in.v_flag > 0.5)
|
|
{
|
|
col = _40.convex_color;
|
|
}
|
|
else
|
|
{
|
|
col = _40.concave_color;
|
|
}
|
|
}
|
|
out.out_color = col * (1.0 - smoothstep(in.v_half_width_px - _15, in.v_half_width_px + _15, abs(in.v_dist_from_axis_px)));
|
|
return out;
|
|
}
|
|
|
|
*/
|
|
static const uint8_t edge_fs_source_metal_macos[974] = {
|
|
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,0x75,
|
|
0x62,0x5f,0x70,0x61,0x73,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x34,0x20,0x63,0x6f,0x6e,0x76,0x65,0x78,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6e,
|
|
0x63,0x61,0x76,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x6c,0x61,0x74,0x5f,0x63,0x6f,0x6c,0x6f,
|
|
0x72,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,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,
|
|
0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,
|
|
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,
|
|
0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x64,
|
|
0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,0x69,0x73,0x5f,0x70,0x78,
|
|
0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x2c,0x20,
|
|
0x63,0x65,0x6e,0x74,0x65,0x72,0x5f,0x6e,0x6f,0x5f,0x70,0x65,0x72,0x73,0x70,0x65,
|
|
0x63,0x74,0x69,0x76,0x65,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x20,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,
|
|
0x70,0x78,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,
|
|
0x2c,0x20,0x66,0x6c,0x61,0x74,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x20,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x5b,0x5b,0x75,0x73,0x65,
|
|
0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x2c,0x20,0x66,0x6c,0x61,0x74,0x5d,0x5d,
|
|
0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,
|
|
0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,
|
|
0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,
|
|
0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,
|
|
0x74,0x20,0x75,0x62,0x5f,0x70,0x61,0x73,0x73,0x26,0x20,0x5f,0x34,0x30,0x20,0x5b,
|
|
0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x31,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,0x35,0x20,0x3d,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x69,
|
|
0x6e,0x2e,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,
|
|
0x69,0x73,0x5f,0x70,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
|
0x74,0x34,0x20,0x63,0x6f,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,
|
|
0x69,0x6e,0x2e,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,0x3e,0x20,0x31,0x2e,0x35,0x29,
|
|
0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,
|
|
0x6f,0x6c,0x20,0x3d,0x20,0x5f,0x34,0x30,0x2e,0x66,0x6c,0x61,0x74,0x5f,0x63,0x6f,
|
|
0x6c,0x6f,0x72,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,0x69,0x6e,0x2e,0x76,0x5f,0x66,0x6c,0x61,0x67,0x20,
|
|
0x3e,0x20,0x30,0x2e,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,
|
|
0x20,0x3d,0x20,0x5f,0x34,0x30,0x2e,0x63,0x6f,0x6e,0x76,0x65,0x78,0x5f,0x63,0x6f,
|
|
0x6c,0x6f,0x72,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,0x63,0x6f,0x6c,0x20,0x3d,0x20,0x5f,0x34,0x30,0x2e,0x63,0x6f,0x6e,0x63,
|
|
0x61,0x76,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,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,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,
|
|
0x6f,0x6c,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x73,0x6d,0x6f,0x6f,
|
|
0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x69,0x6e,0x2e,0x76,0x5f,0x68,0x61,0x6c,0x66,
|
|
0x5f,0x77,0x69,0x64,0x74,0x68,0x5f,0x70,0x78,0x20,0x2d,0x20,0x5f,0x31,0x35,0x2c,
|
|
0x20,0x69,0x6e,0x2e,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x77,0x69,0x64,0x74,0x68,
|
|
0x5f,0x70,0x78,0x20,0x2b,0x20,0x5f,0x31,0x35,0x2c,0x20,0x61,0x62,0x73,0x28,0x69,
|
|
0x6e,0x2e,0x76,0x5f,0x64,0x69,0x73,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x61,0x78,
|
|
0x69,0x73,0x5f,0x70,0x78,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,
|
|
0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
|
};
|
|
static inline const sg_shader_desc* edge_edge_overlay_shader_desc(sg_backend backend) {
|
|
if (backend == SG_BACKEND_GLCORE) {
|
|
static sg_shader_desc desc;
|
|
static bool valid;
|
|
if (!valid) {
|
|
valid = true;
|
|
desc.vertex_func.source = (const char*)edge_vs_source_glsl430;
|
|
desc.vertex_func.entry = "main";
|
|
desc.fragment_func.source = (const char*)edge_fs_source_glsl430;
|
|
desc.fragment_func.entry = "main";
|
|
desc.uniform_blocks[0].stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140;
|
|
desc.uniform_blocks[0].size = 80;
|
|
desc.uniform_blocks[0].glsl_uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
|
|
desc.uniform_blocks[0].glsl_uniforms[0].array_count = 5;
|
|
desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "ub_frame";
|
|
desc.uniform_blocks[1].stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.uniform_blocks[1].layout = SG_UNIFORMLAYOUT_STD140;
|
|
desc.uniform_blocks[1].size = 48;
|
|
desc.uniform_blocks[1].glsl_uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
|
|
desc.uniform_blocks[1].glsl_uniforms[0].array_count = 3;
|
|
desc.uniform_blocks[1].glsl_uniforms[0].glsl_name = "ub_pass";
|
|
desc.uniform_blocks[2].stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.uniform_blocks[2].layout = SG_UNIFORMLAYOUT_STD140;
|
|
desc.uniform_blocks[2].size = 32;
|
|
desc.uniform_blocks[2].glsl_uniforms[0].type = SG_UNIFORMTYPE_INT4;
|
|
desc.uniform_blocks[2].glsl_uniforms[0].array_count = 0;
|
|
desc.uniform_blocks[2].glsl_uniforms[0].glsl_name = "_65.inst_base";
|
|
desc.uniform_blocks[2].glsl_uniforms[1].type = SG_UNIFORMTYPE_FLOAT4;
|
|
desc.uniform_blocks[2].glsl_uniforms[1].array_count = 0;
|
|
desc.uniform_blocks[2].glsl_uniforms[1].glsl_name = "_65.edge_params";
|
|
desc.views[0].storage_buffer.stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.views[0].storage_buffer.readonly = true;
|
|
desc.views[0].storage_buffer.glsl_binding_n = 0;
|
|
desc.views[1].storage_buffer.stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.views[1].storage_buffer.readonly = true;
|
|
desc.views[1].storage_buffer.glsl_binding_n = 1;
|
|
desc.label = "edge_edge_overlay_shader";
|
|
}
|
|
return &desc;
|
|
}
|
|
if (backend == SG_BACKEND_D3D11) {
|
|
static sg_shader_desc desc;
|
|
static bool valid;
|
|
if (!valid) {
|
|
valid = true;
|
|
desc.vertex_func.source = (const char*)edge_vs_source_hlsl5;
|
|
desc.vertex_func.d3d11_target = "vs_5_0";
|
|
desc.vertex_func.entry = "main";
|
|
desc.fragment_func.source = (const char*)edge_fs_source_hlsl5;
|
|
desc.fragment_func.d3d11_target = "ps_5_0";
|
|
desc.fragment_func.entry = "main";
|
|
desc.uniform_blocks[0].stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140;
|
|
desc.uniform_blocks[0].size = 80;
|
|
desc.uniform_blocks[0].hlsl_register_b_n = 0;
|
|
desc.uniform_blocks[1].stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.uniform_blocks[1].layout = SG_UNIFORMLAYOUT_STD140;
|
|
desc.uniform_blocks[1].size = 48;
|
|
desc.uniform_blocks[1].hlsl_register_b_n = 1;
|
|
desc.uniform_blocks[2].stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.uniform_blocks[2].layout = SG_UNIFORMLAYOUT_STD140;
|
|
desc.uniform_blocks[2].size = 32;
|
|
desc.uniform_blocks[2].hlsl_register_b_n = 2;
|
|
desc.views[0].storage_buffer.stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.views[0].storage_buffer.readonly = true;
|
|
desc.views[0].storage_buffer.hlsl_register_t_n = 0;
|
|
desc.views[1].storage_buffer.stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.views[1].storage_buffer.readonly = true;
|
|
desc.views[1].storage_buffer.hlsl_register_t_n = 1;
|
|
desc.label = "edge_edge_overlay_shader";
|
|
}
|
|
return &desc;
|
|
}
|
|
if (backend == SG_BACKEND_METAL_MACOS) {
|
|
static sg_shader_desc desc;
|
|
static bool valid;
|
|
if (!valid) {
|
|
valid = true;
|
|
desc.vertex_func.source = (const char*)edge_vs_source_metal_macos;
|
|
desc.vertex_func.entry = "main0";
|
|
desc.fragment_func.source = (const char*)edge_fs_source_metal_macos;
|
|
desc.fragment_func.entry = "main0";
|
|
desc.uniform_blocks[0].stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140;
|
|
desc.uniform_blocks[0].size = 80;
|
|
desc.uniform_blocks[0].msl_buffer_n = 0;
|
|
desc.uniform_blocks[1].stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.uniform_blocks[1].layout = SG_UNIFORMLAYOUT_STD140;
|
|
desc.uniform_blocks[1].size = 48;
|
|
desc.uniform_blocks[1].msl_buffer_n = 1;
|
|
desc.uniform_blocks[2].stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.uniform_blocks[2].layout = SG_UNIFORMLAYOUT_STD140;
|
|
desc.uniform_blocks[2].size = 32;
|
|
desc.uniform_blocks[2].msl_buffer_n = 2;
|
|
desc.views[0].storage_buffer.stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.views[0].storage_buffer.readonly = true;
|
|
desc.views[0].storage_buffer.msl_buffer_n = 8;
|
|
desc.views[1].storage_buffer.stage = SG_SHADERSTAGE_VERTEX;
|
|
desc.views[1].storage_buffer.readonly = true;
|
|
desc.views[1].storage_buffer.msl_buffer_n = 9;
|
|
desc.label = "edge_edge_overlay_shader";
|
|
}
|
|
return &desc;
|
|
}
|
|
return 0;
|
|
}
|