#pragma once /* #version:1# (machine generated, don't edit!) Generated by sokol-shdc (https://github.com/floooh/sokol-tools) Cmdline: sokol-shdc -i ./samples/shadows-sapp.glsl -o F:\dev\luajit\Thunc\sokol-luajit\bin/shaderbin/shader_gen.h -l glsl410 -f sokol Overview: ========= Shader program: 'dbg': Get shader desc: dbg_shader_desc(sg_query_backend()); Vertex shader: vs_dbg Attributes: ATTR_vs_dbg_pos => 0 Fragment shader: fs_dbg Image 'dbg_tex': Image type: SG_IMAGETYPE_2D Sample type: SG_IMAGESAMPLETYPE_FLOAT Multisampled: false Bind slot: SLOT_dbg_tex => 0 Sampler 'dbg_smp': Type: SG_SAMPLERTYPE_FILTERING Bind slot: SLOT_dbg_smp => 0 Image Sampler Pair 'dbg_tex_dbg_smp': Image: dbg_tex Sampler: dbg_smp Shader program: 'display': Get shader desc: display_shader_desc(sg_query_backend()); Vertex shader: vs_display Attributes: ATTR_vs_display_pos => 0 ATTR_vs_display_norm => 1 Uniform block 'vs_display_params': C struct: vs_display_params_t Bind slot: SLOT_vs_display_params => 0 Fragment shader: fs_display Uniform block 'fs_display_params': C struct: fs_display_params_t Bind slot: SLOT_fs_display_params => 0 Image 'shadow_map': Image type: SG_IMAGETYPE_2D Sample type: SG_IMAGESAMPLETYPE_FLOAT Multisampled: false Bind slot: SLOT_shadow_map => 0 Sampler 'shadow_sampler': Type: SG_SAMPLERTYPE_FILTERING Bind slot: SLOT_shadow_sampler => 0 Image Sampler Pair 'shadow_map_shadow_sampler': Image: shadow_map Sampler: shadow_sampler Shader program: 'shadow': Get shader desc: shadow_shader_desc(sg_query_backend()); Vertex shader: vs_shadow Attributes: ATTR_vs_shadow_pos => 0 Uniform block 'vs_shadow_params': C struct: vs_shadow_params_t Bind slot: SLOT_vs_shadow_params => 0 Fragment shader: fs_shadow */ #if !defined(SOKOL_GFX_INCLUDED) #error "Please include sokol_gfx.h before shader_gen.h" #endif #if !defined(SOKOL_SHDC_ALIGN) #if defined(_MSC_VER) #define SOKOL_SHDC_ALIGN(a) __declspec(align(a)) #else #define SOKOL_SHDC_ALIGN(a) __attribute__((aligned(a))) #endif #endif #define ATTR_vs_dbg_pos (0) #define ATTR_vs_display_pos (0) #define ATTR_vs_display_norm (1) #define ATTR_vs_shadow_pos (0) #define SLOT_vs_shadow_params (0) #define SLOT_vs_display_params (0) #define SLOT_fs_display_params (0) #define SLOT_shadow_map (0) #define SLOT_dbg_tex (0) #define SLOT_shadow_sampler (0) #define SLOT_dbg_smp (0) #pragma pack(push,1) SOKOL_SHDC_ALIGN(16) typedef struct vs_shadow_params_t { hmm_mat4 mvp; } vs_shadow_params_t; #pragma pack(pop) #pragma pack(push,1) SOKOL_SHDC_ALIGN(16) typedef struct vs_display_params_t { hmm_mat4 mvp; hmm_mat4 model; hmm_mat4 light_mvp; hmm_vec3 diff_color; uint8_t _pad_204[4]; } vs_display_params_t; #pragma pack(pop) #pragma pack(push,1) SOKOL_SHDC_ALIGN(16) typedef struct fs_display_params_t { hmm_vec3 light_dir; uint8_t _pad_12[4]; hmm_vec3 eye_pos; uint8_t _pad_28[4]; } fs_display_params_t; #pragma pack(pop) /* #version 410 uniform vec4 vs_shadow_params[4]; layout(location = 0) in vec4 pos; layout(location = 0) out vec2 proj_zw; void main() { gl_Position = mat4(vs_shadow_params[0], vs_shadow_params[1], vs_shadow_params[2], vs_shadow_params[3]) * pos; proj_zw = gl_Position.zw; } */ static const uint8_t vs_shadow_source_glsl410[284] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x73,0x68, 0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x3b,0x0a, 0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20, 0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73, 0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f, 0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20, 0x70,0x72,0x6f,0x6a,0x5f,0x7a,0x77,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d, 0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50, 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76, 0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, 0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61, 0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x73,0x68,0x61,0x64, 0x6f,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73, 0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33, 0x5d,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x72, 0x6f,0x6a,0x5f,0x7a,0x77,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, 0x69,0x6f,0x6e,0x2e,0x7a,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; /* #version 410 layout(location = 0) in vec2 proj_zw; layout(location = 0) out vec4 frag_color; vec4 encode_depth(float v) { vec4 _23 = fract(vec4(1.0, 255.0, 65025.0, 16581375.0) * v); return fma(-_23.yzww, vec4(0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0039215688593685626983642578125, 0.0), _23); } void main() { float param = proj_zw.x / proj_zw.y; frag_color = encode_depth(param); } */ static const uint8_t fs_shadow_source_glsl410[437] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x6c,0x61, 0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, 0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x72,0x6f,0x6a,0x5f, 0x7a,0x77,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74, 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63, 0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76, 0x65,0x63,0x34,0x20,0x65,0x6e,0x63,0x6f,0x64,0x65,0x5f,0x64,0x65,0x70,0x74,0x68, 0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, 0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x33,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74, 0x28,0x76,0x65,0x63,0x34,0x28,0x31,0x2e,0x30,0x2c,0x20,0x32,0x35,0x35,0x2e,0x30, 0x2c,0x20,0x36,0x35,0x30,0x32,0x35,0x2e,0x30,0x2c,0x20,0x31,0x36,0x35,0x38,0x31, 0x33,0x37,0x35,0x2e,0x30,0x29,0x20,0x2a,0x20,0x76,0x29,0x3b,0x0a,0x20,0x20,0x20, 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6d,0x61,0x28,0x2d,0x5f,0x32,0x33, 0x2e,0x79,0x7a,0x77,0x77,0x2c,0x20,0x76,0x65,0x63,0x34,0x28,0x30,0x2e,0x30,0x30, 0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32, 0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30, 0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38, 0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35, 0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39, 0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38, 0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x5f,0x32,0x33,0x29,0x3b, 0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, 0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, 0x6d,0x20,0x3d,0x20,0x70,0x72,0x6f,0x6a,0x5f,0x7a,0x77,0x2e,0x78,0x20,0x2f,0x20, 0x70,0x72,0x6f,0x6a,0x5f,0x7a,0x77,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x65,0x6e,0x63,0x6f, 0x64,0x65,0x5f,0x64,0x65,0x70,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b, 0x0a,0x7d,0x0a,0x0a,0x00, }; /* #version 410 uniform vec4 vs_display_params[13]; layout(location = 0) in vec4 pos; layout(location = 1) out vec4 light_proj_pos; layout(location = 2) out vec4 world_pos; layout(location = 3) out vec3 world_norm; layout(location = 1) in vec3 norm; layout(location = 0) out vec3 color; void main() { gl_Position = mat4(vs_display_params[0], vs_display_params[1], vs_display_params[2], vs_display_params[3]) * pos; light_proj_pos = mat4(vs_display_params[8], vs_display_params[9], vs_display_params[10], vs_display_params[11]) * pos; mat4 _39 = mat4(vs_display_params[4], vs_display_params[5], vs_display_params[6], vs_display_params[7]); world_pos = _39 * pos; world_norm = normalize((_39 * vec4(norm, 0.0)).xyz); color = vs_display_params[12].xyz; } */ static const uint8_t vs_display_source_glsl410[777] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x64,0x69, 0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,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,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x70, 0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74, 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63, 0x34,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x72,0x6f,0x6a,0x5f,0x70,0x6f,0x73, 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,0x76,0x65,0x63,0x34,0x20, 0x77,0x6f,0x72,0x6c,0x64,0x5f,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75, 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20, 0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x77,0x6f,0x72,0x6c,0x64,0x5f,0x6e, 0x6f,0x72,0x6d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61, 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63, 0x33,0x20,0x6e,0x6f,0x72,0x6d,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,0x33,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x6f, 0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, 0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d,0x61, 0x74,0x34,0x28,0x76,0x73,0x5f,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61, 0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x64,0x69,0x73,0x70, 0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x76, 0x73,0x5f,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, 0x5b,0x32,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x5f, 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x72,0x6f,0x6a, 0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x64, 0x69,0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x38,0x5d, 0x2c,0x20,0x76,0x73,0x5f,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72, 0x61,0x6d,0x73,0x5b,0x39,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x64,0x69,0x73,0x70,0x6c, 0x61,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x30,0x5d,0x2c,0x20,0x76, 0x73,0x5f,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, 0x5b,0x31,0x31,0x5d,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20, 0x20,0x6d,0x61,0x74,0x34,0x20,0x5f,0x33,0x39,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34, 0x28,0x76,0x73,0x5f,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61, 0x6d,0x73,0x5b,0x34,0x5d,0x2c,0x20,0x76,0x73,0x5f,0x64,0x69,0x73,0x70,0x6c,0x61, 0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35,0x5d,0x2c,0x20,0x76,0x73,0x5f, 0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36, 0x5d,0x2c,0x20,0x76,0x73,0x5f,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61, 0x72,0x61,0x6d,0x73,0x5b,0x37,0x5d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x77,0x6f, 0x72,0x6c,0x64,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x5f,0x33,0x39,0x20,0x2a,0x20, 0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x77,0x6f,0x72,0x6c,0x64,0x5f,0x6e, 0x6f,0x72,0x6d,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28, 0x28,0x5f,0x33,0x39,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x6e,0x6f,0x72,0x6d, 0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20, 0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x73,0x5f,0x64,0x69,0x73, 0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x32,0x5d,0x2e, 0x78,0x79,0x7a,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; /* #version 410 uniform vec4 fs_display_params[2]; uniform sampler2D shadow_map_shadow_sampler; layout(location = 3) in vec3 world_norm; layout(location = 1) in vec4 light_proj_pos; layout(location = 2) in vec4 world_pos; layout(location = 0) out vec4 frag_color; layout(location = 0) in vec3 color; float decodeDepth(vec4 rgba) { return dot(rgba, vec4(1.0, 0.0039215688593685626983642578125, 1.5378700481960549950599670410156e-05, 6.0308629201699659461155533790588e-08)); } float sample_shadow(vec2 uv, float compare, sampler2D SPIRV_Cross_Combinedtexsmp) { vec4 param = texture(SPIRV_Cross_Combinedtexsmp, vec2(uv.x, uv.y)); return step(compare, decodeDepth(param)); } float sample_shadow_pcf(vec3 uv_depth, vec2 sm_size, sampler2D SPIRV_Cross_Combinedtexsmp) { float result = 0.0; for (int x = -2; x <= 2; x++) { for (int y = -2; y <= 2; y++) { vec2 param = uv_depth.xy + (vec2(float(x), float(y)) / sm_size); float param_1 = uv_depth.z; result += sample_shadow(param, param_1, SPIRV_Cross_Combinedtexsmp); } } return result * 0.039999999105930328369140625; } vec4 gamma(vec4 c) { return vec4(pow(c.xyz, vec3(0.4545454680919647216796875)), c.w); } void main() { vec3 _161 = normalize(fs_display_params[0].xyz); vec3 _166 = normalize(world_norm); float _170 = dot(_166, _161); if (_170 > 0.0) { vec3 _184 = light_proj_pos.xyz / vec3(light_proj_pos.w); vec3 param = vec3((_184.xy + vec2(1.0)) * 0.5, _184.z); vec2 param_1 = vec2(textureSize(shadow_map_shadow_sampler, 0)); float _202 = sample_shadow_pcf(param, param_1, shadow_map_shadow_sampler); frag_color = vec4(vec3((pow(max(dot(reflect(-_161, _166), normalize(fs_display_params[1].xyz - world_pos.xyz)), 0.0), 2.2000000476837158203125) * _170) * _202) + (color * (max(_170 * _202, 0.0) + 0.25)), 1.0); } else { frag_color = vec4(color * 0.25, 1.0); } vec4 param_2 = frag_color; frag_color = gamma(param_2); } */ static const uint8_t fs_display_source_glsl410[2060] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x73,0x5f,0x64,0x69, 0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x3b, 0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72, 0x32,0x44,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x73,0x68, 0x61,0x64,0x6f,0x77,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x6c, 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, 0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x77,0x6f,0x72,0x6c, 0x64,0x5f,0x6e,0x6f,0x72,0x6d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20, 0x76,0x65,0x63,0x34,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x72,0x6f,0x6a,0x5f, 0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61, 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63, 0x34,0x20,0x77,0x6f,0x72,0x6c,0x64,0x5f,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79, 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30, 0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f, 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f, 0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76, 0x65,0x63,0x33,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x66,0x6c,0x6f,0x61, 0x74,0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x76,0x65, 0x63,0x34,0x20,0x72,0x67,0x62,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72, 0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x72,0x67,0x62,0x61,0x2c,0x20, 0x76,0x65,0x63,0x34,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x30,0x33,0x39, 0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32,0x36,0x39, 0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x31,0x2e,0x35, 0x33,0x37,0x38,0x37,0x30,0x30,0x34,0x38,0x31,0x39,0x36,0x30,0x35,0x34,0x39,0x39, 0x35,0x30,0x35,0x39,0x39,0x36,0x37,0x30,0x34,0x31,0x30,0x31,0x35,0x36,0x65,0x2d, 0x30,0x35,0x2c,0x20,0x36,0x2e,0x30,0x33,0x30,0x38,0x36,0x32,0x39,0x32,0x30,0x31, 0x36,0x39,0x39,0x36,0x35,0x39,0x34,0x36,0x31,0x31,0x35,0x35,0x35,0x33,0x33,0x37, 0x39,0x30,0x35,0x38,0x38,0x65,0x2d,0x30,0x38,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, 0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x68,0x61, 0x64,0x6f,0x77,0x28,0x76,0x65,0x63,0x32,0x20,0x75,0x76,0x2c,0x20,0x66,0x6c,0x6f, 0x61,0x74,0x20,0x63,0x6f,0x6d,0x70,0x61,0x72,0x65,0x2c,0x20,0x73,0x61,0x6d,0x70, 0x6c,0x65,0x72,0x32,0x44,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73, 0x73,0x5f,0x43,0x6f,0x6d,0x62,0x69,0x6e,0x65,0x64,0x74,0x65,0x78,0x73,0x6d,0x70, 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x61,0x72, 0x61,0x6d,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x53,0x50,0x49, 0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x43,0x6f,0x6d,0x62,0x69,0x6e,0x65, 0x64,0x74,0x65,0x78,0x73,0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x75,0x76, 0x2e,0x78,0x2c,0x20,0x75,0x76,0x2e,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x65,0x70,0x28,0x63,0x6f,0x6d,0x70, 0x61,0x72,0x65,0x2c,0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68, 0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f, 0x61,0x74,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77, 0x5f,0x70,0x63,0x66,0x28,0x76,0x65,0x63,0x33,0x20,0x75,0x76,0x5f,0x64,0x65,0x70, 0x74,0x68,0x2c,0x20,0x76,0x65,0x63,0x32,0x20,0x73,0x6d,0x5f,0x73,0x69,0x7a,0x65, 0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x53,0x50,0x49,0x52, 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x43,0x6f,0x6d,0x62,0x69,0x6e,0x65,0x64, 0x74,0x65,0x78,0x73,0x6d,0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, 0x6f,0x61,0x74,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x30,0x2e,0x30, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x78, 0x20,0x3d,0x20,0x2d,0x32,0x3b,0x20,0x78,0x20,0x3c,0x3d,0x20,0x32,0x3b,0x20,0x78, 0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x79,0x20,0x3d,0x20,0x2d, 0x32,0x3b,0x20,0x79,0x20,0x3c,0x3d,0x20,0x32,0x3b,0x20,0x79,0x2b,0x2b,0x29,0x0a, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d, 0x20,0x3d,0x20,0x75,0x76,0x5f,0x64,0x65,0x70,0x74,0x68,0x2e,0x78,0x79,0x20,0x2b, 0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x78,0x29,0x2c, 0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x79,0x29,0x29,0x20,0x2f,0x20,0x73,0x6d,0x5f, 0x73,0x69,0x7a,0x65,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, 0x20,0x3d,0x20,0x75,0x76,0x5f,0x64,0x65,0x70,0x74,0x68,0x2e,0x7a,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c, 0x74,0x20,0x2b,0x3d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x68,0x61,0x64, 0x6f,0x77,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, 0x31,0x2c,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x43, 0x6f,0x6d,0x62,0x69,0x6e,0x65,0x64,0x74,0x65,0x78,0x73,0x6d,0x70,0x29,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x73,0x75,0x6c, 0x74,0x20,0x2a,0x20,0x30,0x2e,0x30,0x33,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x31, 0x30,0x35,0x39,0x33,0x30,0x33,0x32,0x38,0x33,0x36,0x39,0x31,0x34,0x30,0x36,0x32, 0x35,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x63,0x34,0x20,0x67,0x61,0x6d,0x6d,0x61, 0x28,0x76,0x65,0x63,0x34,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72, 0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x65,0x63,0x34,0x28,0x70,0x6f,0x77,0x28,0x63, 0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x34,0x35,0x34, 0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36, 0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x2c,0x20,0x63,0x2e,0x77,0x29,0x3b,0x0a, 0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b, 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x36,0x31,0x20,0x3d, 0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x66,0x73,0x5f,0x64,0x69, 0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e, 0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f, 0x31,0x36,0x36,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28, 0x77,0x6f,0x72,0x6c,0x64,0x5f,0x6e,0x6f,0x72,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20, 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x37,0x30,0x20,0x3d,0x20,0x64,0x6f, 0x74,0x28,0x5f,0x31,0x36,0x36,0x2c,0x20,0x5f,0x31,0x36,0x31,0x29,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x37,0x30,0x20,0x3e,0x20,0x30,0x2e, 0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x38,0x34,0x20,0x3d,0x20,0x6c,0x69,0x67, 0x68,0x74,0x5f,0x70,0x72,0x6f,0x6a,0x5f,0x70,0x6f,0x73,0x2e,0x78,0x79,0x7a,0x20, 0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x6c,0x69,0x67,0x68,0x74,0x5f,0x70,0x72,0x6f, 0x6a,0x5f,0x70,0x6f,0x73,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x76, 0x65,0x63,0x33,0x28,0x28,0x5f,0x31,0x38,0x34,0x2e,0x78,0x79,0x20,0x2b,0x20,0x76, 0x65,0x63,0x32,0x28,0x31,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x2c, 0x20,0x5f,0x31,0x38,0x34,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d, 0x20,0x76,0x65,0x63,0x32,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x69,0x7a, 0x65,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x73,0x68,0x61, 0x64,0x6f,0x77,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x30,0x29,0x29, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, 0x5f,0x32,0x30,0x32,0x20,0x3d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x68, 0x61,0x64,0x6f,0x77,0x5f,0x70,0x63,0x66,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20, 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f, 0x6d,0x61,0x70,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x73,0x61,0x6d,0x70,0x6c, 0x65,0x72,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61, 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x76, 0x65,0x63,0x33,0x28,0x28,0x70,0x6f,0x77,0x28,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74, 0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x5f,0x31,0x36,0x31,0x2c,0x20, 0x5f,0x31,0x36,0x36,0x29,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65, 0x28,0x66,0x73,0x5f,0x64,0x69,0x73,0x70,0x6c,0x61,0x79,0x5f,0x70,0x61,0x72,0x61, 0x6d,0x73,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2d,0x20,0x77,0x6f,0x72,0x6c, 0x64,0x5f,0x70,0x6f,0x73,0x2e,0x78,0x79,0x7a,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30, 0x29,0x2c,0x20,0x32,0x2e,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x36,0x38, 0x33,0x37,0x31,0x35,0x38,0x32,0x30,0x33,0x31,0x32,0x35,0x29,0x20,0x2a,0x20,0x5f, 0x31,0x37,0x30,0x29,0x20,0x2a,0x20,0x5f,0x32,0x30,0x32,0x29,0x20,0x2b,0x20,0x28, 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x28,0x6d,0x61,0x78,0x28,0x5f,0x31,0x37, 0x30,0x20,0x2a,0x20,0x5f,0x32,0x30,0x32,0x2c,0x20,0x30,0x2e,0x30,0x29,0x20,0x2b, 0x20,0x30,0x2e,0x32,0x35,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,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,0x66,0x72,0x61,0x67, 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f, 0x6c,0x6f,0x72,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34, 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f, 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,0x61, 0x72,0x61,0x6d,0x5f,0x32,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; /* #version 410 layout(location = 0) in vec2 pos; layout(location = 0) out vec2 uv; void main() { gl_Position = vec4((pos * 2.0) - vec2(1.0), 0.5, 1.0); uv = pos; gl_Position.y = -gl_Position.y; } */ static const uint8_t vs_dbg_source_glsl410[210] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x6c,0x61, 0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, 0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73,0x3b,0x0a, 0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20, 0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76, 0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b, 0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, 0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x28,0x70,0x6f,0x73,0x20,0x2a,0x20,0x32, 0x2e,0x30,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x28,0x31,0x2e,0x30,0x29,0x2c, 0x20,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, 0x75,0x76,0x20,0x3d,0x20,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c, 0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x79,0x20,0x3d,0x20,0x2d,0x67, 0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x79,0x3b,0x0a,0x7d,0x0a, 0x0a,0x00, }; /* #version 410 uniform sampler2D dbg_tex_dbg_smp; layout(location = 0) in vec2 uv; layout(location = 0) out vec4 frag_color; float decodeDepth(vec4 rgba) { return dot(rgba, vec4(1.0, 0.0039215688593685626983642578125, 1.5378700481960549950599670410156e-05, 6.0308629201699659461155533790588e-08)); } void main() { vec4 param = texture(dbg_tex_dbg_smp, uv); float _40 = decodeDepth(param); frag_color = vec4(_40, _40, _40, 1.0); } */ static const uint8_t fs_dbg_source_glsl410[450] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20, 0x64,0x62,0x67,0x5f,0x74,0x65,0x78,0x5f,0x64,0x62,0x67,0x5f,0x73,0x6d,0x70,0x3b, 0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f, 0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x75, 0x76,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69, 0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34, 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x66,0x6c, 0x6f,0x61,0x74,0x20,0x64,0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28, 0x76,0x65,0x63,0x34,0x20,0x72,0x67,0x62,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x64,0x6f,0x74,0x28,0x72,0x67,0x62,0x61, 0x2c,0x20,0x76,0x65,0x63,0x34,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x30, 0x33,0x39,0x32,0x31,0x35,0x36,0x38,0x38,0x35,0x39,0x33,0x36,0x38,0x35,0x36,0x32, 0x36,0x39,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x31, 0x2e,0x35,0x33,0x37,0x38,0x37,0x30,0x30,0x34,0x38,0x31,0x39,0x36,0x30,0x35,0x34, 0x39,0x39,0x35,0x30,0x35,0x39,0x39,0x36,0x37,0x30,0x34,0x31,0x30,0x31,0x35,0x36, 0x65,0x2d,0x30,0x35,0x2c,0x20,0x36,0x2e,0x30,0x33,0x30,0x38,0x36,0x32,0x39,0x32, 0x30,0x31,0x36,0x39,0x39,0x36,0x35,0x39,0x34,0x36,0x31,0x31,0x35,0x35,0x35,0x33, 0x33,0x37,0x39,0x30,0x35,0x38,0x38,0x65,0x2d,0x30,0x38,0x29,0x29,0x3b,0x0a,0x7d, 0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a, 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d, 0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x62,0x67,0x5f,0x74,0x65,0x78, 0x5f,0x64,0x62,0x67,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x75,0x76,0x29,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x30,0x20,0x3d,0x20,0x64, 0x65,0x63,0x6f,0x64,0x65,0x44,0x65,0x70,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d, 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, 0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x34,0x30,0x2c,0x20,0x5f,0x34, 0x30,0x2c,0x20,0x5f,0x34,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a, 0x0a,0x00, }; static inline const sg_shader_desc* dbg_shader_desc(sg_backend backend) { if (backend == SG_BACKEND_GLCORE) { static sg_shader_desc desc; static bool valid; if (!valid) { valid = true; desc.attrs[0].name = "pos"; desc.vs.source = (const char*)vs_dbg_source_glsl410; desc.vs.entry = "main"; desc.fs.source = (const char*)fs_dbg_source_glsl410; desc.fs.entry = "main"; desc.fs.images[0].used = true; desc.fs.images[0].multisampled = false; desc.fs.images[0].image_type = SG_IMAGETYPE_2D; desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; desc.fs.samplers[0].used = true; desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; desc.fs.image_sampler_pairs[0].used = true; desc.fs.image_sampler_pairs[0].image_slot = 0; desc.fs.image_sampler_pairs[0].sampler_slot = 0; desc.fs.image_sampler_pairs[0].glsl_name = "dbg_tex_dbg_smp"; desc.label = "dbg_shader"; } return &desc; } return 0; } static inline const sg_shader_desc* display_shader_desc(sg_backend backend) { if (backend == SG_BACKEND_GLCORE) { static sg_shader_desc desc; static bool valid; if (!valid) { valid = true; desc.attrs[0].name = "pos"; desc.attrs[1].name = "norm"; desc.vs.source = (const char*)vs_display_source_glsl410; desc.vs.entry = "main"; desc.vs.uniform_blocks[0].size = 208; desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; desc.vs.uniform_blocks[0].uniforms[0].name = "vs_display_params"; desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; desc.vs.uniform_blocks[0].uniforms[0].array_count = 13; desc.fs.source = (const char*)fs_display_source_glsl410; desc.fs.entry = "main"; desc.fs.uniform_blocks[0].size = 32; desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; desc.fs.uniform_blocks[0].uniforms[0].name = "fs_display_params"; desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[0].array_count = 2; desc.fs.images[0].used = true; desc.fs.images[0].multisampled = false; desc.fs.images[0].image_type = SG_IMAGETYPE_2D; desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; desc.fs.samplers[0].used = true; desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; desc.fs.image_sampler_pairs[0].used = true; desc.fs.image_sampler_pairs[0].image_slot = 0; desc.fs.image_sampler_pairs[0].sampler_slot = 0; desc.fs.image_sampler_pairs[0].glsl_name = "shadow_map_shadow_sampler"; desc.label = "display_shader"; } return &desc; } return 0; } static inline const sg_shader_desc* shadow_shader_desc(sg_backend backend) { if (backend == SG_BACKEND_GLCORE) { static sg_shader_desc desc; static bool valid; if (!valid) { valid = true; desc.attrs[0].name = "pos"; desc.vs.source = (const char*)vs_shadow_source_glsl410; desc.vs.entry = "main"; desc.vs.uniform_blocks[0].size = 64; desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; desc.vs.uniform_blocks[0].uniforms[0].name = "vs_shadow_params"; desc.vs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; desc.vs.uniform_blocks[0].uniforms[0].array_count = 4; desc.fs.source = (const char*)fs_shadow_source_glsl410; desc.fs.entry = "main"; desc.label = "shadow_shader"; } return &desc; } return 0; }