1203 lines
74 KiB
C++
1203 lines
74 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/overlays/point.glsl --output E:/box/box3d/samples/shaders/generated/overlay_point.glsl.h --slang hlsl5:metal_macos:glsl430
|
|
|
|
Overview:
|
|
=========
|
|
Shader program: 'prog':
|
|
Get shader desc: overlay_point_prog_shader_desc(sg_query_backend());
|
|
Vertex Shader: vs
|
|
Fragment Shader: fs
|
|
Attributes:
|
|
Bindings:
|
|
Uniform block 'ub_frame':
|
|
C struct: overlay_point_ub_frame_t
|
|
Bind slot: UB_overlay_point_ub_frame => 0
|
|
Storage buffer 'point_instances':
|
|
C struct: overlay_point_point_instance_t
|
|
Bind slot: VIEW_overlay_point_point_instances => 0
|
|
Readonly: true
|
|
Texture 'tex_depth':
|
|
Image type: SG_IMAGETYPE_2D
|
|
Sample type: SG_IMAGESAMPLETYPE_FLOAT
|
|
Multisampled: false
|
|
Bind slot: VIEW_overlay_point_tex_depth => 1
|
|
Sampler 'smp_depth':
|
|
Type: SG_SAMPLERTYPE_FILTERING
|
|
Bind slot: SMP_overlay_point_smp_depth => 0
|
|
*/
|
|
#if !defined(SOKOL_GFX_INCLUDED)
|
|
#error "Please include sokol_gfx.h before overlay_point.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_overlay_point_ub_frame (0)
|
|
#define VIEW_overlay_point_point_instances (0)
|
|
#define VIEW_overlay_point_tex_depth (1)
|
|
#define SMP_overlay_point_smp_depth (0)
|
|
#pragma pack(push,1)
|
|
SOKOL_SHDC_ALIGN(16) typedef struct overlay_point_ub_frame_t {
|
|
Mat4 view;
|
|
Mat4 proj;
|
|
Mat4 view_proj;
|
|
Mat4 inv_view_proj;
|
|
Vec4 camera_pos;
|
|
Vec4 viewport;
|
|
} overlay_point_ub_frame_t;
|
|
#pragma pack(pop)
|
|
#pragma pack(push,1)
|
|
SOKOL_SHDC_ALIGN(16) typedef struct overlay_point_point_instance_t {
|
|
Vec4 p;
|
|
Vec4 color;
|
|
uint32_t flags[4];
|
|
} overlay_point_point_instance_t;
|
|
#pragma pack(pop)
|
|
/*
|
|
#version 430
|
|
|
|
struct point_instance
|
|
{
|
|
vec4 p;
|
|
vec4 color;
|
|
uvec4 flags;
|
|
};
|
|
|
|
layout(binding = 0, std430) readonly buffer point_instances
|
|
{
|
|
point_instance instances[];
|
|
} _17;
|
|
|
|
uniform vec4 ub_frame[18];
|
|
layout(location = 0) out vec2 v_offset_from_center_px;
|
|
layout(location = 1) out float v_half_size_px;
|
|
layout(location = 2) out float v_view_z;
|
|
layout(location = 3) flat out vec4 v_color;
|
|
layout(location = 4) flat out uint v_occ_mode;
|
|
|
|
void main()
|
|
{
|
|
bool _46 = gl_VertexID == 2;
|
|
bool _50 = gl_VertexID == 4;
|
|
vec4 _84 = vec4(_17.instances[gl_InstanceID].p.xyz, 1.0);
|
|
vec4 _85 = mat4(ub_frame[8], ub_frame[9], ub_frame[10], ub_frame[11]) * _84;
|
|
vec4 _94 = mat4(ub_frame[0], ub_frame[1], ub_frame[2], ub_frame[3]) * _84;
|
|
float _98 = _94.z;
|
|
float half_size_px;
|
|
if (_17.instances[gl_InstanceID].flags.x == 0u)
|
|
{
|
|
half_size_px = _17.instances[gl_InstanceID].p.w * 0.5;
|
|
}
|
|
else
|
|
{
|
|
half_size_px = (_17.instances[gl_InstanceID].p.w * 0.5) * ((ub_frame[17].y * ub_frame[5].y) / (_98 * (-2.0)));
|
|
}
|
|
float _132 = half_size_px;
|
|
float _133 = max(_132, 0.5);
|
|
half_size_px = _133;
|
|
vec2 _145 = vec2((((gl_VertexID == 1) || _46) || _50) ? 1.0 : (-1.0), ((_46 || _50) || (gl_VertexID == 5)) ? 1.0 : (-1.0)) * (_133 + 1.5);
|
|
vec2 _162 = _85.xy + ((_145 * (ub_frame[17].zw * 2.0)) * _85.w);
|
|
vec4 _200 = _85;
|
|
_200.x = _162.x;
|
|
_200.y = _162.y;
|
|
gl_Position = _200;
|
|
v_offset_from_center_px = _145;
|
|
v_half_size_px = _133;
|
|
v_view_z = -_98;
|
|
v_color = _17.instances[gl_InstanceID].color;
|
|
v_occ_mode = _17.instances[gl_InstanceID].flags.y;
|
|
}
|
|
|
|
*/
|
|
static const uint8_t overlay_point_vs_source_glsl430[1648] = {
|
|
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x73,0x74,
|
|
0x72,0x75,0x63,0x74,0x20,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x69,0x6e,0x73,0x74,0x61,
|
|
0x6e,0x63,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x70,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x65,0x63,0x34,0x20,0x66,0x6c,0x61,0x67,
|
|
0x73,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,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,
|
|
0x65,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x69,
|
|
0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,
|
|
0x73,0x5b,0x5d,0x3b,0x0a,0x7d,0x20,0x5f,0x31,0x37,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,0x31,0x38,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,
|
|
0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,
|
|
0x20,0x76,0x65,0x63,0x32,0x20,0x76,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x66,
|
|
0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,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,0x6f,0x75,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,
|
|
0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,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,0x6f,0x75,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x76,
|
|
0x69,0x65,0x77,0x5f,0x7a,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,
|
|
0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x66,0x6c,0x61,0x74,
|
|
0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,
|
|
0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,
|
|
0x6f,0x6e,0x20,0x3d,0x20,0x34,0x29,0x20,0x66,0x6c,0x61,0x74,0x20,0x6f,0x75,0x74,
|
|
0x20,0x75,0x69,0x6e,0x74,0x20,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,0x6f,0x64,0x65,
|
|
0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x36,0x20,0x3d,0x20,
|
|
0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x20,0x3d,0x3d,0x20,0x32,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x35,0x30,0x20,0x3d,
|
|
0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x20,0x3d,0x3d,0x20,
|
|
0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x38,0x34,0x20,
|
|
0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,
|
|
0x6e,0x63,0x65,0x73,0x5b,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,
|
|
0x49,0x44,0x5d,0x2e,0x70,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x38,0x35,0x20,0x3d,0x20,
|
|
0x6d,0x61,0x74,0x34,0x28,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x38,0x5d,
|
|
0x2c,0x20,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x39,0x5d,0x2c,0x20,0x75,
|
|
0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x31,0x30,0x5d,0x2c,0x20,0x75,0x62,0x5f,
|
|
0x66,0x72,0x61,0x6d,0x65,0x5b,0x31,0x31,0x5d,0x29,0x20,0x2a,0x20,0x5f,0x38,0x34,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x39,0x34,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,0x20,0x2a,0x20,0x5f,0x38,0x34,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x38,0x20,0x3d,
|
|
0x20,0x5f,0x39,0x34,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
|
0x74,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x3b,0x0a,
|
|
0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,
|
|
0x61,0x6e,0x63,0x65,0x73,0x5b,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,
|
|
0x65,0x49,0x44,0x5d,0x2e,0x66,0x6c,0x61,0x67,0x73,0x2e,0x78,0x20,0x3d,0x3d,0x20,
|
|
0x30,0x75,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,
|
|
0x20,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x3d,
|
|
0x20,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x67,
|
|
0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x44,0x5d,0x2e,0x70,0x2e,
|
|
0x77,0x20,0x2a,0x20,0x30,0x2e,0x35,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,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,
|
|
0x70,0x78,0x20,0x3d,0x20,0x28,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,
|
|
0x63,0x65,0x73,0x5b,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,
|
|
0x44,0x5d,0x2e,0x70,0x2e,0x77,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,
|
|
0x28,0x28,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x31,0x37,0x5d,0x2e,0x79,
|
|
0x20,0x2a,0x20,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x35,0x5d,0x2e,0x79,
|
|
0x29,0x20,0x2f,0x20,0x28,0x5f,0x39,0x38,0x20,0x2a,0x20,0x28,0x2d,0x32,0x2e,0x30,
|
|
0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x33,0x32,0x20,0x3d,0x20,0x68,0x61,0x6c,0x66,
|
|
0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x20,0x5f,0x31,0x33,0x33,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x5f,
|
|
0x31,0x33,0x32,0x2c,0x20,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,
|
|
0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x31,
|
|
0x33,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x31,0x34,
|
|
0x35,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x28,0x28,0x28,0x28,0x67,0x6c,0x5f,0x56,
|
|
0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x20,0x3d,0x3d,0x20,0x31,0x29,0x20,0x7c,0x7c,
|
|
0x20,0x5f,0x34,0x36,0x29,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,0x29,0x20,0x3f,0x20,
|
|
0x31,0x2e,0x30,0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x29,0x2c,0x20,0x28,0x28,
|
|
0x5f,0x34,0x36,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,0x29,0x20,0x7c,0x7c,0x20,0x28,
|
|
0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x20,0x3d,0x3d,0x20,0x35,
|
|
0x29,0x29,0x20,0x3f,0x20,0x31,0x2e,0x30,0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,
|
|
0x29,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x33,0x33,0x20,0x2b,0x20,0x31,0x2e,0x35,
|
|
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x31,0x36,0x32,
|
|
0x20,0x3d,0x20,0x5f,0x38,0x35,0x2e,0x78,0x79,0x20,0x2b,0x20,0x28,0x28,0x5f,0x31,
|
|
0x34,0x35,0x20,0x2a,0x20,0x28,0x75,0x62,0x5f,0x66,0x72,0x61,0x6d,0x65,0x5b,0x31,
|
|
0x37,0x5d,0x2e,0x7a,0x77,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,
|
|
0x5f,0x38,0x35,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,
|
|
0x20,0x5f,0x32,0x30,0x30,0x20,0x3d,0x20,0x5f,0x38,0x35,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x5f,0x32,0x30,0x30,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x31,0x36,0x32,0x2e,0x78,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x32,0x30,0x30,0x2e,0x79,0x20,0x3d,0x20,0x5f,
|
|
0x31,0x36,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,
|
|
0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x32,0x30,0x30,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x76,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,
|
|
0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x31,0x34,
|
|
0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,
|
|
0x7a,0x65,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x31,0x33,0x33,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x7a,0x20,0x3d,0x20,0x2d,0x5f,0x39,
|
|
0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,
|
|
0x20,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x67,
|
|
0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x44,0x5d,0x2e,0x63,0x6f,
|
|
0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,
|
|
0x6f,0x64,0x65,0x20,0x3d,0x20,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,
|
|
0x63,0x65,0x73,0x5b,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,
|
|
0x44,0x5d,0x2e,0x66,0x6c,0x61,0x67,0x73,0x2e,0x79,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
|
|
|
};
|
|
/*
|
|
#version 430
|
|
|
|
layout(binding = 0) uniform sampler2D tex_depth_smp_depth;
|
|
|
|
layout(location = 0) in vec2 v_offset_from_center_px;
|
|
layout(location = 1) in float v_half_size_px;
|
|
layout(location = 2) in float v_view_z;
|
|
layout(location = 3) flat in vec4 v_color;
|
|
layout(location = 4) flat in uint v_occ_mode;
|
|
layout(location = 0) out vec4 out_color;
|
|
|
|
void main()
|
|
{
|
|
float _13 = length(v_offset_from_center_px);
|
|
float _16 = fwidth(_13);
|
|
vec4 col = v_color;
|
|
if (v_view_z > (textureLod(tex_depth_smp_depth, gl_FragCoord.xy / vec2(textureSize(tex_depth_smp_depth, 0)), 0.0).x + (0.001000000047497451305389404296875 + (2.0 * fwidth(v_view_z)))))
|
|
{
|
|
if (v_occ_mode == 0u)
|
|
{
|
|
col = vec4(0.0);
|
|
}
|
|
else
|
|
{
|
|
col *= 0.25;
|
|
}
|
|
}
|
|
out_color = col * (1.0 - smoothstep(v_half_size_px - _16, v_half_size_px + _16, _13));
|
|
}
|
|
|
|
*/
|
|
static const uint8_t overlay_point_fs_source_glsl430[894] = {
|
|
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x6c,0x61,
|
|
0x79,0x6f,0x75,0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x30,
|
|
0x29,0x20,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,
|
|
0x72,0x32,0x44,0x20,0x74,0x65,0x78,0x5f,0x64,0x65,0x70,0x74,0x68,0x5f,0x73,0x6d,
|
|
0x70,0x5f,0x64,0x65,0x70,0x74,0x68,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,0x76,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,
|
|
0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,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,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,
|
|
0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,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,0x69,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x76,0x69,
|
|
0x65,0x77,0x5f,0x7a,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,
|
|
0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x66,0x6c,0x61,0x74,0x20,
|
|
0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,
|
|
0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,
|
|
0x20,0x3d,0x20,0x34,0x29,0x20,0x66,0x6c,0x61,0x74,0x20,0x69,0x6e,0x20,0x75,0x69,
|
|
0x6e,0x74,0x20,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,0x6f,0x64,0x65,0x3b,0x0a,0x6c,
|
|
0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,
|
|
0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,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,0x33,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x76,0x5f,
|
|
0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,
|
|
0x65,0x72,0x5f,0x70,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
|
0x74,0x20,0x5f,0x31,0x36,0x20,0x3d,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x5f,
|
|
0x31,0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,
|
|
0x6c,0x20,0x3d,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x69,0x66,0x20,0x28,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x7a,0x20,0x3e,0x20,
|
|
0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x4c,0x6f,0x64,0x28,0x74,0x65,0x78,0x5f,
|
|
0x64,0x65,0x70,0x74,0x68,0x5f,0x73,0x6d,0x70,0x5f,0x64,0x65,0x70,0x74,0x68,0x2c,
|
|
0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,
|
|
0x20,0x2f,0x20,0x76,0x65,0x63,0x32,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,
|
|
0x69,0x7a,0x65,0x28,0x74,0x65,0x78,0x5f,0x64,0x65,0x70,0x74,0x68,0x5f,0x73,0x6d,
|
|
0x70,0x5f,0x64,0x65,0x70,0x74,0x68,0x2c,0x20,0x30,0x29,0x29,0x2c,0x20,0x30,0x2e,
|
|
0x30,0x29,0x2e,0x78,0x20,0x2b,0x20,0x28,0x30,0x2e,0x30,0x30,0x31,0x30,0x30,0x30,
|
|
0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35,0x33,
|
|
0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x20,0x2b,0x20,0x28,0x32,
|
|
0x2e,0x30,0x20,0x2a,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x76,0x5f,0x76,0x69,
|
|
0x65,0x77,0x5f,0x7a,0x29,0x29,0x29,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,
|
|
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x76,0x5f,0x6f,0x63,
|
|
0x63,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x3d,0x20,0x30,0x75,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,0x76,0x65,0x63,0x34,0x28,0x30,
|
|
0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,
|
|
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,
|
|
0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
|
|
0x20,0x20,0x63,0x6f,0x6c,0x20,0x2a,0x3d,0x20,0x30,0x2e,0x32,0x35,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,0x73,0x69,
|
|
0x7a,0x65,0x5f,0x70,0x78,0x20,0x2d,0x20,0x5f,0x31,0x36,0x2c,0x20,0x76,0x5f,0x68,
|
|
0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x2b,0x20,0x5f,0x31,
|
|
0x36,0x2c,0x20,0x5f,0x31,0x33,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
|
|
};
|
|
/*
|
|
struct point_instance
|
|
{
|
|
float4 p;
|
|
float4 color;
|
|
uint4 flags;
|
|
};
|
|
|
|
ByteAddressBuffer _17 : register(t0);
|
|
cbuffer ub_frame : register(b0)
|
|
{
|
|
row_major float4x4 _76_view : packoffset(c0);
|
|
row_major float4x4 _76_proj : packoffset(c4);
|
|
row_major float4x4 _76_view_proj : packoffset(c8);
|
|
row_major float4x4 _76_inv_view_proj : packoffset(c12);
|
|
float4 _76_camera_pos : packoffset(c16);
|
|
float4 _76_viewport : packoffset(c17);
|
|
};
|
|
|
|
|
|
static float4 gl_Position;
|
|
static int gl_VertexIndex;
|
|
static int gl_InstanceIndex;
|
|
static float2 v_offset_from_center_px;
|
|
static float v_half_size_px;
|
|
static float v_view_z;
|
|
static float4 v_color;
|
|
static uint v_occ_mode;
|
|
|
|
struct SPIRV_Cross_Input
|
|
{
|
|
uint gl_VertexIndex : SV_VertexID;
|
|
uint gl_InstanceIndex : SV_InstanceID;
|
|
};
|
|
|
|
struct SPIRV_Cross_Output
|
|
{
|
|
float2 v_offset_from_center_px : TEXCOORD0;
|
|
float v_half_size_px : TEXCOORD1;
|
|
float v_view_z : TEXCOORD2;
|
|
nointerpolation float4 v_color : TEXCOORD3;
|
|
nointerpolation uint v_occ_mode : TEXCOORD4;
|
|
float4 gl_Position : SV_Position;
|
|
};
|
|
|
|
void vert_main()
|
|
{
|
|
point_instance _25;
|
|
_25.p = asfloat(_17.Load4(gl_InstanceIndex * 48 + 0));
|
|
_25.color = asfloat(_17.Load4(gl_InstanceIndex * 48 + 16));
|
|
_25.flags = _17.Load4(gl_InstanceIndex * 48 + 32);
|
|
bool _46 = gl_VertexIndex == 2;
|
|
bool _50 = gl_VertexIndex == 4;
|
|
float4 _84 = float4(_25.p.xyz, 1.0f);
|
|
float4 _85 = mul(_84, _76_view_proj);
|
|
float4 _94 = mul(_84, _76_view);
|
|
float _98 = _94.z;
|
|
float half_size_px;
|
|
if (_25.flags.x == 0u)
|
|
{
|
|
half_size_px = _25.p.w * 0.5f;
|
|
}
|
|
else
|
|
{
|
|
half_size_px = (_25.p.w * 0.5f) * ((_76_viewport.y * _76_proj[1].y) / (_98 * (-2.0f)));
|
|
}
|
|
float _132 = half_size_px;
|
|
float _133 = max(_132, 0.5f);
|
|
half_size_px = _133;
|
|
float2 _145 = float2((((gl_VertexIndex == 1) || _46) || _50) ? 1.0f : (-1.0f), ((_46 || _50) || (gl_VertexIndex == 5)) ? 1.0f : (-1.0f)) * (_133 + 1.5f);
|
|
float2 _162 = _85.xy + ((_145 * (_76_viewport.zw * 2.0f)) * _85.w);
|
|
float4 _200 = _85;
|
|
_200.x = _162.x;
|
|
_200.y = _162.y;
|
|
gl_Position = _200;
|
|
v_offset_from_center_px = _145;
|
|
v_half_size_px = _133;
|
|
v_view_z = -_98;
|
|
v_color = _25.color;
|
|
v_occ_mode = _25.flags.y;
|
|
}
|
|
|
|
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_offset_from_center_px = v_offset_from_center_px;
|
|
stage_output.v_half_size_px = v_half_size_px;
|
|
stage_output.v_view_z = v_view_z;
|
|
stage_output.v_color = v_color;
|
|
stage_output.v_occ_mode = v_occ_mode;
|
|
return stage_output;
|
|
}
|
|
*/
|
|
static const uint8_t overlay_point_vs_source_hlsl5[2813] = {
|
|
0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x69,0x6e,0x73,
|
|
0x74,0x61,0x6e,0x63,0x65,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
|
0x74,0x34,0x20,0x70,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
|
0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,
|
|
0x34,0x20,0x66,0x6c,0x61,0x67,0x73,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,
|
|
0x31,0x37,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,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,0x37,0x36,0x5f,
|
|
0x76,0x69,0x65,0x77,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,
|
|
0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f,0x6d,
|
|
0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x37,
|
|
0x36,0x5f,0x70,0x72,0x6f,0x6a,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,
|
|
0x73,0x65,0x74,0x28,0x63,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x6f,0x77,
|
|
0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,
|
|
0x5f,0x37,0x36,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,0x38,0x29,0x3b,0x0a,
|
|
0x20,0x20,0x20,0x20,0x72,0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x5f,0x37,0x36,0x5f,0x69,0x6e,0x76,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,0x31,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x37,0x36,0x5f,0x63,0x61,0x6d,0x65,0x72,
|
|
0x61,0x5f,0x70,0x6f,0x73,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,
|
|
0x65,0x74,0x28,0x63,0x31,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x34,0x20,0x5f,0x37,0x36,0x5f,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,
|
|
0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x31,
|
|
0x37,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,0x32,0x20,0x76,0x5f,0x6f,0x66,0x66,0x73,
|
|
0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,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,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x3b,0x0a,
|
|
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x76,
|
|
0x69,0x65,0x77,0x5f,0x7a,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,
|
|
0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,0x20,0x76,0x5f,0x6f,0x63,0x63,0x5f,
|
|
0x6d,0x6f,0x64,0x65,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,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,
|
|
0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,
|
|
0x74,0x65,0x72,0x5f,0x70,0x78,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,
|
|
0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,
|
|
0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x3a,0x20,0x54,
|
|
0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x20,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x7a,0x20,0x3a,0x20,0x54,
|
|
0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x32,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,0x34,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,
|
|
0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,
|
|
0x69,0x6e,0x74,0x65,0x72,0x70,0x6f,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x20,0x75,0x69,
|
|
0x6e,0x74,0x20,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3a,0x20,
|
|
0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x34,0x20,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,0x70,0x6f,0x69,0x6e,
|
|
0x74,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x20,0x5f,0x32,0x35,0x3b,0x0a,
|
|
0x20,0x20,0x20,0x20,0x5f,0x32,0x35,0x2e,0x70,0x20,0x3d,0x20,0x61,0x73,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x28,0x5f,0x31,0x37,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,0x67,0x6c,
|
|
0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x2a,
|
|
0x20,0x34,0x38,0x20,0x2b,0x20,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,
|
|
0x32,0x35,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x61,0x73,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x28,0x5f,0x31,0x37,0x2e,0x4c,0x6f,0x61,0x64,0x34,0x28,0x67,0x6c,0x5f,
|
|
0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x20,0x2a,0x20,
|
|
0x34,0x38,0x20,0x2b,0x20,0x31,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,
|
|
0x32,0x35,0x2e,0x66,0x6c,0x61,0x67,0x73,0x20,0x3d,0x20,0x5f,0x31,0x37,0x2e,0x4c,
|
|
0x6f,0x61,0x64,0x34,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,
|
|
0x49,0x6e,0x64,0x65,0x78,0x20,0x2a,0x20,0x34,0x38,0x20,0x2b,0x20,0x33,0x32,0x29,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x36,0x20,0x3d,
|
|
0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,
|
|
0x3d,0x3d,0x20,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,
|
|
0x35,0x30,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,
|
|
0x64,0x65,0x78,0x20,0x3d,0x3d,0x20,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x34,0x20,0x5f,0x38,0x34,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x34,0x28,0x5f,0x32,0x35,0x2e,0x70,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,
|
|
0x38,0x35,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x5f,0x38,0x34,0x2c,0x20,0x5f,0x37,
|
|
0x36,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,0x39,0x34,0x20,0x3d,0x20,0x6d,
|
|
0x75,0x6c,0x28,0x5f,0x38,0x34,0x2c,0x20,0x5f,0x37,0x36,0x5f,0x76,0x69,0x65,0x77,
|
|
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x38,
|
|
0x20,0x3d,0x20,0x5f,0x39,0x34,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x2e,0x66,0x6c,
|
|
0x61,0x67,0x73,0x2e,0x78,0x20,0x3d,0x3d,0x20,0x30,0x75,0x29,0x0a,0x20,0x20,0x20,
|
|
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x61,0x6c,0x66,0x5f,
|
|
0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x32,0x35,0x2e,0x70,0x2e,
|
|
0x77,0x20,0x2a,0x20,0x30,0x2e,0x35,0x66,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,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,
|
|
0x5f,0x70,0x78,0x20,0x3d,0x20,0x28,0x5f,0x32,0x35,0x2e,0x70,0x2e,0x77,0x20,0x2a,
|
|
0x20,0x30,0x2e,0x35,0x66,0x29,0x20,0x2a,0x20,0x28,0x28,0x5f,0x37,0x36,0x5f,0x76,
|
|
0x69,0x65,0x77,0x70,0x6f,0x72,0x74,0x2e,0x79,0x20,0x2a,0x20,0x5f,0x37,0x36,0x5f,
|
|
0x70,0x72,0x6f,0x6a,0x5b,0x31,0x5d,0x2e,0x79,0x29,0x20,0x2f,0x20,0x28,0x5f,0x39,
|
|
0x38,0x20,0x2a,0x20,0x28,0x2d,0x32,0x2e,0x30,0x66,0x29,0x29,0x29,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,
|
|
0x31,0x33,0x32,0x20,0x3d,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,
|
|
0x70,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,
|
|
0x33,0x33,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x5f,0x31,0x33,0x32,0x2c,0x20,0x30,
|
|
0x2e,0x35,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,
|
|
0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x31,0x33,0x33,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x34,0x35,0x20,0x3d,
|
|
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x28,0x28,0x28,0x67,0x6c,0x5f,0x56,0x65,
|
|
0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x3d,0x3d,0x20,0x31,0x29,0x20,
|
|
0x7c,0x7c,0x20,0x5f,0x34,0x36,0x29,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,0x29,0x20,
|
|
0x3f,0x20,0x31,0x2e,0x30,0x66,0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x66,0x29,
|
|
0x2c,0x20,0x28,0x28,0x5f,0x34,0x36,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,0x29,0x20,
|
|
0x7c,0x7c,0x20,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,
|
|
0x65,0x78,0x20,0x3d,0x3d,0x20,0x35,0x29,0x29,0x20,0x3f,0x20,0x31,0x2e,0x30,0x66,
|
|
0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x66,0x29,0x29,0x20,0x2a,0x20,0x28,0x5f,
|
|
0x31,0x33,0x33,0x20,0x2b,0x20,0x31,0x2e,0x35,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x36,0x32,0x20,0x3d,0x20,0x5f,
|
|
0x38,0x35,0x2e,0x78,0x79,0x20,0x2b,0x20,0x28,0x28,0x5f,0x31,0x34,0x35,0x20,0x2a,
|
|
0x20,0x28,0x5f,0x37,0x36,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,0x38,0x35,
|
|
0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
|
|
0x5f,0x32,0x30,0x30,0x20,0x3d,0x20,0x5f,0x38,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x5f,0x32,0x30,0x30,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x31,0x36,0x32,0x2e,0x78,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x5f,0x32,0x30,0x30,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x31,
|
|
0x36,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,
|
|
0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x5f,0x32,0x30,0x30,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x76,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,
|
|
0x63,0x65,0x6e,0x74,0x65,0x72,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x31,0x34,0x35,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,
|
|
0x65,0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x31,0x33,0x33,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x7a,0x20,0x3d,0x20,0x2d,0x5f,0x39,0x38,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,
|
|
0x5f,0x32,0x35,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,
|
|
0x5f,0x6f,0x63,0x63,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x20,0x5f,0x32,0x35,0x2e,
|
|
0x66,0x6c,0x61,0x67,0x73,0x2e,0x79,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,
|
|
0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,
|
|
0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,
|
|
0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,
|
|
0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,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,0x6f,0x66,0x66,0x73,0x65,0x74,
|
|
0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x5f,0x70,0x78,0x20,
|
|
0x3d,0x20,0x76,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,
|
|
0x63,0x65,0x6e,0x74,0x65,0x72,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,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x3d,0x20,0x76,0x5f,0x68,
|
|
0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x76,0x5f,
|
|
0x76,0x69,0x65,0x77,0x5f,0x7a,0x20,0x3d,0x20,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,
|
|
0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,
|
|
0x70,0x75,0x74,0x2e,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x5f,
|
|
0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,
|
|
0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,0x6f,
|
|
0x64,0x65,0x20,0x3d,0x20,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,0x6f,0x64,0x65,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,
|
|
0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00,
|
|
};
|
|
/*
|
|
Texture2D<float4> tex_depth : register(t0);
|
|
SamplerState smp_depth : register(s0);
|
|
|
|
static float4 gl_FragCoord;
|
|
static float2 v_offset_from_center_px;
|
|
static float v_half_size_px;
|
|
static float v_view_z;
|
|
static float4 v_color;
|
|
static uint v_occ_mode;
|
|
static float4 out_color;
|
|
|
|
struct SPIRV_Cross_Input
|
|
{
|
|
float2 v_offset_from_center_px : TEXCOORD0;
|
|
float v_half_size_px : TEXCOORD1;
|
|
float v_view_z : TEXCOORD2;
|
|
nointerpolation float4 v_color : TEXCOORD3;
|
|
nointerpolation uint v_occ_mode : TEXCOORD4;
|
|
float4 gl_FragCoord : SV_Position;
|
|
};
|
|
|
|
struct SPIRV_Cross_Output
|
|
{
|
|
float4 out_color : SV_Target0;
|
|
};
|
|
|
|
uint2 spvTextureSize(Texture2D<float4> Tex, uint Level, out uint Param)
|
|
{
|
|
uint2 ret;
|
|
Tex.GetDimensions(Level, ret.x, ret.y, Param);
|
|
return ret;
|
|
}
|
|
|
|
void frag_main()
|
|
{
|
|
float _13 = length(v_offset_from_center_px);
|
|
float _16 = fwidth(_13);
|
|
uint _51_dummy_parameter;
|
|
float4 col = v_color;
|
|
if (v_view_z > (tex_depth.SampleLevel(smp_depth, gl_FragCoord.xy / float2(int2(spvTextureSize(tex_depth, uint(0), _51_dummy_parameter))), 0.0f).x + (0.001000000047497451305389404296875f + (2.0f * fwidth(v_view_z)))))
|
|
{
|
|
if (v_occ_mode == 0u)
|
|
{
|
|
col = 0.0f.xxxx;
|
|
}
|
|
else
|
|
{
|
|
col *= 0.25f;
|
|
}
|
|
}
|
|
out_color = col * (1.0f - smoothstep(v_half_size_px - _16, v_half_size_px + _16, _13));
|
|
}
|
|
|
|
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
|
{
|
|
gl_FragCoord = stage_input.gl_FragCoord;
|
|
gl_FragCoord.w = 1.0 / gl_FragCoord.w;
|
|
v_offset_from_center_px = stage_input.v_offset_from_center_px;
|
|
v_half_size_px = stage_input.v_half_size_px;
|
|
v_view_z = stage_input.v_view_z;
|
|
v_color = stage_input.v_color;
|
|
v_occ_mode = stage_input.v_occ_mode;
|
|
frag_main();
|
|
SPIRV_Cross_Output stage_output;
|
|
stage_output.out_color = out_color;
|
|
return stage_output;
|
|
}
|
|
*/
|
|
static const uint8_t overlay_point_fs_source_hlsl5[1902] = {
|
|
0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
|
0x3e,0x20,0x74,0x65,0x78,0x5f,0x64,0x65,0x70,0x74,0x68,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,0x5f,0x64,0x65,0x70,
|
|
0x74,0x68,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x73,0x30,
|
|
0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x34,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x3b,0x0a,
|
|
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x5f,
|
|
0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,
|
|
0x65,0x72,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,0x73,0x69,0x7a,0x65,0x5f,
|
|
0x70,0x78,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x20,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x7a,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,
|
|
0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
|
|
0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,0x20,0x76,0x5f,
|
|
0x6f,0x63,0x63,0x5f,0x6d,0x6f,0x64,0x65,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,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x5f,0x6f,0x66,0x66,0x73,
|
|
0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x5f,0x70,
|
|
0x78,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,
|
|
0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,
|
|
0x52,0x44,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,
|
|
0x5f,0x76,0x69,0x65,0x77,0x5f,0x7a,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,
|
|
0x52,0x44,0x32,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,0x34,0x20,
|
|
0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,
|
|
0x52,0x44,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6e,0x6f,0x69,0x6e,0x74,0x65,0x72,
|
|
0x70,0x6f,0x6c,0x61,0x74,0x69,0x6f,0x6e,0x20,0x75,0x69,0x6e,0x74,0x20,0x76,0x5f,
|
|
0x6f,0x63,0x63,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,
|
|
0x4f,0x52,0x44,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
|
0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3a,0x20,
|
|
0x53,0x56,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,
|
|
0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,
|
|
0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,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,0x75,0x69,0x6e,0x74,0x32,0x20,0x73,0x70,0x76,0x54,0x65,0x78,
|
|
0x74,0x75,0x72,0x65,0x53,0x69,0x7a,0x65,0x28,0x54,0x65,0x78,0x74,0x75,0x72,0x65,
|
|
0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34,0x3e,0x20,0x54,0x65,0x78,0x2c,0x20,
|
|
0x75,0x69,0x6e,0x74,0x20,0x4c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x6f,0x75,0x74,0x20,
|
|
0x75,0x69,0x6e,0x74,0x20,0x50,0x61,0x72,0x61,0x6d,0x29,0x0a,0x7b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x75,0x69,0x6e,0x74,0x32,0x20,0x72,0x65,0x74,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x54,0x65,0x78,0x2e,0x47,0x65,0x74,0x44,0x69,0x6d,0x65,0x6e,0x73,0x69,0x6f,
|
|
0x6e,0x73,0x28,0x4c,0x65,0x76,0x65,0x6c,0x2c,0x20,0x72,0x65,0x74,0x2e,0x78,0x2c,
|
|
0x20,0x72,0x65,0x74,0x2e,0x79,0x2c,0x20,0x50,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,
|
|
0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x74,0x3b,0x0a,
|
|
0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,
|
|
0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,
|
|
0x5f,0x31,0x33,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x76,0x5f,0x6f,
|
|
0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,0x65,
|
|
0x72,0x5f,0x70,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x20,0x5f,0x31,0x36,0x20,0x3d,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x5f,0x31,
|
|
0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x20,0x5f,0x35,0x31,
|
|
0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x65,0x74,0x65,0x72,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,
|
|
0x20,0x3d,0x20,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x69,0x66,0x20,0x28,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x7a,0x20,0x3e,0x20,0x28,
|
|
0x74,0x65,0x78,0x5f,0x64,0x65,0x70,0x74,0x68,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,
|
|
0x4c,0x65,0x76,0x65,0x6c,0x28,0x73,0x6d,0x70,0x5f,0x64,0x65,0x70,0x74,0x68,0x2c,
|
|
0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,
|
|
0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x69,0x6e,0x74,0x32,0x28,0x73,
|
|
0x70,0x76,0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x69,0x7a,0x65,0x28,0x74,0x65,
|
|
0x78,0x5f,0x64,0x65,0x70,0x74,0x68,0x2c,0x20,0x75,0x69,0x6e,0x74,0x28,0x30,0x29,
|
|
0x2c,0x20,0x5f,0x35,0x31,0x5f,0x64,0x75,0x6d,0x6d,0x79,0x5f,0x70,0x61,0x72,0x61,
|
|
0x6d,0x65,0x74,0x65,0x72,0x29,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x2e,
|
|
0x78,0x20,0x2b,0x20,0x28,0x30,0x2e,0x30,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,
|
|
0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35,0x33,0x38,0x39,0x34,
|
|
0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x66,0x20,0x2b,0x20,0x28,0x32,0x2e,0x30,
|
|
0x66,0x20,0x2a,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x76,0x5f,0x76,0x69,0x65,
|
|
0x77,0x5f,0x7a,0x29,0x29,0x29,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x76,0x5f,0x6f,0x63,0x63,
|
|
0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x3d,0x20,0x30,0x75,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,0x30,0x2e,0x30,0x66,0x2e,0x78,0x78,
|
|
0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,
|
|
0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,
|
|
0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
|
|
0x20,0x63,0x6f,0x6c,0x20,0x2a,0x3d,0x20,0x30,0x2e,0x32,0x35,0x66,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,0x73,
|
|
0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x2d,0x20,0x5f,0x31,0x36,0x2c,0x20,0x76,0x5f,
|
|
0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x2b,0x20,0x5f,
|
|
0x31,0x36,0x2c,0x20,0x5f,0x31,0x33,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,0x67,0x6c,0x5f,0x46,0x72,
|
|
0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,
|
|
0x69,0x6e,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,
|
|
0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,
|
|
0x6f,0x6f,0x72,0x64,0x2e,0x77,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2f,0x20,0x67,
|
|
0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x77,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x76,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,
|
|
0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x5f,0x70,0x78,0x20,0x3d,0x20,0x73,0x74,0x61,
|
|
0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x5f,0x6f,0x66,0x66,0x73,0x65,
|
|
0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x5f,0x70,0x78,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,
|
|
0x65,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,0x73,0x69,0x7a,0x65,0x5f,0x70,
|
|
0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x7a,0x20,
|
|
0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x5f,
|
|
0x76,0x69,0x65,0x77,0x5f,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x63,0x6f,
|
|
0x6c,0x6f,0x72,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,
|
|
0x74,0x2e,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,
|
|
0x5f,0x6f,0x63,0x63,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,
|
|
0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,0x6f,
|
|
0x64,0x65,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 point_instance
|
|
{
|
|
float4 p;
|
|
float4 color;
|
|
uint4 flags;
|
|
};
|
|
|
|
struct point_instances
|
|
{
|
|
point_instance instances[1];
|
|
};
|
|
|
|
struct ub_frame
|
|
{
|
|
float4x4 view;
|
|
float4x4 proj;
|
|
float4x4 view_proj;
|
|
float4x4 inv_view_proj;
|
|
float4 camera_pos;
|
|
float4 viewport;
|
|
};
|
|
|
|
struct main0_out
|
|
{
|
|
float2 v_offset_from_center_px [[user(locn0)]];
|
|
float v_half_size_px [[user(locn1)]];
|
|
float v_view_z [[user(locn2)]];
|
|
float4 v_color [[user(locn3)]];
|
|
uint v_occ_mode [[user(locn4)]];
|
|
float4 gl_Position [[position]];
|
|
};
|
|
|
|
vertex main0_out main0(constant ub_frame& _76 [[buffer(0)]], const device point_instances& _17 [[buffer(8)]], uint gl_InstanceIndex [[instance_id]], uint gl_VertexIndex [[vertex_id]])
|
|
{
|
|
main0_out out = {};
|
|
bool _46 = int(gl_VertexIndex) == 2;
|
|
bool _50 = int(gl_VertexIndex) == 4;
|
|
float4 _84 = float4(_17.instances[int(gl_InstanceIndex)].p.xyz, 1.0);
|
|
float4 _85 = _76.view_proj * _84;
|
|
float4 _94 = _76.view * _84;
|
|
float _98 = _94.z;
|
|
float half_size_px;
|
|
if (_17.instances[int(gl_InstanceIndex)].flags.x == 0u)
|
|
{
|
|
half_size_px = _17.instances[int(gl_InstanceIndex)].p.w * 0.5;
|
|
}
|
|
else
|
|
{
|
|
half_size_px = (_17.instances[int(gl_InstanceIndex)].p.w * 0.5) * ((_76.viewport.y * _76.proj[1].y) / (_98 * (-2.0)));
|
|
}
|
|
float _132 = half_size_px;
|
|
float _133 = fast::max(_132, 0.5);
|
|
half_size_px = _133;
|
|
float2 _145 = float2((((int(gl_VertexIndex) == 1) || _46) || _50) ? 1.0 : (-1.0), ((_46 || _50) || (int(gl_VertexIndex) == 5)) ? 1.0 : (-1.0)) * (_133 + 1.5);
|
|
float2 _162 = _85.xy + ((_145 * (_76.viewport.zw * 2.0)) * _85.w);
|
|
float4 _200 = _85;
|
|
_200.x = _162.x;
|
|
_200.y = _162.y;
|
|
out.gl_Position = _200;
|
|
out.v_offset_from_center_px = _145;
|
|
out.v_half_size_px = _133;
|
|
out.v_view_z = -_98;
|
|
out.v_color = _17.instances[int(gl_InstanceIndex)].color;
|
|
out.v_occ_mode = _17.instances[int(gl_InstanceIndex)].flags.y;
|
|
return out;
|
|
}
|
|
|
|
*/
|
|
static const uint8_t overlay_point_vs_source_metal_macos[2072] = {
|
|
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,0x70,
|
|
0x6f,0x69,0x6e,0x74,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x0a,0x7b,0x0a,
|
|
0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x3b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,
|
|
0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x34,0x20,0x66,0x6c,0x61,0x67,0x73,0x3b,
|
|
0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x70,0x6f,0x69,0x6e,
|
|
0x74,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x0a,0x7b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x70,0x6f,0x69,0x6e,0x74,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,
|
|
0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,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,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,
|
|
0x74,0x34,0x78,0x34,0x20,0x70,0x72,0x6f,0x6a,0x3b,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,0x78,0x34,0x20,
|
|
0x69,0x6e,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x61,0x6d,0x65,0x72,0x61,
|
|
0x5f,0x70,0x6f,0x73,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,0x32,0x20,0x76,0x5f,0x6f,
|
|
0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,0x65,
|
|
0x72,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,0x73,0x69,0x7a,0x65,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,0x76,0x69,0x65,0x77,
|
|
0x5f,0x7a,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,0x76,
|
|
0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,
|
|
0x63,0x6e,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,
|
|
0x20,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x5b,0x5b,0x75,0x73,
|
|
0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x34,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,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,0x37,0x36,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,
|
|
0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x64,0x65,0x76,0x69,0x63,0x65,0x20,
|
|
0x70,0x6f,0x69,0x6e,0x74,0x5f,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x26,
|
|
0x20,0x5f,0x31,0x37,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x38,0x29,
|
|
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,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,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,0x62,0x6f,0x6f,0x6c,
|
|
0x20,0x5f,0x34,0x36,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,
|
|
0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x3d,0x3d,0x20,0x32,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x35,0x30,0x20,0x3d,0x20,
|
|
0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,
|
|
0x65,0x78,0x29,0x20,0x3d,0x3d,0x20,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x34,0x20,0x5f,0x38,0x34,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,
|
|
0x34,0x28,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,
|
|
0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,
|
|
0x6e,0x64,0x65,0x78,0x29,0x5d,0x2e,0x70,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,
|
|
0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,
|
|
0x38,0x35,0x20,0x3d,0x20,0x5f,0x37,0x36,0x2e,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,
|
|
0x6f,0x6a,0x20,0x2a,0x20,0x5f,0x38,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x34,0x20,0x5f,0x39,0x34,0x20,0x3d,0x20,0x5f,0x37,0x36,0x2e,0x76,
|
|
0x69,0x65,0x77,0x20,0x2a,0x20,0x5f,0x38,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x38,0x20,0x3d,0x20,0x5f,0x39,0x34,0x2e,0x7a,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x68,0x61,0x6c,0x66,
|
|
0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,
|
|
0x20,0x28,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,
|
|
0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,
|
|
0x6e,0x64,0x65,0x78,0x29,0x5d,0x2e,0x66,0x6c,0x61,0x67,0x73,0x2e,0x78,0x20,0x3d,
|
|
0x3d,0x20,0x30,0x75,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x20,0x20,0x20,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,
|
|
0x20,0x3d,0x20,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,
|
|
0x5b,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,
|
|
0x49,0x6e,0x64,0x65,0x78,0x29,0x5d,0x2e,0x70,0x2e,0x77,0x20,0x2a,0x20,0x30,0x2e,
|
|
0x35,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,
|
|
0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x3d,0x20,0x28,
|
|
0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x73,0x5b,0x69,0x6e,
|
|
0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x49,0x6e,0x64,
|
|
0x65,0x78,0x29,0x5d,0x2e,0x70,0x2e,0x77,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,
|
|
0x2a,0x20,0x28,0x28,0x5f,0x37,0x36,0x2e,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,
|
|
0x2e,0x79,0x20,0x2a,0x20,0x5f,0x37,0x36,0x2e,0x70,0x72,0x6f,0x6a,0x5b,0x31,0x5d,
|
|
0x2e,0x79,0x29,0x20,0x2f,0x20,0x28,0x5f,0x39,0x38,0x20,0x2a,0x20,0x28,0x2d,0x32,
|
|
0x2e,0x30,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,
|
|
0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x33,0x32,0x20,0x3d,0x20,0x68,0x61,
|
|
0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x33,0x33,0x20,0x3d,0x20,0x66,0x61,0x73,
|
|
0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x31,0x33,0x32,0x2c,0x20,0x30,0x2e,0x35,
|
|
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,
|
|
0x5f,0x70,0x78,0x20,0x3d,0x20,0x5f,0x31,0x33,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x34,0x35,0x20,0x3d,0x20,0x66,0x6c,
|
|
0x6f,0x61,0x74,0x32,0x28,0x28,0x28,0x28,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x56,
|
|
0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x3d,0x3d,0x20,0x31,
|
|
0x29,0x20,0x7c,0x7c,0x20,0x5f,0x34,0x36,0x29,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,
|
|
0x29,0x20,0x3f,0x20,0x31,0x2e,0x30,0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x29,
|
|
0x2c,0x20,0x28,0x28,0x5f,0x34,0x36,0x20,0x7c,0x7c,0x20,0x5f,0x35,0x30,0x29,0x20,
|
|
0x7c,0x7c,0x20,0x28,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,
|
|
0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x3d,0x3d,0x20,0x35,0x29,0x29,0x20,0x3f,
|
|
0x20,0x31,0x2e,0x30,0x20,0x3a,0x20,0x28,0x2d,0x31,0x2e,0x30,0x29,0x29,0x20,0x2a,
|
|
0x20,0x28,0x5f,0x31,0x33,0x33,0x20,0x2b,0x20,0x31,0x2e,0x35,0x29,0x3b,0x0a,0x20,
|
|
0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x36,0x32,0x20,0x3d,
|
|
0x20,0x5f,0x38,0x35,0x2e,0x78,0x79,0x20,0x2b,0x20,0x28,0x28,0x5f,0x31,0x34,0x35,
|
|
0x20,0x2a,0x20,0x28,0x5f,0x37,0x36,0x2e,0x76,0x69,0x65,0x77,0x70,0x6f,0x72,0x74,
|
|
0x2e,0x7a,0x77,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x38,
|
|
0x35,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
|
0x20,0x5f,0x32,0x30,0x30,0x20,0x3d,0x20,0x5f,0x38,0x35,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x5f,0x32,0x30,0x30,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x31,0x36,0x32,0x2e,0x78,
|
|
0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x32,0x30,0x30,0x2e,0x79,0x20,0x3d,0x20,0x5f,
|
|
0x31,0x36,0x32,0x2e,0x79,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,0x32,0x30,
|
|
0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x6f,0x66,0x66,
|
|
0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x5f,
|
|
0x70,0x78,0x20,0x3d,0x20,0x5f,0x31,0x34,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,
|
|
0x75,0x74,0x2e,0x76,0x5f,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,
|
|
0x78,0x20,0x3d,0x20,0x5f,0x31,0x33,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,
|
|
0x74,0x2e,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x7a,0x20,0x3d,0x20,0x2d,0x5f,0x39,
|
|
0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x63,0x6f,0x6c,
|
|
0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,
|
|
0x65,0x73,0x5b,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,0x6e,
|
|
0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x5d,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x3b,
|
|
0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,
|
|
0x6f,0x64,0x65,0x20,0x3d,0x20,0x5f,0x31,0x37,0x2e,0x69,0x6e,0x73,0x74,0x61,0x6e,
|
|
0x63,0x65,0x73,0x5b,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f,0x49,0x6e,0x73,0x74,0x61,
|
|
0x6e,0x63,0x65,0x49,0x6e,0x64,0x65,0x78,0x29,0x5d,0x2e,0x66,0x6c,0x61,0x67,0x73,
|
|
0x2e,0x79,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 main0_out
|
|
{
|
|
float4 out_color [[color(0)]];
|
|
};
|
|
|
|
struct main0_in
|
|
{
|
|
float2 v_offset_from_center_px [[user(locn0)]];
|
|
float v_half_size_px [[user(locn1)]];
|
|
float v_view_z [[user(locn2)]];
|
|
float4 v_color [[user(locn3), flat]];
|
|
uint v_occ_mode [[user(locn4)]];
|
|
};
|
|
|
|
fragment main0_out main0(main0_in in [[stage_in]], texture2d<float> tex_depth [[texture(0)]], sampler smp_depth [[sampler(0)]], float4 gl_FragCoord [[position]])
|
|
{
|
|
main0_out out = {};
|
|
float _13 = length(in.v_offset_from_center_px);
|
|
float _16 = fwidth(_13);
|
|
float4 col = in.v_color;
|
|
if (in.v_view_z > (tex_depth.sample(smp_depth, (gl_FragCoord.xy / float2(int2(tex_depth.get_width(), tex_depth.get_height()))), level(0.0)).x + (0.001000000047497451305389404296875 + (2.0 * fwidth(in.v_view_z)))))
|
|
{
|
|
if (in.v_occ_mode == 0u)
|
|
{
|
|
col = float4(0.0);
|
|
}
|
|
else
|
|
{
|
|
col *= 0.25;
|
|
}
|
|
}
|
|
out.out_color = col * (1.0 - smoothstep(in.v_half_size_px - _16, in.v_half_size_px + _16, _13));
|
|
return out;
|
|
}
|
|
|
|
*/
|
|
static const uint8_t overlay_point_fs_source_metal_macos[1152] = {
|
|
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
|
|
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
|
|
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
|
|
0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,
|
|
0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,
|
|
0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,
|
|
0x6c,0x6f,0x61,0x74,0x34,0x20,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,0x32,0x20,0x76,
|
|
0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,
|
|
0x74,0x65,0x72,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,0x73,0x69,0x7a,0x65,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,0x76,0x69,
|
|
0x65,0x77,0x5f,0x7a,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,0x76,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,
|
|
0x6c,0x6f,0x63,0x6e,0x33,0x29,0x2c,0x20,0x66,0x6c,0x61,0x74,0x5d,0x5d,0x3b,0x0a,
|
|
0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x20,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,
|
|
0x6f,0x64,0x65,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x34,
|
|
0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,
|
|
0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,
|
|
0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,
|
|
0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,
|
|
0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x65,0x78,
|
|
0x5f,0x64,0x65,0x70,0x74,0x68,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,0x5f,0x64,0x65,0x70,0x74,0x68,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,
|
|
0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,
|
|
0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x70,
|
|
0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,
|
|
0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,
|
|
0x31,0x33,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x69,0x6e,0x2e,0x76,
|
|
0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x66,0x72,0x6f,0x6d,0x5f,0x63,0x65,0x6e,
|
|
0x74,0x65,0x72,0x5f,0x70,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,
|
|
0x61,0x74,0x20,0x5f,0x31,0x36,0x20,0x3d,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,
|
|
0x5f,0x31,0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,
|
|
0x20,0x63,0x6f,0x6c,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x76,0x5f,0x63,0x6f,0x6c,0x6f,
|
|
0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x69,0x6e,0x2e,0x76,0x5f,
|
|
0x76,0x69,0x65,0x77,0x5f,0x7a,0x20,0x3e,0x20,0x28,0x74,0x65,0x78,0x5f,0x64,0x65,
|
|
0x70,0x74,0x68,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73,0x6d,0x70,0x5f,0x64,
|
|
0x65,0x70,0x74,0x68,0x2c,0x20,0x28,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,
|
|
0x6f,0x72,0x64,0x2e,0x78,0x79,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,
|
|
0x69,0x6e,0x74,0x32,0x28,0x74,0x65,0x78,0x5f,0x64,0x65,0x70,0x74,0x68,0x2e,0x67,
|
|
0x65,0x74,0x5f,0x77,0x69,0x64,0x74,0x68,0x28,0x29,0x2c,0x20,0x74,0x65,0x78,0x5f,
|
|
0x64,0x65,0x70,0x74,0x68,0x2e,0x67,0x65,0x74,0x5f,0x68,0x65,0x69,0x67,0x68,0x74,
|
|
0x28,0x29,0x29,0x29,0x29,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x28,0x30,0x2e,0x30,
|
|
0x29,0x29,0x2e,0x78,0x20,0x2b,0x20,0x28,0x30,0x2e,0x30,0x30,0x31,0x30,0x30,0x30,
|
|
0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35,0x33,
|
|
0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x20,0x2b,0x20,0x28,0x32,
|
|
0x2e,0x30,0x20,0x2a,0x20,0x66,0x77,0x69,0x64,0x74,0x68,0x28,0x69,0x6e,0x2e,0x76,
|
|
0x5f,0x76,0x69,0x65,0x77,0x5f,0x7a,0x29,0x29,0x29,0x29,0x29,0x0a,0x20,0x20,0x20,
|
|
0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x69,
|
|
0x6e,0x2e,0x76,0x5f,0x6f,0x63,0x63,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x3d,0x20,
|
|
0x30,0x75,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,
|
|
0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,
|
|
0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,
|
|
0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,
|
|
0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x20,0x2a,0x3d,
|
|
0x20,0x30,0x2e,0x32,0x35,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,0x73,0x69,0x7a,
|
|
0x65,0x5f,0x70,0x78,0x20,0x2d,0x20,0x5f,0x31,0x36,0x2c,0x20,0x69,0x6e,0x2e,0x76,
|
|
0x5f,0x68,0x61,0x6c,0x66,0x5f,0x73,0x69,0x7a,0x65,0x5f,0x70,0x78,0x20,0x2b,0x20,
|
|
0x5f,0x31,0x36,0x2c,0x20,0x5f,0x31,0x33,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* overlay_point_prog_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*)overlay_point_vs_source_glsl430;
|
|
desc.vertex_func.entry = "main";
|
|
desc.fragment_func.source = (const char*)overlay_point_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 = 288;
|
|
desc.uniform_blocks[0].glsl_uniforms[0].type = SG_UNIFORMTYPE_FLOAT4;
|
|
desc.uniform_blocks[0].glsl_uniforms[0].array_count = 18;
|
|
desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "ub_frame";
|
|
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].texture.stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.views[1].texture.image_type = SG_IMAGETYPE_2D;
|
|
desc.views[1].texture.sample_type = SG_IMAGESAMPLETYPE_FLOAT;
|
|
desc.views[1].texture.multisampled = false;
|
|
desc.samplers[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
|
|
desc.texture_sampler_pairs[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.texture_sampler_pairs[0].view_slot = 1;
|
|
desc.texture_sampler_pairs[0].sampler_slot = 0;
|
|
desc.texture_sampler_pairs[0].glsl_name = "tex_depth_smp_depth";
|
|
desc.label = "overlay_point_prog_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*)overlay_point_vs_source_hlsl5;
|
|
desc.vertex_func.d3d11_target = "vs_5_0";
|
|
desc.vertex_func.entry = "main";
|
|
desc.fragment_func.source = (const char*)overlay_point_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 = 288;
|
|
desc.uniform_blocks[0].hlsl_register_b_n = 0;
|
|
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].texture.stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.views[1].texture.image_type = SG_IMAGETYPE_2D;
|
|
desc.views[1].texture.sample_type = SG_IMAGESAMPLETYPE_FLOAT;
|
|
desc.views[1].texture.multisampled = false;
|
|
desc.views[1].texture.hlsl_register_t_n = 0;
|
|
desc.samplers[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
|
|
desc.samplers[0].hlsl_register_s_n = 0;
|
|
desc.texture_sampler_pairs[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.texture_sampler_pairs[0].view_slot = 1;
|
|
desc.texture_sampler_pairs[0].sampler_slot = 0;
|
|
desc.label = "overlay_point_prog_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*)overlay_point_vs_source_metal_macos;
|
|
desc.vertex_func.entry = "main0";
|
|
desc.fragment_func.source = (const char*)overlay_point_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 = 288;
|
|
desc.uniform_blocks[0].msl_buffer_n = 0;
|
|
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].texture.stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.views[1].texture.image_type = SG_IMAGETYPE_2D;
|
|
desc.views[1].texture.sample_type = SG_IMAGESAMPLETYPE_FLOAT;
|
|
desc.views[1].texture.multisampled = false;
|
|
desc.views[1].texture.msl_texture_n = 0;
|
|
desc.samplers[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING;
|
|
desc.samplers[0].msl_sampler_n = 0;
|
|
desc.texture_sampler_pairs[0].stage = SG_SHADERSTAGE_FRAGMENT;
|
|
desc.texture_sampler_pairs[0].view_slot = 1;
|
|
desc.texture_sampler_pairs[0].sampler_slot = 0;
|
|
desc.label = "overlay_point_prog_shader";
|
|
}
|
|
return &desc;
|
|
}
|
|
return 0;
|
|
}
|