From cf7e76aa8491ac2eeacdd7d7fa5de5c846e9f459 Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Mon, 21 Oct 2024 01:37:30 +0200 Subject: [PATCH] sokol: Delete old shader leftover --- Source/Render/sokol/shaders/terrain.h | 1436 ------------------------- 1 file changed, 1436 deletions(-) delete mode 100644 Source/Render/sokol/shaders/terrain.h diff --git a/Source/Render/sokol/shaders/terrain.h b/Source/Render/sokol/shaders/terrain.h deleted file mode 100644 index 9354b8a1..00000000 --- a/Source/Render/sokol/shaders/terrain.h +++ /dev/null @@ -1,1436 +0,0 @@ -#pragma once -/* - #version:1# (machine generated, don't edit!) - - Generated by sokol-shdc (https://github.com/floooh/sokol-tools) - - Cmdline: - sokol-shdc --input terrain.glsl --output terrain.h --slang glsl410:glsl300es:hlsl5:wgsl:metal_macos:metal_ios:metal_sim --format=sokol --reflection --ifdef --module terrain - - Overview: - ========= - Shader program: 'program': - Get shader desc: terrain_program_shader_desc(sg_query_backend()); - Vertex shader: vs - Attributes: - ATTR_terrain_vs_vs_position => 0 - ATTR_terrain_vs_vs_texcoord0 => 1 - Uniform block 'terrain_vs_params': - C struct: terrain_terrain_vs_params_t - Bind slot: SLOT_terrain_terrain_vs_params => 0 - Fragment shader: fs - Uniform block 'terrain_fs_params': - C struct: terrain_terrain_fs_params_t - Bind slot: SLOT_terrain_terrain_fs_params => 0 - Image 'un_tex0': - Image type: SG_IMAGETYPE_2D - Sample type: SG_IMAGESAMPLETYPE_FLOAT - Multisampled: false - Bind slot: SLOT_terrain_un_tex0 => 0 - Sampler 'un_sampler0': - Type: SG_SAMPLERTYPE_FILTERING - Bind slot: SLOT_terrain_un_sampler0 => 0 - Image Sampler Pair 'un_tex0_un_sampler0': - Image: un_tex0 - Sampler: un_sampler0 -*/ -#if !defined(SOKOL_GFX_INCLUDED) -#error "Please include sokol_gfx.h before terrain.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_terrain_vs_vs_position (0) -#define ATTR_terrain_vs_vs_texcoord0 (1) -#define SLOT_terrain_terrain_vs_params (0) -#define SLOT_terrain_terrain_fs_params (0) -#define SLOT_terrain_un_tex0 (0) -#define SLOT_terrain_un_sampler0 (0) -#pragma pack(push,1) -SOKOL_SHDC_ALIGN(16) typedef struct terrain_terrain_vs_params_t { - Mat4f un_mvp; -} terrain_terrain_vs_params_t; -#pragma pack(pop) -#pragma pack(push,1) -SOKOL_SHDC_ALIGN(16) typedef struct terrain_terrain_fs_params_t { - Vect4f un_tile_color; - float un_alpha_test; - uint8_t _pad_20[12]; -} terrain_terrain_fs_params_t; -#pragma pack(pop) -/* - #version 410 - - uniform vec4 terrain_vs_params[4]; - layout(location = 0) in vec3 vs_position; - layout(location = 0) out vec2 fs_uv0; - layout(location = 1) in vec2 vs_texcoord0; - - void main() - { - gl_Position = mat4(terrain_vs_params[0], terrain_vs_params[1], terrain_vs_params[2], terrain_vs_params[3]) * vec4(vs_position, 1.0); - fs_uv0 = vs_texcoord0; - } - -*/ -#if defined(SOKOL_GLCORE) -static const uint8_t terrain_vs_source_glsl410[355] = { - 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,0x74,0x65,0x72,0x72,0x61, - 0x69,0x6e,0x5f,0x76,0x73,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,0x33,0x20,0x76,0x73, - 0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75, - 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20, - 0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b, - 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, - 0x20,0x3d,0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x76,0x73, - 0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,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,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72, - 0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f, - 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x74,0x65, - 0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, - 0x32,0x5d,0x2c,0x20,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70, - 0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34, - 0x28,0x76,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e, - 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d, - 0x20,0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x7d, - 0x0a,0x0a,0x00, -}; -#endif -/* - #version 410 - - uniform vec4 terrain_fs_params[2]; - uniform sampler2D un_tex0_un_sampler0; - - layout(location = 0) out vec4 frag_color; - layout(location = 0) in vec2 fs_uv0; - - void main() - { - frag_color = terrain_fs_params[0] * texture(un_tex0_un_sampler0, fs_uv0); - if (terrain_fs_params[1].x >= frag_color.w) - { - discard; - } - } - -*/ -#if defined(SOKOL_GLCORE) -static const uint8_t terrain_fs_source_glsl410[342] = { - 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,0x74,0x65,0x72,0x72,0x61, - 0x69,0x6e,0x5f,0x66,0x73,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,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73,0x61, - 0x6d,0x70,0x6c,0x65,0x72,0x30,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28, - 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75, - 0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69, - 0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20, - 0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61, - 0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, - 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f, - 0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x20,0x2a,0x20,0x74, - 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75, - 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75, - 0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x74,0x65,0x72, - 0x72,0x61,0x69,0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31, - 0x5d,0x2e,0x78,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, -}; -#endif -/* - #version 300 es - - uniform vec4 terrain_vs_params[4]; - layout(location = 0) in vec3 vs_position; - out vec2 fs_uv0; - layout(location = 1) in vec2 vs_texcoord0; - - void main() - { - gl_Position = mat4(terrain_vs_params[0], terrain_vs_params[1], terrain_vs_params[2], terrain_vs_params[3]) * vec4(vs_position, 1.0); - fs_uv0 = vs_texcoord0; - } - -*/ -#if defined(SOKOL_GLES3) -static const uint8_t terrain_vs_source_glsl300es[337] = { - 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, - 0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x74,0x65, - 0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,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,0x33, - 0x20,0x76,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6f,0x75, - 0x74,0x20,0x76,0x65,0x63,0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x6c, - 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, - 0x20,0x31,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x76,0x73,0x5f,0x74, - 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,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, - 0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, - 0x73,0x5b,0x30,0x5d,0x2c,0x20,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73, - 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x74,0x65,0x72,0x72, - 0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d, - 0x2c,0x20,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72, - 0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x76, - 0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x76, - 0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x7d,0x0a,0x0a, - 0x00, -}; -#endif -/* - #version 300 es - precision mediump float; - precision highp int; - - uniform highp vec4 terrain_fs_params[2]; - uniform highp sampler2D un_tex0_un_sampler0; - - layout(location = 0) out highp vec4 frag_color; - in highp vec2 fs_uv0; - - void main() - { - frag_color = terrain_fs_params[0] * texture(un_tex0_un_sampler0, fs_uv0); - if (terrain_fs_params[1].x >= frag_color.w) - { - discard; - } - } - -*/ -#if defined(SOKOL_GLES3) -static const uint8_t terrain_fs_source_glsl300es[394] = { - 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, - 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, - 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, - 0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75, - 0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, - 0x34,0x20,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72, - 0x61,0x6d,0x73,0x5b,0x32,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20, - 0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20, - 0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c, - 0x65,0x72,0x30,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63, - 0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x68, - 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, - 0x65,0x63,0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x0a,0x76,0x6f,0x69, - 0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x72,0x72, - 0x61,0x69,0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d, - 0x20,0x2a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x75,0x6e,0x5f,0x74,0x65, - 0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20, - 0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x28,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61, - 0x6d,0x73,0x5b,0x31,0x5d,0x2e,0x78,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f, - 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, -}; -#endif -/* - cbuffer terrain_vs_params : register(b0) - { - row_major float4x4 _19_un_mvp : packoffset(c0); - }; - - - static float4 gl_Position; - static float3 vs_position; - static float2 fs_uv0; - static float2 vs_texcoord0; - - struct SPIRV_Cross_Input - { - float3 vs_position : TEXCOORD0; - float2 vs_texcoord0 : TEXCOORD1; - }; - - struct SPIRV_Cross_Output - { - float2 fs_uv0 : TEXCOORD0; - float4 gl_Position : SV_Position; - }; - - void vert_main() - { - gl_Position = mul(float4(vs_position, 1.0f), _19_un_mvp); - fs_uv0 = vs_texcoord0; - } - - SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) - { - vs_position = stage_input.vs_position; - vs_texcoord0 = stage_input.vs_texcoord0; - vert_main(); - SPIRV_Cross_Output stage_output; - stage_output.gl_Position = gl_Position; - stage_output.fs_uv0 = fs_uv0; - return stage_output; - } -*/ -#if defined(SOKOL_D3D11) -static const uint8_t terrain_vs_source_hlsl5[826] = { - 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f, - 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69, - 0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72, - 0x6f,0x77,0x5f,0x6d,0x61,0x6a,0x6f,0x72,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78, - 0x34,0x20,0x5f,0x31,0x39,0x5f,0x75,0x6e,0x5f,0x6d,0x76,0x70,0x20,0x3a,0x20,0x70, - 0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x7d, - 0x3b,0x0a,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73, - 0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x73,0x5f, - 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a, - 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x73, - 0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x0a,0x73,0x74,0x72, - 0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f, - 0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x33,0x20,0x76,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a, - 0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f, - 0x72,0x64,0x30,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x31,0x3b, - 0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52, - 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x73,0x5f,0x75, - 0x76,0x30,0x20,0x3a,0x20,0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f, - 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x53,0x56,0x5f,0x50,0x6f,0x73,0x69, - 0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x76, - 0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d, - 0x75,0x6c,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x76,0x73,0x5f,0x70,0x6f,0x73, - 0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x2c,0x20,0x5f,0x31, - 0x39,0x5f,0x75,0x6e,0x5f,0x6d,0x76,0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f, - 0x6f,0x72,0x64,0x30,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43, - 0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e, - 0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70, - 0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, - 0x6e,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e, - 0x76,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20, - 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x76,0x73,0x5f,0x74, - 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, - 0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53, - 0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75, - 0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74, - 0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x67, - 0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f, - 0x75,0x76,0x30,0x20,0x3d,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f, - 0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, -}; -#endif -/* - cbuffer terrain_fs_params : register(b0) - { - float4 _12_un_tile_color : packoffset(c0); - float _12_un_alpha_test : packoffset(c1); - }; - - Texture2D un_tex0 : register(t0); - SamplerState un_sampler0 : register(s0); - - static float4 frag_color; - static float2 fs_uv0; - - struct SPIRV_Cross_Input - { - float2 fs_uv0 : TEXCOORD0; - }; - - struct SPIRV_Cross_Output - { - float4 frag_color : SV_Target0; - }; - - void frag_main() - { - frag_color = _12_un_tile_color * un_tex0.Sample(un_sampler0, fs_uv0); - if (_12_un_alpha_test >= frag_color.w) - { - discard; - } - } - - SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) - { - fs_uv0 = stage_input.fs_uv0; - frag_main(); - SPIRV_Cross_Output stage_output; - stage_output.frag_color = frag_color; - return stage_output; - } -*/ -#if defined(SOKOL_D3D11) -static const uint8_t terrain_fs_source_hlsl5[785] = { - 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f, - 0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69, - 0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x32,0x5f,0x75,0x6e,0x5f,0x74,0x69,0x6c, - 0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66, - 0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x20,0x5f,0x31,0x32,0x5f,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61, - 0x5f,0x74,0x65,0x73,0x74,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73, - 0x65,0x74,0x28,0x63,0x31,0x29,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x54,0x65,0x78,0x74, - 0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x34,0x3e,0x20,0x75,0x6e, - 0x5f,0x74,0x65,0x78,0x30,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,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x20,0x3a, - 0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x73,0x30,0x29,0x3b,0x0a,0x0a, - 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72, - 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a, - 0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72, - 0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3a,0x20, - 0x54,0x45,0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73, - 0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73, - 0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x20,0x3a,0x20,0x53,0x56,0x5f,0x54,0x61,0x72,0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d, - 0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69, - 0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x32,0x5f,0x75,0x6e,0x5f,0x74,0x69, - 0x6c,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x75,0x6e,0x5f,0x74,0x65, - 0x78,0x30,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x5f,0x75,0x6e,0x5f,0x61, - 0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56, - 0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61, - 0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49, - 0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74, - 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d, - 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f, - 0x75,0x76,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61, - 0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f, - 0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61, - 0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73, - 0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, - 0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a, - 0x00, -}; -#endif -/* - #include - #include - - using namespace metal; - - struct terrain_vs_params - { - float4x4 un_mvp; - }; - - struct main0_out - { - float2 fs_uv0 [[user(locn0)]]; - float4 gl_Position [[position]]; - }; - - struct main0_in - { - float3 vs_position [[attribute(0)]]; - float2 vs_texcoord0 [[attribute(1)]]; - }; - - vertex main0_out main0(main0_in in [[stage_in]], constant terrain_vs_params& _19 [[buffer(0)]]) - { - main0_out out = {}; - out.gl_Position = _19.un_mvp * float4(in.vs_position, 1.0); - out.fs_uv0 = in.vs_texcoord0; - return out; - } - -*/ -#if defined(SOKOL_METAL) -static const uint8_t terrain_vs_source_metal_macos[564] = { - 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,0x74, - 0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, - 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20, - 0x75,0x6e,0x5f,0x6d,0x76,0x70,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75, - 0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30, - 0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f, - 0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63, - 0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28, - 0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, - 0x20,0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x5b,0x5b, - 0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b,0x0a, - 0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30, - 0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30, - 0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, - 0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x74,0x65, - 0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26, - 0x20,0x5f,0x31,0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29, - 0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f, - 0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, - 0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x75,0x6e,0x5f,0x6d,0x76,0x70,0x20,0x2a, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x76,0x73,0x5f,0x70,0x6f, - 0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x69, - 0x6e,0x2e,0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, - 0x7d,0x0a,0x0a,0x00, -}; -#endif -/* - #include - #include - - using namespace metal; - - struct terrain_fs_params - { - float4 un_tile_color; - float un_alpha_test; - }; - - struct main0_out - { - float4 frag_color [[color(0)]]; - }; - - struct main0_in - { - float2 fs_uv0 [[user(locn0)]]; - }; - - fragment main0_out main0(main0_in in [[stage_in]], constant terrain_fs_params& _12 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) - { - main0_out out = {}; - out.frag_color = _12.un_tile_color * un_tex0.sample(un_sampler0, in.fs_uv0); - if (_12.un_alpha_test >= out.frag_color.w) - { - discard_fragment(); - } - return out; - } - -*/ -#if defined(SOKOL_METAL) -static const uint8_t terrain_fs_source_metal_macos[659] = { - 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,0x74, - 0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, - 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,0x6e, - 0x5f,0x74,0x69,0x6c,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f, - 0x74,0x65,0x73,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,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b, - 0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, - 0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28, - 0x6c,0x6f,0x63,0x6e,0x30,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,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x74,0x65,0x72,0x72,0x61,0x69, - 0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x32, - 0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20, - 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e, - 0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,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,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x20,0x5b,0x5b,0x73, - 0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74, - 0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66, - 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x32,0x2e, - 0x75,0x6e,0x5f,0x74,0x69,0x6c,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20, - 0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75, - 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66, - 0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, - 0x5f,0x31,0x32,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73, - 0x74,0x20,0x3e,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61, - 0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, - 0x0a,0x0a,0x00, -}; -#endif -/* - #include - #include - - using namespace metal; - - struct terrain_vs_params - { - float4x4 un_mvp; - }; - - struct main0_out - { - float2 fs_uv0 [[user(locn0)]]; - float4 gl_Position [[position]]; - }; - - struct main0_in - { - float3 vs_position [[attribute(0)]]; - float2 vs_texcoord0 [[attribute(1)]]; - }; - - vertex main0_out main0(main0_in in [[stage_in]], constant terrain_vs_params& _19 [[buffer(0)]]) - { - main0_out out = {}; - out.gl_Position = _19.un_mvp * float4(in.vs_position, 1.0); - out.fs_uv0 = in.vs_texcoord0; - return out; - } - -*/ -#if defined(SOKOL_METAL) -static const uint8_t terrain_vs_source_metal_ios[564] = { - 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,0x74, - 0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, - 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20, - 0x75,0x6e,0x5f,0x6d,0x76,0x70,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75, - 0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30, - 0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f, - 0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63, - 0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28, - 0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, - 0x20,0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x5b,0x5b, - 0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b,0x0a, - 0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30, - 0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30, - 0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, - 0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x74,0x65, - 0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26, - 0x20,0x5f,0x31,0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29, - 0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f, - 0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, - 0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x75,0x6e,0x5f,0x6d,0x76,0x70,0x20,0x2a, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x76,0x73,0x5f,0x70,0x6f, - 0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x69, - 0x6e,0x2e,0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, - 0x7d,0x0a,0x0a,0x00, -}; -#endif -/* - #include - #include - - using namespace metal; - - struct terrain_fs_params - { - float4 un_tile_color; - float un_alpha_test; - }; - - struct main0_out - { - float4 frag_color [[color(0)]]; - }; - - struct main0_in - { - float2 fs_uv0 [[user(locn0)]]; - }; - - fragment main0_out main0(main0_in in [[stage_in]], constant terrain_fs_params& _12 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) - { - main0_out out = {}; - out.frag_color = _12.un_tile_color * un_tex0.sample(un_sampler0, in.fs_uv0); - if (_12.un_alpha_test >= out.frag_color.w) - { - discard_fragment(); - } - return out; - } - -*/ -#if defined(SOKOL_METAL) -static const uint8_t terrain_fs_source_metal_ios[659] = { - 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,0x74, - 0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, - 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,0x6e, - 0x5f,0x74,0x69,0x6c,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f, - 0x74,0x65,0x73,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,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b, - 0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, - 0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28, - 0x6c,0x6f,0x63,0x6e,0x30,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,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x74,0x65,0x72,0x72,0x61,0x69, - 0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x32, - 0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20, - 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e, - 0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,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,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x20,0x5b,0x5b,0x73, - 0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74, - 0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66, - 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x32,0x2e, - 0x75,0x6e,0x5f,0x74,0x69,0x6c,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20, - 0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75, - 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66, - 0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, - 0x5f,0x31,0x32,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73, - 0x74,0x20,0x3e,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61, - 0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, - 0x0a,0x0a,0x00, -}; -#endif -/* - #include - #include - - using namespace metal; - - struct terrain_vs_params - { - float4x4 un_mvp; - }; - - struct main0_out - { - float2 fs_uv0 [[user(locn0)]]; - float4 gl_Position [[position]]; - }; - - struct main0_in - { - float3 vs_position [[attribute(0)]]; - float2 vs_texcoord0 [[attribute(1)]]; - }; - - vertex main0_out main0(main0_in in [[stage_in]], constant terrain_vs_params& _19 [[buffer(0)]]) - { - main0_out out = {}; - out.gl_Position = _19.un_mvp * float4(in.vs_position, 1.0); - out.fs_uv0 = in.vs_texcoord0; - return out; - } - -*/ -#if defined(SOKOL_METAL) -static const uint8_t terrain_vs_source_metal_sim[564] = { - 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,0x74, - 0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, - 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20, - 0x75,0x6e,0x5f,0x6d,0x76,0x70,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75, - 0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30, - 0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f, - 0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63, - 0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28, - 0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, - 0x20,0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x5b,0x5b, - 0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b,0x0a, - 0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e,0x30, - 0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30, - 0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, - 0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x74,0x65, - 0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26, - 0x20,0x5f,0x31,0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29, - 0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f, - 0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, - 0x6e,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x75,0x6e,0x5f,0x6d,0x76,0x70,0x20,0x2a, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e,0x76,0x73,0x5f,0x70,0x6f, - 0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x69, - 0x6e,0x2e,0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, - 0x7d,0x0a,0x0a,0x00, -}; -#endif -/* - #include - #include - - using namespace metal; - - struct terrain_fs_params - { - float4 un_tile_color; - float un_alpha_test; - }; - - struct main0_out - { - float4 frag_color [[color(0)]]; - }; - - struct main0_in - { - float2 fs_uv0 [[user(locn0)]]; - }; - - fragment main0_out main0(main0_in in [[stage_in]], constant terrain_fs_params& _12 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) - { - main0_out out = {}; - out.frag_color = _12.un_tile_color * un_tex0.sample(un_sampler0, in.fs_uv0); - if (_12.un_alpha_test >= out.frag_color.w) - { - discard_fragment(); - } - return out; - } - -*/ -#if defined(SOKOL_METAL) -static const uint8_t terrain_fs_source_metal_sim[659] = { - 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,0x74, - 0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, - 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x75,0x6e, - 0x5f,0x74,0x69,0x6c,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f, - 0x74,0x65,0x73,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,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b, - 0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, - 0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x32,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28, - 0x6c,0x6f,0x63,0x6e,0x30,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,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x74,0x65,0x72,0x72,0x61,0x69, - 0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x32, - 0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20, - 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e, - 0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,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,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x20,0x5b,0x5b,0x73, - 0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74, - 0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66, - 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x32,0x2e, - 0x75,0x6e,0x5f,0x74,0x69,0x6c,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20, - 0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75, - 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66, - 0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, - 0x5f,0x31,0x32,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73, - 0x74,0x20,0x3e,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61, - 0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, - 0x0a,0x0a,0x00, -}; -#endif -/* - diagnostic(off, derivative_uniformity); - - struct terrain_vs_params { - /_ @offset(0) _/ - un_mvp : mat4x4f, - } - - @group(0) @binding(0) var x_19 : terrain_vs_params; - - var vs_position : vec3f; - - var fs_uv0 : vec2f; - - var vs_texcoord0 : vec2f; - - var gl_Position : vec4f; - - fn main_1() { - let x_22 : mat4x4f = x_19.un_mvp; - let x_26 : vec3f = vs_position; - gl_Position = (x_22 * vec4f(x_26.x, x_26.y, x_26.z, 1.0f)); - let x_40 : vec2f = vs_texcoord0; - fs_uv0 = x_40; - return; - } - - struct main_out { - @builtin(position) - gl_Position : vec4f, - @location(0) - fs_uv0_1 : vec2f, - } - - @vertex - fn main(@location(0) vs_position_param : vec3f, @location(1) vs_texcoord0_param : vec2f) -> main_out { - vs_position = vs_position_param; - vs_texcoord0 = vs_texcoord0_param; - main_1(); - return main_out(gl_Position, fs_uv0); - } - -*/ -#if defined(SOKOL_WGPU) -static const uint8_t terrain_vs_source_wgsl[858] = { - 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, - 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, - 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, - 0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, - 0x73,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74, - 0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,0x20,0x75,0x6e,0x5f,0x6d,0x76,0x70,0x20, - 0x3a,0x20,0x6d,0x61,0x74,0x34,0x78,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x67, - 0x72,0x6f,0x75,0x70,0x28,0x30,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67, - 0x28,0x30,0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x3e, - 0x20,0x78,0x5f,0x31,0x39,0x20,0x3a,0x20,0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f, - 0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c, - 0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x76,0x73,0x5f,0x70,0x6f,0x73,0x69, - 0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x0a,0x76, - 0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x73,0x5f,0x75, - 0x76,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72, - 0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x76,0x73,0x5f,0x74,0x65,0x78, - 0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x3b,0x0a, - 0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x67,0x6c, - 0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34, - 0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x20, - 0x7b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x32,0x20,0x3a,0x20,0x6d, - 0x61,0x74,0x34,0x78,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x39,0x2e,0x75,0x6e, - 0x5f,0x6d,0x76,0x70,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x36, - 0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x73,0x5f,0x70,0x6f, - 0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73, - 0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x28,0x78,0x5f,0x32,0x32,0x20,0x2a,0x20, - 0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x32,0x36,0x2e,0x78,0x2c,0x20,0x78,0x5f, - 0x32,0x36,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x32,0x36,0x2e,0x7a,0x2c,0x20,0x31,0x2e, - 0x30,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x30, - 0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x76,0x73,0x5f,0x74,0x65, - 0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x3b,0x0a,0x20,0x20,0x66,0x73,0x5f,0x75,0x76, - 0x30,0x20,0x3d,0x20,0x78,0x5f,0x34,0x30,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61, - 0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x62,0x75,0x69,0x6c, - 0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20, - 0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65, - 0x63,0x34,0x66,0x2c,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, - 0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x5f,0x31,0x20,0x3a, - 0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x76,0x65,0x72,0x74, - 0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61, - 0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x76,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x33, - 0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20, - 0x76,0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,0x61,0x72, - 0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d, - 0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x76,0x73,0x5f,0x70, - 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x73,0x5f,0x70,0x6f,0x73, - 0x69,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x76, - 0x73,0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x20,0x3d,0x20,0x76,0x73, - 0x5f,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d, - 0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28, - 0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x66,0x73,0x5f, - 0x75,0x76,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, -}; -#endif -/* - diagnostic(off, derivative_uniformity); - - struct terrain_fs_params { - /_ @offset(0) _/ - un_tile_color : vec4f, - /_ @offset(16) _/ - un_alpha_test : f32, - } - - var frag_color : vec4f; - - @group(0) @binding(4) var x_12 : terrain_fs_params; - - @group(1) @binding(48) var un_tex0 : texture_2d; - - @group(1) @binding(64) var un_sampler0 : sampler; - - var fs_uv0 : vec2f; - - fn main_1() { - let x_17 : vec4f = x_12.un_tile_color; - let x_31 : vec2f = fs_uv0; - let x_32 : vec4f = textureSample(un_tex0, un_sampler0, x_31); - frag_color = (x_17 * x_32); - let x_37 : f32 = x_12.un_alpha_test; - let x_42 : f32 = frag_color.w; - if ((x_37 >= x_42)) { - discard; - } - return; - } - - struct main_out { - @location(0) - frag_color_1 : vec4f, - } - - @fragment - fn main(@location(0) fs_uv0_param : vec2f) -> main_out { - fs_uv0 = fs_uv0_param; - main_1(); - return main_out(frag_color); - } - -*/ -#if defined(SOKOL_WGPU) -static const uint8_t terrain_fs_source_wgsl[893] = { - 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, - 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, - 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, - 0x74,0x65,0x72,0x72,0x61,0x69,0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, - 0x73,0x20,0x7b,0x0a,0x20,0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74, - 0x28,0x30,0x29,0x20,0x2a,0x2f,0x0a,0x20,0x20,0x75,0x6e,0x5f,0x74,0x69,0x6c,0x65, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a, - 0x20,0x20,0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x31,0x36,0x29, - 0x20,0x2a,0x2f,0x0a,0x20,0x20,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74, - 0x65,0x73,0x74,0x20,0x3a,0x20,0x66,0x33,0x32,0x2c,0x0a,0x7d,0x0a,0x0a,0x76,0x61, - 0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f, - 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a, - 0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69, - 0x6e,0x67,0x28,0x34,0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69,0x66,0x6f,0x72, - 0x6d,0x3e,0x20,0x78,0x5f,0x31,0x32,0x20,0x3a,0x20,0x74,0x65,0x72,0x72,0x61,0x69, - 0x6e,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a,0x40,0x67, - 0x72,0x6f,0x75,0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67, - 0x28,0x34,0x38,0x29,0x20,0x76,0x61,0x72,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30, - 0x20,0x3a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x32,0x64,0x3c,0x66,0x33, - 0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x31,0x29,0x20,0x40, - 0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x36,0x34,0x29,0x20,0x76,0x61,0x72,0x20, - 0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x20,0x3a,0x20,0x73,0x61, - 0x6d,0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76, - 0x61,0x74,0x65,0x3e,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3a,0x20,0x76,0x65, - 0x63,0x32,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28, - 0x29,0x20,0x7b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x37,0x20,0x3a, - 0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x2e,0x75,0x6e, - 0x5f,0x74,0x69,0x6c,0x65,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x6c, - 0x65,0x74,0x20,0x78,0x5f,0x33,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20, - 0x3d,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20, - 0x78,0x5f,0x33,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74, - 0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f, - 0x74,0x65,0x78,0x30,0x2c,0x20,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72, - 0x30,0x2c,0x20,0x78,0x5f,0x33,0x31,0x29,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x28,0x78,0x5f,0x31,0x37,0x20,0x2a, - 0x20,0x78,0x5f,0x33,0x32,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, - 0x33,0x37,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x2e, - 0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x3b,0x0a,0x20, - 0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x32,0x20,0x3a,0x20,0x66,0x33,0x32,0x20, - 0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x3b,0x0a, - 0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x78,0x5f,0x33,0x37,0x20,0x3e,0x3d,0x20,0x78, - 0x5f,0x34,0x32,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63, - 0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x7d,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69, - 0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74, - 0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d, - 0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d, - 0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29, - 0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20, - 0x76,0x65,0x63,0x32,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f, - 0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20, - 0x66,0x73,0x5f,0x75,0x76,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20, - 0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, -}; -#endif -static inline const sg_shader_desc* terrain_program_shader_desc(sg_backend backend) { - #if defined(SOKOL_GLCORE) - if (backend == SG_BACKEND_GLCORE) { - static sg_shader_desc desc; - static bool valid; - if (!valid) { - valid = true; - desc.attrs[0].name = "vs_position"; - desc.attrs[1].name = "vs_texcoord0"; - desc.vs.source = (const char*)terrain_vs_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 = "terrain_vs_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*)terrain_fs_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 = "terrain_fs_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 = "un_tex0_un_sampler0"; - desc.label = "terrain_program_shader"; - } - return &desc; - } - #endif /* SOKOL_GLCORE */ - #if defined(SOKOL_GLES3) - if (backend == SG_BACKEND_GLES3) { - static sg_shader_desc desc; - static bool valid; - if (!valid) { - valid = true; - desc.attrs[0].name = "vs_position"; - desc.attrs[1].name = "vs_texcoord0"; - desc.vs.source = (const char*)terrain_vs_source_glsl300es; - 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 = "terrain_vs_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*)terrain_fs_source_glsl300es; - 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 = "terrain_fs_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 = "un_tex0_un_sampler0"; - desc.label = "terrain_program_shader"; - } - return &desc; - } - #endif /* SOKOL_GLES3 */ - #if defined(SOKOL_D3D11) - if (backend == SG_BACKEND_D3D11) { - static sg_shader_desc desc; - static bool valid; - if (!valid) { - valid = true; - desc.attrs[0].sem_name = "TEXCOORD"; - desc.attrs[0].sem_index = 0; - desc.attrs[1].sem_name = "TEXCOORD"; - desc.attrs[1].sem_index = 1; - desc.vs.source = (const char*)terrain_vs_source_hlsl5; - desc.vs.d3d11_target = "vs_5_0"; - desc.vs.entry = "main"; - desc.vs.uniform_blocks[0].size = 64; - desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.source = (const char*)terrain_fs_source_hlsl5; - desc.fs.d3d11_target = "ps_5_0"; - desc.fs.entry = "main"; - desc.fs.uniform_blocks[0].size = 32; - desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.images[0].used = true; - desc.fs.images[0].multisampled = false; - desc.fs.images[0].image_type = SG_IMAGETYPE_2D; - desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; - desc.fs.samplers[0].used = true; - desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; - desc.fs.image_sampler_pairs[0].used = true; - desc.fs.image_sampler_pairs[0].image_slot = 0; - desc.fs.image_sampler_pairs[0].sampler_slot = 0; - desc.label = "terrain_program_shader"; - } - return &desc; - } - #endif /* SOKOL_D3D11 */ - #if defined(SOKOL_METAL) - if (backend == SG_BACKEND_METAL_MACOS) { - static sg_shader_desc desc; - static bool valid; - if (!valid) { - valid = true; - desc.vs.source = (const char*)terrain_vs_source_metal_macos; - desc.vs.entry = "main0"; - desc.vs.uniform_blocks[0].size = 64; - desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.source = (const char*)terrain_fs_source_metal_macos; - desc.fs.entry = "main0"; - desc.fs.uniform_blocks[0].size = 32; - desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.images[0].used = true; - desc.fs.images[0].multisampled = false; - desc.fs.images[0].image_type = SG_IMAGETYPE_2D; - desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; - desc.fs.samplers[0].used = true; - desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; - desc.fs.image_sampler_pairs[0].used = true; - desc.fs.image_sampler_pairs[0].image_slot = 0; - desc.fs.image_sampler_pairs[0].sampler_slot = 0; - desc.label = "terrain_program_shader"; - } - return &desc; - } - #endif /* SOKOL_METAL */ - #if defined(SOKOL_METAL) - if (backend == SG_BACKEND_METAL_IOS) { - static sg_shader_desc desc; - static bool valid; - if (!valid) { - valid = true; - desc.vs.source = (const char*)terrain_vs_source_metal_ios; - desc.vs.entry = "main0"; - desc.vs.uniform_blocks[0].size = 64; - desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.source = (const char*)terrain_fs_source_metal_ios; - desc.fs.entry = "main0"; - desc.fs.uniform_blocks[0].size = 32; - desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.images[0].used = true; - desc.fs.images[0].multisampled = false; - desc.fs.images[0].image_type = SG_IMAGETYPE_2D; - desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; - desc.fs.samplers[0].used = true; - desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; - desc.fs.image_sampler_pairs[0].used = true; - desc.fs.image_sampler_pairs[0].image_slot = 0; - desc.fs.image_sampler_pairs[0].sampler_slot = 0; - desc.label = "terrain_program_shader"; - } - return &desc; - } - #endif /* SOKOL_METAL */ - #if defined(SOKOL_METAL) - if (backend == SG_BACKEND_METAL_SIMULATOR) { - static sg_shader_desc desc; - static bool valid; - if (!valid) { - valid = true; - desc.vs.source = (const char*)terrain_vs_source_metal_sim; - desc.vs.entry = "main0"; - desc.vs.uniform_blocks[0].size = 64; - desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.source = (const char*)terrain_fs_source_metal_sim; - desc.fs.entry = "main0"; - desc.fs.uniform_blocks[0].size = 32; - desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.images[0].used = true; - desc.fs.images[0].multisampled = false; - desc.fs.images[0].image_type = SG_IMAGETYPE_2D; - desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; - desc.fs.samplers[0].used = true; - desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; - desc.fs.image_sampler_pairs[0].used = true; - desc.fs.image_sampler_pairs[0].image_slot = 0; - desc.fs.image_sampler_pairs[0].sampler_slot = 0; - desc.label = "terrain_program_shader"; - } - return &desc; - } - #endif /* SOKOL_METAL */ - #if defined(SOKOL_WGPU) - if (backend == SG_BACKEND_WGPU) { - static sg_shader_desc desc; - static bool valid; - if (!valid) { - valid = true; - desc.vs.source = (const char*)terrain_vs_source_wgsl; - desc.vs.entry = "main"; - desc.vs.uniform_blocks[0].size = 64; - desc.vs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.source = (const char*)terrain_fs_source_wgsl; - desc.fs.entry = "main"; - desc.fs.uniform_blocks[0].size = 32; - desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.images[0].used = true; - desc.fs.images[0].multisampled = false; - desc.fs.images[0].image_type = SG_IMAGETYPE_2D; - desc.fs.images[0].sample_type = SG_IMAGESAMPLETYPE_FLOAT; - desc.fs.samplers[0].used = true; - desc.fs.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; - desc.fs.image_sampler_pairs[0].used = true; - desc.fs.image_sampler_pairs[0].image_slot = 0; - desc.fs.image_sampler_pairs[0].sampler_slot = 0; - desc.label = "terrain_program_shader"; - } - return &desc; - } - #endif /* SOKOL_WGPU */ - return 0; -} -static inline int terrain_program_attr_slot(const char* attr_name) { - (void)attr_name; - if (0 == strcmp(attr_name, "vs_position")) { - return 0; - } - if (0 == strcmp(attr_name, "vs_texcoord0")) { - return 1; - } - return -1; -} -static inline int terrain_program_image_slot(sg_shader_stage stage, const char* img_name) { - (void)stage; (void)img_name; - if (SG_SHADERSTAGE_FS == stage) { - if (0 == strcmp(img_name, "un_tex0")) { - return 0; - } - } - return -1; -} -static inline int terrain_program_sampler_slot(sg_shader_stage stage, const char* smp_name) { - (void)stage; (void)smp_name; - if (SG_SHADERSTAGE_FS == stage) { - if (0 == strcmp(smp_name, "un_sampler0")) { - return 0; - } - } - return -1; -} -static inline int terrain_program_uniformblock_slot(sg_shader_stage stage, const char* ub_name) { - (void)stage; (void)ub_name; - if (SG_SHADERSTAGE_VS == stage) { - if (0 == strcmp(ub_name, "terrain_vs_params")) { - return 0; - } - } - if (SG_SHADERSTAGE_FS == stage) { - if (0 == strcmp(ub_name, "terrain_fs_params")) { - return 0; - } - } - return -1; -} -static inline size_t terrain_program_uniformblock_size(sg_shader_stage stage, const char* ub_name) { - (void)stage; (void)ub_name; - if (SG_SHADERSTAGE_VS == stage) { - if (0 == strcmp(ub_name, "terrain_vs_params")) { - return sizeof(terrain_terrain_vs_params_t); - } - } - if (SG_SHADERSTAGE_FS == stage) { - if (0 == strcmp(ub_name, "terrain_fs_params")) { - return sizeof(terrain_terrain_fs_params_t); - } - } - return 0; -} -static inline int terrain_program_uniform_offset(sg_shader_stage stage, const char* ub_name, const char* u_name) { - (void)stage; (void)ub_name; (void)u_name; - if (SG_SHADERSTAGE_VS == stage) { - if (0 == strcmp(ub_name, "terrain_vs_params")) { - if (0 == strcmp(u_name, "un_mvp")) { - return 0; - } - } - } - if (SG_SHADERSTAGE_FS == stage) { - if (0 == strcmp(ub_name, "terrain_fs_params")) { - if (0 == strcmp(u_name, "un_tile_color")) { - return 0; - } - if (0 == strcmp(u_name, "un_alpha_test")) { - return 16; - } - } - } - return -1; -} -static inline sg_shader_uniform_desc terrain_program_uniform_desc(sg_shader_stage stage, const char* ub_name, const char* u_name) { - (void)stage; (void)ub_name; (void)u_name; - #if defined(__cplusplus) - sg_shader_uniform_desc desc = {}; - #else - sg_shader_uniform_desc desc = {0}; - #endif - if (SG_SHADERSTAGE_VS == stage) { - if (0 == strcmp(ub_name, "terrain_vs_params")) { - if (0 == strcmp(u_name, "un_mvp")) { - desc.name = "un_mvp"; - desc.type = SG_UNIFORMTYPE_MAT4; - desc.array_count = 0; - return desc; - } - } - } - if (SG_SHADERSTAGE_FS == stage) { - if (0 == strcmp(ub_name, "terrain_fs_params")) { - if (0 == strcmp(u_name, "un_tile_color")) { - desc.name = "un_tile_color"; - desc.type = SG_UNIFORMTYPE_FLOAT4; - desc.array_count = 0; - return desc; - } - if (0 == strcmp(u_name, "un_alpha_test")) { - desc.name = "un_alpha_test"; - desc.type = SG_UNIFORMTYPE_FLOAT; - desc.array_count = 0; - return desc; - } - } - } - return desc; -} -static inline int terrain_program_storagebuffer_slot(sg_shader_stage stage, const char* sbuf_name) { - (void)stage; (void)sbuf_name; - return -1; -}