#pragma once /* #version:1# (machine generated, don't edit!) Generated by sokol-shdc (https://github.com/floooh/sokol-tools) Cmdline: sokol-shdc --input E:/box/box3d/samples/shaders/post/tonemap.glsl --output E:/box/box3d/samples/shaders/generated/tonemap.glsl.h --slang hlsl5:metal_macos:glsl430 Overview: ========= Shader program: 'prog': Get shader desc: tonemap_prog_shader_desc(sg_query_backend()); Vertex Shader: vs Fragment Shader: fs Attributes: Bindings: Uniform block 'ub_tonemap': C struct: tonemap_ub_tonemap_t Bind slot: UB_tonemap_ub_tonemap => 0 Texture 'tex_scene': Image type: SG_IMAGETYPE_2D Sample type: SG_IMAGESAMPLETYPE_FLOAT Multisampled: false Bind slot: VIEW_tonemap_tex_scene => 0 Sampler 'smp_scene': Type: SG_SAMPLERTYPE_FILTERING Bind slot: SMP_tonemap_smp_scene => 0 */ #if !defined(SOKOL_GFX_INCLUDED) #error "Please include sokol_gfx.h before tonemap.glsl.h" #endif #if !defined(SOKOL_SHDC_ALIGN) #if defined(_MSC_VER) #define SOKOL_SHDC_ALIGN(a) __declspec(align(a)) #else #define SOKOL_SHDC_ALIGN(a) __attribute__((aligned(a))) #endif #endif #define UB_tonemap_ub_tonemap (0) #define VIEW_tonemap_tex_scene (0) #define SMP_tonemap_smp_scene (0) #pragma pack(push,1) SOKOL_SHDC_ALIGN(16) typedef struct tonemap_ub_tonemap_t { Vec4 params; } tonemap_ub_tonemap_t; #pragma pack(pop) /* #version 430 layout(location = 0) out vec2 v_uv; void main() { vec2 _27 = (vec2(float((gl_VertexID << 1) & 2), float(gl_VertexID & 2)) * 2.0) - vec2(1.0); v_uv = (_27 * 0.5) + vec2(0.5); gl_Position = vec4(_27, 0.0, 1.0); } */ static const uint8_t tonemap_vs_source_glsl430[240] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,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,0x32,0x20,0x76,0x5f,0x75,0x76, 0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b, 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x32,0x37,0x20,0x3d,0x20, 0x28,0x76,0x65,0x63,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x67,0x6c,0x5f, 0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x20,0x3c,0x3c,0x20,0x31,0x29,0x20,0x26, 0x20,0x32,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65, 0x72,0x74,0x65,0x78,0x49,0x44,0x20,0x26,0x20,0x32,0x29,0x29,0x20,0x2a,0x20,0x32, 0x2e,0x30,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x28,0x31,0x2e,0x30,0x29,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x75,0x76,0x20,0x3d,0x20,0x28,0x5f,0x32,0x37, 0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x30, 0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69, 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x32,0x37,0x2c, 0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; /* #version 430 uniform vec4 ub_tonemap[1]; layout(binding = 0) uniform sampler2D tex_scene_smp_scene; layout(location = 0) in vec2 v_uv; layout(location = 0) out vec4 out_color; vec3 agxDefaultContrastApprox(vec3 x) { vec3 _28 = x * x; vec3 _32 = _28 * _28; return (((((((_32 * 15.5) * _28) - ((_32 * 40.1399993896484375) * x)) + (_32 * 31.95999908447265625)) - ((_28 * 6.868000030517578125) * x)) + (_28 * 0.4298000037670135498046875)) + (x * 0.119099996984004974365234375)) - vec3(0.002319999970495700836181640625); } vec3 agx(inout vec3 v) { v = mat3(vec3(0.842479050159454345703125, 0.0423282422125339508056640625, 0.0423756539821624755859375), vec3(0.0784336030483245849609375, 0.87846863269805908203125, 0.0784336030483245849609375), vec3(0.079223744571208953857421875, 0.07916612923145294189453125, 0.8791429996490478515625)) * v; v = max(v, vec3(1.0000000133514319600180897396058e-10)); v = clamp(log2(v), vec3(-12.47393035888671875), vec3(4.026069164276123046875)); v = (v - vec3(-12.47393035888671875)) * vec3(0.0606060661375522613525390625); vec3 param = v; v = agxDefaultContrastApprox(param); return v; } vec3 agxLook(vec3 v, float saturation) { vec3 _133 = vec3(dot(v, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875))); return _133 + ((v - _133) * saturation); } vec3 agxOutset(vec3 v) { return mat3(vec3(1.19687902927398681640625, -0.0528968535363674163818359375, -0.0529716350138187408447265625), vec3(-0.0980208814144134521484375, 1.1519031524658203125, -0.098043449223041534423828125), vec3(-0.099029742181301116943359375, -0.098961174488067626953125, 1.1510736942291259765625)) * v; } void main() { float _155; if (ub_tonemap[0].y > 0.0) { _155 = v_uv.y; } else { _155 = 1.0 - v_uv.y; } vec3 param = textureLod(tex_scene_smp_scene, vec2(v_uv.x, _155), 0.0).xyz * pow(2.0, ub_tonemap[0].x); vec3 _197 = agx(param); vec3 param_1 = _197; float param_2 = ub_tonemap[0].z; vec3 param_3 = agxLook(param_1, param_2); out_color = vec4(clamp(agxOutset(param_3), vec3(0.0), vec3(1.0)), 1.0); } */ static const uint8_t tonemap_fs_source_glsl430[2169] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x75,0x6e, 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x75,0x62,0x5f,0x74,0x6f, 0x6e,0x65,0x6d,0x61,0x70,0x5b,0x31,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74, 0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x30,0x29,0x20,0x75,0x6e, 0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20, 0x74,0x65,0x78,0x5f,0x73,0x63,0x65,0x6e,0x65,0x5f,0x73,0x6d,0x70,0x5f,0x73,0x63, 0x65,0x6e,0x65,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63, 0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65, 0x63,0x32,0x20,0x76,0x5f,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,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 0x3b,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x61,0x67,0x78,0x44,0x65,0x66,0x61,0x75, 0x6c,0x74,0x43,0x6f,0x6e,0x74,0x72,0x61,0x73,0x74,0x41,0x70,0x70,0x72,0x6f,0x78, 0x28,0x76,0x65,0x63,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76, 0x65,0x63,0x33,0x20,0x5f,0x32,0x38,0x20,0x3d,0x20,0x78,0x20,0x2a,0x20,0x78,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x32,0x20,0x3d,0x20, 0x5f,0x32,0x38,0x20,0x2a,0x20,0x5f,0x32,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, 0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x5f,0x33,0x32, 0x20,0x2a,0x20,0x31,0x35,0x2e,0x35,0x29,0x20,0x2a,0x20,0x5f,0x32,0x38,0x29,0x20, 0x2d,0x20,0x28,0x28,0x5f,0x33,0x32,0x20,0x2a,0x20,0x34,0x30,0x2e,0x31,0x33,0x39, 0x39,0x39,0x39,0x33,0x38,0x39,0x36,0x34,0x38,0x34,0x33,0x37,0x35,0x29,0x20,0x2a, 0x20,0x78,0x29,0x29,0x20,0x2b,0x20,0x28,0x5f,0x33,0x32,0x20,0x2a,0x20,0x33,0x31, 0x2e,0x39,0x35,0x39,0x39,0x39,0x39,0x30,0x38,0x34,0x34,0x37,0x32,0x36,0x35,0x36, 0x32,0x35,0x29,0x29,0x20,0x2d,0x20,0x28,0x28,0x5f,0x32,0x38,0x20,0x2a,0x20,0x36, 0x2e,0x38,0x36,0x38,0x30,0x30,0x30,0x30,0x33,0x30,0x35,0x31,0x37,0x35,0x37,0x38, 0x31,0x32,0x35,0x29,0x20,0x2a,0x20,0x78,0x29,0x29,0x20,0x2b,0x20,0x28,0x5f,0x32, 0x38,0x20,0x2a,0x20,0x30,0x2e,0x34,0x32,0x39,0x38,0x30,0x30,0x30,0x30,0x33,0x37, 0x36,0x37,0x30,0x31,0x33,0x35,0x34,0x39,0x38,0x30,0x34,0x36,0x38,0x37,0x35,0x29, 0x29,0x20,0x2b,0x20,0x28,0x78,0x20,0x2a,0x20,0x30,0x2e,0x31,0x31,0x39,0x30,0x39, 0x39,0x39,0x39,0x36,0x39,0x38,0x34,0x30,0x30,0x34,0x39,0x37,0x34,0x33,0x36,0x35, 0x32,0x33,0x34,0x33,0x37,0x35,0x29,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x33,0x28, 0x30,0x2e,0x30,0x30,0x32,0x33,0x31,0x39,0x39,0x39,0x39,0x39,0x37,0x30,0x34,0x39, 0x35,0x37,0x30,0x30,0x38,0x33,0x36,0x31,0x38,0x31,0x36,0x34,0x30,0x36,0x32,0x35, 0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x61,0x67,0x78,0x28,0x69, 0x6e,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x29,0x0a,0x7b,0x0a,0x20, 0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33, 0x28,0x30,0x2e,0x38,0x34,0x32,0x34,0x37,0x39,0x30,0x35,0x30,0x31,0x35,0x39,0x34, 0x35,0x34,0x33,0x34,0x35,0x37,0x30,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30, 0x34,0x32,0x33,0x32,0x38,0x32,0x34,0x32,0x32,0x31,0x32,0x35,0x33,0x33,0x39,0x35, 0x30,0x38,0x30,0x35,0x36,0x36,0x34,0x30,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30, 0x34,0x32,0x33,0x37,0x35,0x36,0x35,0x33,0x39,0x38,0x32,0x31,0x36,0x32,0x34,0x37, 0x35,0x35,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28, 0x30,0x2e,0x30,0x37,0x38,0x34,0x33,0x33,0x36,0x30,0x33,0x30,0x34,0x38,0x33,0x32, 0x34,0x35,0x38,0x34,0x39,0x36,0x30,0x39,0x33,0x37,0x35,0x2c,0x20,0x30,0x2e,0x38, 0x37,0x38,0x34,0x36,0x38,0x36,0x33,0x32,0x36,0x39,0x38,0x30,0x35,0x39,0x30,0x38, 0x32,0x30,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x38,0x34,0x33,0x33, 0x36,0x30,0x33,0x30,0x34,0x38,0x33,0x32,0x34,0x35,0x38,0x34,0x39,0x36,0x30,0x39, 0x33,0x37,0x35,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x37,0x39, 0x32,0x32,0x33,0x37,0x34,0x34,0x35,0x37,0x31,0x32,0x30,0x38,0x39,0x35,0x33,0x38, 0x35,0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x39,0x31, 0x36,0x36,0x31,0x32,0x39,0x32,0x33,0x31,0x34,0x35,0x32,0x39,0x34,0x31,0x38,0x39, 0x34,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x38,0x37,0x39,0x31,0x34,0x32, 0x39,0x39,0x39,0x36,0x34,0x39,0x30,0x34,0x37,0x38,0x35,0x31,0x35,0x36,0x32,0x35, 0x29,0x29,0x20,0x2a,0x20,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x20,0x3d,0x20, 0x6d,0x61,0x78,0x28,0x76,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x30, 0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x33,0x35,0x31,0x34,0x33,0x31,0x39,0x36,0x30, 0x30,0x31,0x38,0x30,0x38,0x39,0x37,0x33,0x39,0x36,0x30,0x35,0x38,0x65,0x2d,0x31, 0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x63,0x6c,0x61, 0x6d,0x70,0x28,0x6c,0x6f,0x67,0x32,0x28,0x76,0x29,0x2c,0x20,0x76,0x65,0x63,0x33, 0x28,0x2d,0x31,0x32,0x2e,0x34,0x37,0x33,0x39,0x33,0x30,0x33,0x35,0x38,0x38,0x38, 0x36,0x37,0x31,0x38,0x37,0x35,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x34,0x2e, 0x30,0x32,0x36,0x30,0x36,0x39,0x31,0x36,0x34,0x32,0x37,0x36,0x31,0x32,0x33,0x30, 0x34,0x36,0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x20,0x3d, 0x20,0x28,0x76,0x20,0x2d,0x20,0x76,0x65,0x63,0x33,0x28,0x2d,0x31,0x32,0x2e,0x34, 0x37,0x33,0x39,0x33,0x30,0x33,0x35,0x38,0x38,0x38,0x36,0x37,0x31,0x38,0x37,0x35, 0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x36,0x30,0x36, 0x30,0x36,0x30,0x36,0x36,0x31,0x33,0x37,0x35,0x35,0x32,0x32,0x36,0x31,0x33,0x35, 0x32,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, 0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x76,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x61,0x67,0x78,0x44,0x65,0x66,0x61,0x75,0x6c, 0x74,0x43,0x6f,0x6e,0x74,0x72,0x61,0x73,0x74,0x41,0x70,0x70,0x72,0x6f,0x78,0x28, 0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, 0x72,0x6e,0x20,0x76,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x61,0x67, 0x78,0x4c,0x6f,0x6f,0x6b,0x28,0x76,0x65,0x63,0x33,0x20,0x76,0x2c,0x20,0x66,0x6c, 0x6f,0x61,0x74,0x20,0x73,0x61,0x74,0x75,0x72,0x61,0x74,0x69,0x6f,0x6e,0x29,0x0a, 0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x33,0x33,0x20, 0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x64,0x6f,0x74,0x28,0x76,0x2c,0x20,0x76,0x65, 0x63,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,0x37,0x35, 0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37, 0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32,0x35,0x30, 0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x32,0x30, 0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39,0x32,0x31, 0x38,0x37,0x35,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, 0x72,0x6e,0x20,0x5f,0x31,0x33,0x33,0x20,0x2b,0x20,0x28,0x28,0x76,0x20,0x2d,0x20, 0x5f,0x31,0x33,0x33,0x29,0x20,0x2a,0x20,0x73,0x61,0x74,0x75,0x72,0x61,0x74,0x69, 0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x61,0x67,0x78, 0x4f,0x75,0x74,0x73,0x65,0x74,0x28,0x76,0x65,0x63,0x33,0x20,0x76,0x29,0x0a,0x7b, 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x74,0x33, 0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x31,0x39,0x36,0x38,0x37,0x39,0x30,0x32, 0x39,0x32,0x37,0x33,0x39,0x38,0x36,0x38,0x31,0x36,0x34,0x30,0x36,0x32,0x35,0x2c, 0x20,0x2d,0x30,0x2e,0x30,0x35,0x32,0x38,0x39,0x36,0x38,0x35,0x33,0x35,0x33,0x36, 0x33,0x36,0x37,0x34,0x31,0x36,0x33,0x38,0x31,0x38,0x33,0x35,0x39,0x33,0x37,0x35, 0x2c,0x20,0x2d,0x30,0x2e,0x30,0x35,0x32,0x39,0x37,0x31,0x36,0x33,0x35,0x30,0x31, 0x33,0x38,0x31,0x38,0x37,0x34,0x30,0x38,0x34,0x34,0x37,0x32,0x36,0x35,0x36,0x32, 0x35,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x2d,0x30,0x2e,0x30,0x39,0x38,0x30, 0x32,0x30,0x38,0x38,0x31,0x34,0x31,0x34,0x34,0x31,0x33,0x34,0x35,0x32,0x31,0x34, 0x38,0x34,0x33,0x37,0x35,0x2c,0x20,0x31,0x2e,0x31,0x35,0x31,0x39,0x30,0x33,0x31, 0x35,0x32,0x34,0x36,0x35,0x38,0x32,0x30,0x33,0x31,0x32,0x35,0x2c,0x20,0x2d,0x30, 0x2e,0x30,0x39,0x38,0x30,0x34,0x33,0x34,0x34,0x39,0x32,0x32,0x33,0x30,0x34,0x31, 0x35,0x33,0x34,0x34,0x32,0x33,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x2c,0x20,0x76, 0x65,0x63,0x33,0x28,0x2d,0x30,0x2e,0x30,0x39,0x39,0x30,0x32,0x39,0x37,0x34,0x32, 0x31,0x38,0x31,0x33,0x30,0x31,0x31,0x31,0x36,0x39,0x34,0x33,0x33,0x35,0x39,0x33, 0x37,0x35,0x2c,0x20,0x2d,0x30,0x2e,0x30,0x39,0x38,0x39,0x36,0x31,0x31,0x37,0x34, 0x34,0x38,0x38,0x30,0x36,0x37,0x36,0x32,0x36,0x39,0x35,0x33,0x31,0x32,0x35,0x2c, 0x20,0x31,0x2e,0x31,0x35,0x31,0x30,0x37,0x33,0x36,0x39,0x34,0x32,0x32,0x39,0x31, 0x32,0x35,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x76,0x3b, 0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, 0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x35, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x75,0x62,0x5f,0x74,0x6f,0x6e, 0x65,0x6d,0x61,0x70,0x5b,0x30,0x5d,0x2e,0x79,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29, 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f, 0x31,0x35,0x35,0x20,0x3d,0x20,0x76,0x5f,0x75,0x76,0x2e,0x79,0x3b,0x0a,0x20,0x20, 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x35,0x35,0x20, 0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x76,0x5f,0x75,0x76,0x2e,0x79,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70, 0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x4c,0x6f, 0x64,0x28,0x74,0x65,0x78,0x5f,0x73,0x63,0x65,0x6e,0x65,0x5f,0x73,0x6d,0x70,0x5f, 0x73,0x63,0x65,0x6e,0x65,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x76,0x5f,0x75,0x76, 0x2e,0x78,0x2c,0x20,0x5f,0x31,0x35,0x35,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2e, 0x78,0x79,0x7a,0x20,0x2a,0x20,0x70,0x6f,0x77,0x28,0x32,0x2e,0x30,0x2c,0x20,0x75, 0x62,0x5f,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x39,0x37,0x20,0x3d, 0x20,0x61,0x67,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20, 0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, 0x5f,0x31,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, 0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x75,0x62,0x5f,0x74,0x6f,0x6e, 0x65,0x6d,0x61,0x70,0x5b,0x30,0x5d,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, 0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x61,0x67, 0x78,0x4c,0x6f,0x6f,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70, 0x61,0x72,0x61,0x6d,0x5f,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6c, 0x61,0x6d,0x70,0x28,0x61,0x67,0x78,0x4f,0x75,0x74,0x73,0x65,0x74,0x28,0x70,0x61, 0x72,0x61,0x6d,0x5f,0x33,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30, 0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x2c,0x20,0x31, 0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; /* static float4 gl_Position; static int gl_VertexIndex; static float2 v_uv; struct SPIRV_Cross_Input { uint gl_VertexIndex : SV_VertexID; }; struct SPIRV_Cross_Output { float2 v_uv : TEXCOORD0; float4 gl_Position : SV_Position; }; void vert_main() { float2 _27 = (float2(float((gl_VertexIndex << 1) & 2), float(gl_VertexIndex & 2)) * 2.0f) - 1.0f.xx; v_uv = (_27 * 0.5f) + 0.5f.xx; gl_Position = float4(_27, 0.0f, 1.0f); } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) { gl_VertexIndex = int(stage_input.gl_VertexIndex); vert_main(); SPIRV_Cross_Output stage_output; stage_output.gl_Position = gl_Position; stage_output.v_uv = v_uv; return stage_output; } */ static const uint8_t tonemap_vs_source_hlsl5[716] = { 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c, 0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69, 0x63,0x20,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49, 0x6e,0x64,0x65,0x78,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f, 0x61,0x74,0x32,0x20,0x76,0x5f,0x75,0x76,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63, 0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e, 0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x75,0x69,0x6e,0x74,0x20,0x67, 0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x3a,0x20, 0x53,0x56,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x3b,0x0a,0x7d,0x3b,0x0a, 0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72, 0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20, 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x5f,0x75,0x76,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,0x66,0x6c,0x6f,0x61,0x74, 0x32,0x20,0x5f,0x32,0x37,0x20,0x3d,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, 0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78, 0x49,0x6e,0x64,0x65,0x78,0x20,0x3c,0x3c,0x20,0x31,0x29,0x20,0x26,0x20,0x32,0x29, 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65, 0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x26,0x20,0x32,0x29,0x29,0x20,0x2a,0x20,0x32, 0x2e,0x30,0x66,0x29,0x20,0x2d,0x20,0x31,0x2e,0x30,0x66,0x2e,0x78,0x78,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x76,0x5f,0x75,0x76,0x20,0x3d,0x20,0x28,0x5f,0x32,0x37,0x20, 0x2a,0x20,0x30,0x2e,0x35,0x66,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x66,0x2e,0x78, 0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, 0x6f,0x6e,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x32,0x37,0x2c, 0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x7d,0x0a, 0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74, 0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43, 0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65, 0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c, 0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20,0x3d,0x20,0x69, 0x6e,0x74,0x28,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x67, 0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x76,0x65,0x72,0x74,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73, 0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75, 0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, 0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, 0x6f,0x6e,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70, 0x75,0x74,0x2e,0x76,0x5f,0x75,0x76,0x20,0x3d,0x20,0x76,0x5f,0x75,0x76,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65, 0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, }; /* cbuffer ub_tonemap : register(b0) { float4 _144_params : packoffset(c0); }; Texture2D tex_scene : register(t0); SamplerState smp_scene : register(s0); static float2 v_uv; static float4 out_color; struct SPIRV_Cross_Input { float2 v_uv : TEXCOORD0; }; struct SPIRV_Cross_Output { float4 out_color : SV_Target0; }; float3 agxDefaultContrastApprox(float3 x) { float3 _28 = x * x; float3 _32 = _28 * _28; return (((((((_32 * 15.5f) * _28) - ((_32 * 40.1399993896484375f) * x)) + (_32 * 31.95999908447265625f)) - ((_28 * 6.868000030517578125f) * x)) + (_28 * 0.4298000037670135498046875f)) + (x * 0.119099996984004974365234375f)) - 0.002319999970495700836181640625f.xxx; } float3 agx(inout float3 v) { v = mul(v, float3x3(float3(0.842479050159454345703125f, 0.0423282422125339508056640625f, 0.0423756539821624755859375f), float3(0.0784336030483245849609375f, 0.87846863269805908203125f, 0.0784336030483245849609375f), float3(0.079223744571208953857421875f, 0.07916612923145294189453125f, 0.8791429996490478515625f))); v = max(v, 1.0000000133514319600180897396058e-10f.xxx); v = clamp(log2(v), (-12.47393035888671875f).xxx, 4.026069164276123046875f.xxx); v = (v - (-12.47393035888671875f).xxx) * 0.0606060661375522613525390625f.xxx; float3 param = v; v = agxDefaultContrastApprox(param); return v; } float3 agxLook(float3 v, float saturation) { float3 _133 = dot(v, float3(0.2125999927520751953125f, 0.715200006961822509765625f, 0.072200000286102294921875f)).xxx; return _133 + ((v - _133) * saturation); } float3 agxOutset(float3 v) { return mul(v, float3x3(float3(1.19687902927398681640625f, -0.0528968535363674163818359375f, -0.0529716350138187408447265625f), float3(-0.0980208814144134521484375f, 1.1519031524658203125f, -0.098043449223041534423828125f), float3(-0.099029742181301116943359375f, -0.098961174488067626953125f, 1.1510736942291259765625f))); } void frag_main() { float _155; if (_144_params.y > 0.0f) { _155 = v_uv.y; } else { _155 = 1.0f - v_uv.y; } float3 param = tex_scene.SampleLevel(smp_scene, float2(v_uv.x, _155), 0.0f).xyz * pow(2.0f, _144_params.x); float3 _197 = agx(param); float3 param_1 = _197; float param_2 = _144_params.z; float3 param_3 = agxLook(param_1, param_2); out_color = float4(clamp(agxOutset(param_3), 0.0f.xxx, 1.0f.xxx), 1.0f); } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) { v_uv = stage_input.v_uv; frag_main(); SPIRV_Cross_Output stage_output; stage_output.out_color = out_color; return stage_output; } */ static const uint8_t tonemap_fs_source_hlsl5[2627] = { 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x75,0x62,0x5f,0x74,0x6f,0x6e,0x65,0x6d, 0x61,0x70,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,0x34,0x34,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x70,0x61,0x63, 0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x7d,0x3b,0x0a, 0x0a,0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c,0x6f,0x61,0x74, 0x34,0x3e,0x20,0x74,0x65,0x78,0x5f,0x73,0x63,0x65,0x6e,0x65,0x20,0x3a,0x20,0x72, 0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x74,0x30,0x29,0x3b,0x0a,0x53,0x61,0x6d, 0x70,0x6c,0x65,0x72,0x53,0x74,0x61,0x74,0x65,0x20,0x73,0x6d,0x70,0x5f,0x73,0x63, 0x65,0x6e,0x65,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x73, 0x30,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x66,0x6c,0x6f,0x61, 0x74,0x32,0x20,0x76,0x5f,0x75,0x76,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20, 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x53,0x50,0x49,0x52,0x56,0x5f, 0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20, 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x5f,0x75,0x76,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,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20, 0x3a,0x20,0x53,0x56,0x5f,0x54,0x61,0x72,0x67,0x65,0x74,0x30,0x3b,0x0a,0x7d,0x3b, 0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x67,0x78,0x44,0x65,0x66,0x61, 0x75,0x6c,0x74,0x43,0x6f,0x6e,0x74,0x72,0x61,0x73,0x74,0x41,0x70,0x70,0x72,0x6f, 0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20, 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32,0x38,0x20,0x3d,0x20,0x78, 0x20,0x2a,0x20,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, 0x20,0x5f,0x33,0x32,0x20,0x3d,0x20,0x5f,0x32,0x38,0x20,0x2a,0x20,0x5f,0x32,0x38, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x28,0x28, 0x28,0x28,0x28,0x28,0x5f,0x33,0x32,0x20,0x2a,0x20,0x31,0x35,0x2e,0x35,0x66,0x29, 0x20,0x2a,0x20,0x5f,0x32,0x38,0x29,0x20,0x2d,0x20,0x28,0x28,0x5f,0x33,0x32,0x20, 0x2a,0x20,0x34,0x30,0x2e,0x31,0x33,0x39,0x39,0x39,0x39,0x33,0x38,0x39,0x36,0x34, 0x38,0x34,0x33,0x37,0x35,0x66,0x29,0x20,0x2a,0x20,0x78,0x29,0x29,0x20,0x2b,0x20, 0x28,0x5f,0x33,0x32,0x20,0x2a,0x20,0x33,0x31,0x2e,0x39,0x35,0x39,0x39,0x39,0x39, 0x30,0x38,0x34,0x34,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x66,0x29,0x29,0x20,0x2d, 0x20,0x28,0x28,0x5f,0x32,0x38,0x20,0x2a,0x20,0x36,0x2e,0x38,0x36,0x38,0x30,0x30, 0x30,0x30,0x33,0x30,0x35,0x31,0x37,0x35,0x37,0x38,0x31,0x32,0x35,0x66,0x29,0x20, 0x2a,0x20,0x78,0x29,0x29,0x20,0x2b,0x20,0x28,0x5f,0x32,0x38,0x20,0x2a,0x20,0x30, 0x2e,0x34,0x32,0x39,0x38,0x30,0x30,0x30,0x30,0x33,0x37,0x36,0x37,0x30,0x31,0x33, 0x35,0x34,0x39,0x38,0x30,0x34,0x36,0x38,0x37,0x35,0x66,0x29,0x29,0x20,0x2b,0x20, 0x28,0x78,0x20,0x2a,0x20,0x30,0x2e,0x31,0x31,0x39,0x30,0x39,0x39,0x39,0x39,0x36, 0x39,0x38,0x34,0x30,0x30,0x34,0x39,0x37,0x34,0x33,0x36,0x35,0x32,0x33,0x34,0x33, 0x37,0x35,0x66,0x29,0x29,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x32,0x33,0x31,0x39, 0x39,0x39,0x39,0x39,0x37,0x30,0x34,0x39,0x35,0x37,0x30,0x30,0x38,0x33,0x36,0x31, 0x38,0x31,0x36,0x34,0x30,0x36,0x32,0x35,0x66,0x2e,0x78,0x78,0x78,0x3b,0x0a,0x7d, 0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x67,0x78,0x28,0x69,0x6e,0x6f, 0x75,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x29,0x0a,0x7b,0x0a,0x20, 0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x6d,0x75,0x6c,0x28,0x76,0x2c,0x20,0x66,0x6c, 0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e, 0x38,0x34,0x32,0x34,0x37,0x39,0x30,0x35,0x30,0x31,0x35,0x39,0x34,0x35,0x34,0x33, 0x34,0x35,0x37,0x30,0x33,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x34,0x32, 0x33,0x32,0x38,0x32,0x34,0x32,0x32,0x31,0x32,0x35,0x33,0x33,0x39,0x35,0x30,0x38, 0x30,0x35,0x36,0x36,0x34,0x30,0x36,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x34, 0x32,0x33,0x37,0x35,0x36,0x35,0x33,0x39,0x38,0x32,0x31,0x36,0x32,0x34,0x37,0x35, 0x35,0x38,0x35,0x39,0x33,0x37,0x35,0x66,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74, 0x33,0x28,0x30,0x2e,0x30,0x37,0x38,0x34,0x33,0x33,0x36,0x30,0x33,0x30,0x34,0x38, 0x33,0x32,0x34,0x35,0x38,0x34,0x39,0x36,0x30,0x39,0x33,0x37,0x35,0x66,0x2c,0x20, 0x30,0x2e,0x38,0x37,0x38,0x34,0x36,0x38,0x36,0x33,0x32,0x36,0x39,0x38,0x30,0x35, 0x39,0x30,0x38,0x32,0x30,0x33,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x37, 0x38,0x34,0x33,0x33,0x36,0x30,0x33,0x30,0x34,0x38,0x33,0x32,0x34,0x35,0x38,0x34, 0x39,0x36,0x30,0x39,0x33,0x37,0x35,0x66,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74, 0x33,0x28,0x30,0x2e,0x30,0x37,0x39,0x32,0x32,0x33,0x37,0x34,0x34,0x35,0x37,0x31, 0x32,0x30,0x38,0x39,0x35,0x33,0x38,0x35,0x37,0x34,0x32,0x31,0x38,0x37,0x35,0x66, 0x2c,0x20,0x30,0x2e,0x30,0x37,0x39,0x31,0x36,0x36,0x31,0x32,0x39,0x32,0x33,0x31, 0x34,0x35,0x32,0x39,0x34,0x31,0x38,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x66,0x2c, 0x20,0x30,0x2e,0x38,0x37,0x39,0x31,0x34,0x32,0x39,0x39,0x39,0x36,0x34,0x39,0x30, 0x34,0x37,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x66,0x29,0x29,0x29,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x76,0x2c,0x20,0x31,0x2e, 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x33,0x35,0x31,0x34,0x33,0x31,0x39, 0x36,0x30,0x30,0x31,0x38,0x30,0x38,0x39,0x37,0x33,0x39,0x36,0x30,0x35,0x38,0x65, 0x2d,0x31,0x30,0x66,0x2e,0x78,0x78,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, 0x20,0x3d,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6c,0x6f,0x67,0x32,0x28,0x76,0x29, 0x2c,0x20,0x28,0x2d,0x31,0x32,0x2e,0x34,0x37,0x33,0x39,0x33,0x30,0x33,0x35,0x38, 0x38,0x38,0x36,0x37,0x31,0x38,0x37,0x35,0x66,0x29,0x2e,0x78,0x78,0x78,0x2c,0x20, 0x34,0x2e,0x30,0x32,0x36,0x30,0x36,0x39,0x31,0x36,0x34,0x32,0x37,0x36,0x31,0x32, 0x33,0x30,0x34,0x36,0x38,0x37,0x35,0x66,0x2e,0x78,0x78,0x78,0x29,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x28,0x76,0x20,0x2d,0x20,0x28,0x2d,0x31,0x32, 0x2e,0x34,0x37,0x33,0x39,0x33,0x30,0x33,0x35,0x38,0x38,0x38,0x36,0x37,0x31,0x38, 0x37,0x35,0x66,0x29,0x2e,0x78,0x78,0x78,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x36, 0x30,0x36,0x30,0x36,0x30,0x36,0x36,0x31,0x33,0x37,0x35,0x35,0x32,0x32,0x36,0x31, 0x33,0x35,0x32,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x66,0x2e,0x78,0x78,0x78,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, 0x6d,0x20,0x3d,0x20,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x61, 0x67,0x78,0x44,0x65,0x66,0x61,0x75,0x6c,0x74,0x43,0x6f,0x6e,0x74,0x72,0x61,0x73, 0x74,0x41,0x70,0x70,0x72,0x6f,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x3b,0x0a,0x7d,0x0a, 0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x67,0x78,0x4c,0x6f,0x6f,0x6b,0x28, 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, 0x73,0x61,0x74,0x75,0x72,0x61,0x74,0x69,0x6f,0x6e,0x29,0x0a,0x7b,0x0a,0x20,0x20, 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x33,0x33,0x20,0x3d,0x20, 0x64,0x6f,0x74,0x28,0x76,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e, 0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,0x37,0x35,0x32,0x30,0x37,0x35,0x31, 0x39,0x35,0x33,0x31,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x37,0x31,0x35,0x32,0x30, 0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32,0x35,0x30,0x39,0x37,0x36,0x35, 0x36,0x32,0x35,0x66,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x32,0x30,0x30,0x30,0x30, 0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39,0x32,0x31,0x38,0x37,0x35, 0x66,0x29,0x29,0x2e,0x78,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, 0x75,0x72,0x6e,0x20,0x5f,0x31,0x33,0x33,0x20,0x2b,0x20,0x28,0x28,0x76,0x20,0x2d, 0x20,0x5f,0x31,0x33,0x33,0x29,0x20,0x2a,0x20,0x73,0x61,0x74,0x75,0x72,0x61,0x74, 0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, 0x61,0x67,0x78,0x4f,0x75,0x74,0x73,0x65,0x74,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33, 0x20,0x76,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, 0x20,0x6d,0x75,0x6c,0x28,0x76,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33, 0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x31,0x39,0x36,0x38,0x37,0x39, 0x30,0x32,0x39,0x32,0x37,0x33,0x39,0x38,0x36,0x38,0x31,0x36,0x34,0x30,0x36,0x32, 0x35,0x66,0x2c,0x20,0x2d,0x30,0x2e,0x30,0x35,0x32,0x38,0x39,0x36,0x38,0x35,0x33, 0x35,0x33,0x36,0x33,0x36,0x37,0x34,0x31,0x36,0x33,0x38,0x31,0x38,0x33,0x35,0x39, 0x33,0x37,0x35,0x66,0x2c,0x20,0x2d,0x30,0x2e,0x30,0x35,0x32,0x39,0x37,0x31,0x36, 0x33,0x35,0x30,0x31,0x33,0x38,0x31,0x38,0x37,0x34,0x30,0x38,0x34,0x34,0x37,0x32, 0x36,0x35,0x36,0x32,0x35,0x66,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, 0x2d,0x30,0x2e,0x30,0x39,0x38,0x30,0x32,0x30,0x38,0x38,0x31,0x34,0x31,0x34,0x34, 0x31,0x33,0x34,0x35,0x32,0x31,0x34,0x38,0x34,0x33,0x37,0x35,0x66,0x2c,0x20,0x31, 0x2e,0x31,0x35,0x31,0x39,0x30,0x33,0x31,0x35,0x32,0x34,0x36,0x35,0x38,0x32,0x30, 0x33,0x31,0x32,0x35,0x66,0x2c,0x20,0x2d,0x30,0x2e,0x30,0x39,0x38,0x30,0x34,0x33, 0x34,0x34,0x39,0x32,0x32,0x33,0x30,0x34,0x31,0x35,0x33,0x34,0x34,0x32,0x33,0x38, 0x32,0x38,0x31,0x32,0x35,0x66,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, 0x2d,0x30,0x2e,0x30,0x39,0x39,0x30,0x32,0x39,0x37,0x34,0x32,0x31,0x38,0x31,0x33, 0x30,0x31,0x31,0x31,0x36,0x39,0x34,0x33,0x33,0x35,0x39,0x33,0x37,0x35,0x66,0x2c, 0x20,0x2d,0x30,0x2e,0x30,0x39,0x38,0x39,0x36,0x31,0x31,0x37,0x34,0x34,0x38,0x38, 0x30,0x36,0x37,0x36,0x32,0x36,0x39,0x35,0x33,0x31,0x32,0x35,0x66,0x2c,0x20,0x31, 0x2e,0x31,0x35,0x31,0x30,0x37,0x33,0x36,0x39,0x34,0x32,0x32,0x39,0x31,0x32,0x35, 0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x66,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, 0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29, 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35, 0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x34,0x34,0x5f, 0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x79,0x20,0x3e,0x20,0x30,0x2e,0x30,0x66,0x29, 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f, 0x31,0x35,0x35,0x20,0x3d,0x20,0x76,0x5f,0x75,0x76,0x2e,0x79,0x3b,0x0a,0x20,0x20, 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20, 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x35,0x35,0x20, 0x3d,0x20,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x76,0x5f,0x75,0x76,0x2e,0x79,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x74,0x65,0x78,0x5f,0x73,0x63, 0x65,0x6e,0x65,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x4c,0x65,0x76,0x65,0x6c,0x28, 0x73,0x6d,0x70,0x5f,0x73,0x63,0x65,0x6e,0x65,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74, 0x32,0x28,0x76,0x5f,0x75,0x76,0x2e,0x78,0x2c,0x20,0x5f,0x31,0x35,0x35,0x29,0x2c, 0x20,0x30,0x2e,0x30,0x66,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x70,0x6f,0x77, 0x28,0x32,0x2e,0x30,0x66,0x2c,0x20,0x5f,0x31,0x34,0x34,0x5f,0x70,0x61,0x72,0x61, 0x6d,0x73,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, 0x33,0x20,0x5f,0x31,0x39,0x37,0x20,0x3d,0x20,0x61,0x67,0x78,0x28,0x70,0x61,0x72, 0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x31,0x39,0x37,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, 0x32,0x20,0x3d,0x20,0x5f,0x31,0x34,0x34,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e, 0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61, 0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x61,0x67,0x78,0x4c,0x6f,0x6f,0x6b,0x28, 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32, 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28, 0x61,0x67,0x78,0x4f,0x75,0x74,0x73,0x65,0x74,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, 0x33,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2e,0x78,0x78,0x78,0x2c,0x20,0x31,0x2e, 0x30,0x66,0x2e,0x78,0x78,0x78,0x29,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a, 0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f, 0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56, 0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61, 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, 0x76,0x5f,0x75,0x76,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70, 0x75,0x74,0x2e,0x76,0x5f,0x75,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61, 0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50, 0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74, 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e, 0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x6f,0x75,0x74,0x5f, 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, 0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a, 0x7d,0x0a,0x00, }; /* #include #include using namespace metal; struct main0_out { float2 v_uv [[user(locn0)]]; float4 gl_Position [[position]]; }; vertex main0_out main0(uint gl_VertexIndex [[vertex_id]]) { main0_out out = {}; float2 _27 = (float2(float((int(gl_VertexIndex) << 1) & 2), float(int(gl_VertexIndex) & 2)) * 2.0) - float2(1.0); out.v_uv = (_27 * 0.5) + float2(0.5); out.gl_Position = float4(_27, 0.0, 1.0); return out; } */ static const uint8_t tonemap_vs_source_metal_macos[474] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d, 0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, 0x6c,0x6f,0x61,0x74,0x32,0x20,0x76,0x5f,0x75,0x76,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,0x76,0x65,0x72,0x74,0x65,0x78,0x20,0x6d,0x61,0x69,0x6e, 0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x75,0x69,0x6e,0x74, 0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x20, 0x5b,0x5b,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x69,0x64,0x5d,0x5d,0x29,0x0a,0x7b, 0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f, 0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, 0x61,0x74,0x32,0x20,0x5f,0x32,0x37,0x20,0x3d,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74, 0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x69,0x6e,0x74,0x28,0x67,0x6c,0x5f, 0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65,0x78,0x29,0x20,0x3c,0x3c,0x20, 0x31,0x29,0x20,0x26,0x20,0x32,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69, 0x6e,0x74,0x28,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65, 0x78,0x29,0x20,0x26,0x20,0x32,0x29,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x20, 0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x75,0x76,0x20,0x3d,0x20,0x28,0x5f, 0x32,0x37,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61, 0x74,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, 0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x66, 0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x32,0x37,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20, 0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, 0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; /* #pragma clang diagnostic ignored "-Wmissing-prototypes" #include #include using namespace metal; struct ub_tonemap { float4 params; }; struct main0_out { float4 out_color [[color(0)]]; }; struct main0_in { float2 v_uv [[user(locn0)]]; }; static inline __attribute__((always_inline)) float3 agxDefaultContrastApprox(thread const float3& x) { float3 _28 = x * x; float3 _32 = _28 * _28; return (((((((_32 * 15.5) * _28) - ((_32 * 40.1399993896484375) * x)) + (_32 * 31.95999908447265625)) - ((_28 * 6.868000030517578125) * x)) + (_28 * 0.4298000037670135498046875)) + (x * 0.119099996984004974365234375)) - float3(0.002319999970495700836181640625); } static inline __attribute__((always_inline)) float3 agx(thread float3& v) { v = float3x3(float3(0.842479050159454345703125, 0.0423282422125339508056640625, 0.0423756539821624755859375), float3(0.0784336030483245849609375, 0.87846863269805908203125, 0.0784336030483245849609375), float3(0.079223744571208953857421875, 0.07916612923145294189453125, 0.8791429996490478515625)) * v; v = fast::max(v, float3(1.0000000133514319600180897396058e-10)); v = fast::clamp(log2(v), float3(-12.47393035888671875), float3(4.026069164276123046875)); v = (v - float3(-12.47393035888671875)) * float3(0.0606060661375522613525390625); float3 param = v; v = agxDefaultContrastApprox(param); return v; } static inline __attribute__((always_inline)) float3 agxLook(thread const float3& v, thread const float& saturation) { float3 _133 = float3(dot(v, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875))); return _133 + ((v - _133) * saturation); } static inline __attribute__((always_inline)) float3 agxOutset(thread const float3& v) { return float3x3(float3(1.19687902927398681640625, -0.0528968535363674163818359375, -0.0529716350138187408447265625), float3(-0.0980208814144134521484375, 1.1519031524658203125, -0.098043449223041534423828125), float3(-0.099029742181301116943359375, -0.098961174488067626953125, 1.1510736942291259765625)) * v; } fragment main0_out main0(main0_in in [[stage_in]], constant ub_tonemap& _144 [[buffer(0)]], texture2d tex_scene [[texture(0)]], sampler smp_scene [[sampler(0)]]) { main0_out out = {}; float _155; if (_144.params.y > 0.0) { _155 = in.v_uv.y; } else { _155 = 1.0 - in.v_uv.y; } float3 param = tex_scene.sample(smp_scene, float2(in.v_uv.x, _155), level(0.0)).xyz * powr(2.0, _144.params.x); float3 _197 = agx(param); float3 param_1 = _197; float param_2 = _144.params.z; float3 param_3 = agxLook(param_1, param_2); out.out_color = float4(fast::clamp(agxOutset(param_3), float3(0.0), float3(1.0)), 1.0); return out; } */ static const uint8_t tonemap_fs_source_metal_macos[2815] = { 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, 0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64, 0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,0x73,0x74,0x64,0x6c,0x69,0x62,0x3e, 0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f, 0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e, 0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a, 0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x75,0x62,0x5f,0x74,0x6f,0x6e,0x65,0x6d, 0x61,0x70,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, 0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75, 0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6f,0x75,0x74,0x5f,0x63,0x6f, 0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d, 0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69, 0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, 0x74,0x32,0x20,0x76,0x5f,0x75,0x76,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c, 0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x61, 0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74, 0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73, 0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33, 0x20,0x61,0x67,0x78,0x44,0x65,0x66,0x61,0x75,0x6c,0x74,0x43,0x6f,0x6e,0x74,0x72, 0x61,0x73,0x74,0x41,0x70,0x70,0x72,0x6f,0x78,0x28,0x74,0x68,0x72,0x65,0x61,0x64, 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x78, 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f, 0x32,0x38,0x20,0x3d,0x20,0x78,0x20,0x2a,0x20,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20, 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x32,0x20,0x3d,0x20,0x5f,0x32,0x38, 0x20,0x2a,0x20,0x5f,0x32,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, 0x72,0x6e,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x5f,0x33,0x32,0x20,0x2a,0x20, 0x31,0x35,0x2e,0x35,0x29,0x20,0x2a,0x20,0x5f,0x32,0x38,0x29,0x20,0x2d,0x20,0x28, 0x28,0x5f,0x33,0x32,0x20,0x2a,0x20,0x34,0x30,0x2e,0x31,0x33,0x39,0x39,0x39,0x39, 0x33,0x38,0x39,0x36,0x34,0x38,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x78,0x29, 0x29,0x20,0x2b,0x20,0x28,0x5f,0x33,0x32,0x20,0x2a,0x20,0x33,0x31,0x2e,0x39,0x35, 0x39,0x39,0x39,0x39,0x30,0x38,0x34,0x34,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x29, 0x29,0x20,0x2d,0x20,0x28,0x28,0x5f,0x32,0x38,0x20,0x2a,0x20,0x36,0x2e,0x38,0x36, 0x38,0x30,0x30,0x30,0x30,0x33,0x30,0x35,0x31,0x37,0x35,0x37,0x38,0x31,0x32,0x35, 0x29,0x20,0x2a,0x20,0x78,0x29,0x29,0x20,0x2b,0x20,0x28,0x5f,0x32,0x38,0x20,0x2a, 0x20,0x30,0x2e,0x34,0x32,0x39,0x38,0x30,0x30,0x30,0x30,0x33,0x37,0x36,0x37,0x30, 0x31,0x33,0x35,0x34,0x39,0x38,0x30,0x34,0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2b, 0x20,0x28,0x78,0x20,0x2a,0x20,0x30,0x2e,0x31,0x31,0x39,0x30,0x39,0x39,0x39,0x39, 0x36,0x39,0x38,0x34,0x30,0x30,0x34,0x39,0x37,0x34,0x33,0x36,0x35,0x32,0x33,0x34, 0x33,0x37,0x35,0x29,0x29,0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30, 0x2e,0x30,0x30,0x32,0x33,0x31,0x39,0x39,0x39,0x39,0x39,0x37,0x30,0x34,0x39,0x35, 0x37,0x30,0x30,0x38,0x33,0x36,0x31,0x38,0x31,0x36,0x34,0x30,0x36,0x32,0x35,0x29, 0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69, 0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f, 0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29, 0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x67,0x78,0x28,0x74,0x68,0x72, 0x65,0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x76,0x29,0x0a,0x7b, 0x0a,0x20,0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78, 0x33,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x38,0x34,0x32,0x34,0x37, 0x39,0x30,0x35,0x30,0x31,0x35,0x39,0x34,0x35,0x34,0x33,0x34,0x35,0x37,0x30,0x33, 0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x34,0x32,0x33,0x32,0x38,0x32,0x34,0x32, 0x32,0x31,0x32,0x35,0x33,0x33,0x39,0x35,0x30,0x38,0x30,0x35,0x36,0x36,0x34,0x30, 0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x34,0x32,0x33,0x37,0x35,0x36,0x35,0x33, 0x39,0x38,0x32,0x31,0x36,0x32,0x34,0x37,0x35,0x35,0x38,0x35,0x39,0x33,0x37,0x35, 0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x37,0x38,0x34, 0x33,0x33,0x36,0x30,0x33,0x30,0x34,0x38,0x33,0x32,0x34,0x35,0x38,0x34,0x39,0x36, 0x30,0x39,0x33,0x37,0x35,0x2c,0x20,0x30,0x2e,0x38,0x37,0x38,0x34,0x36,0x38,0x36, 0x33,0x32,0x36,0x39,0x38,0x30,0x35,0x39,0x30,0x38,0x32,0x30,0x33,0x31,0x32,0x35, 0x2c,0x20,0x30,0x2e,0x30,0x37,0x38,0x34,0x33,0x33,0x36,0x30,0x33,0x30,0x34,0x38, 0x33,0x32,0x34,0x35,0x38,0x34,0x39,0x36,0x30,0x39,0x33,0x37,0x35,0x29,0x2c,0x20, 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x37,0x39,0x32,0x32,0x33,0x37, 0x34,0x34,0x35,0x37,0x31,0x32,0x30,0x38,0x39,0x35,0x33,0x38,0x35,0x37,0x34,0x32, 0x31,0x38,0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x39,0x31,0x36,0x36,0x31,0x32, 0x39,0x32,0x33,0x31,0x34,0x35,0x32,0x39,0x34,0x31,0x38,0x39,0x34,0x35,0x33,0x31, 0x32,0x35,0x2c,0x20,0x30,0x2e,0x38,0x37,0x39,0x31,0x34,0x32,0x39,0x39,0x39,0x36, 0x34,0x39,0x30,0x34,0x37,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x29,0x20,0x2a, 0x20,0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x66,0x61,0x73,0x74, 0x3a,0x3a,0x6d,0x61,0x78,0x28,0x76,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, 0x31,0x2e,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x33,0x33,0x35,0x31,0x34,0x33, 0x31,0x39,0x36,0x30,0x30,0x31,0x38,0x30,0x38,0x39,0x37,0x33,0x39,0x36,0x30,0x35, 0x38,0x65,0x2d,0x31,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x20,0x3d, 0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6c,0x6f,0x67, 0x32,0x28,0x76,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x2d,0x31,0x32, 0x2e,0x34,0x37,0x33,0x39,0x33,0x30,0x33,0x35,0x38,0x38,0x38,0x36,0x37,0x31,0x38, 0x37,0x35,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x34,0x2e,0x30,0x32, 0x36,0x30,0x36,0x39,0x31,0x36,0x34,0x32,0x37,0x36,0x31,0x32,0x33,0x30,0x34,0x36, 0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x28, 0x76,0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x2d,0x31,0x32,0x2e,0x34, 0x37,0x33,0x39,0x33,0x30,0x33,0x35,0x38,0x38,0x38,0x36,0x37,0x31,0x38,0x37,0x35, 0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x36, 0x30,0x36,0x30,0x36,0x30,0x36,0x36,0x31,0x33,0x37,0x35,0x35,0x32,0x32,0x36,0x31, 0x33,0x35,0x32,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20, 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20, 0x76,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x20,0x3d,0x20,0x61,0x67,0x78,0x44,0x65, 0x66,0x61,0x75,0x6c,0x74,0x43,0x6f,0x6e,0x74,0x72,0x61,0x73,0x74,0x41,0x70,0x70, 0x72,0x6f,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x61, 0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61,0x74,0x74, 0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61,0x79,0x73, 0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x33, 0x20,0x61,0x67,0x78,0x4c,0x6f,0x6f,0x6b,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20, 0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x76,0x2c, 0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c, 0x6f,0x61,0x74,0x26,0x20,0x73,0x61,0x74,0x75,0x72,0x61,0x74,0x69,0x6f,0x6e,0x29, 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31, 0x33,0x33,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x64,0x6f,0x74,0x28, 0x76,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35, 0x39,0x39,0x39,0x39,0x32,0x37,0x35,0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31, 0x32,0x35,0x2c,0x20,0x30,0x2e,0x37,0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39, 0x36,0x31,0x38,0x32,0x32,0x35,0x30,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20, 0x30,0x2e,0x30,0x37,0x32,0x32,0x30,0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30, 0x32,0x32,0x39,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x29,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,0x31,0x33,0x33,0x20,0x2b, 0x20,0x28,0x28,0x76,0x20,0x2d,0x20,0x5f,0x31,0x33,0x33,0x29,0x20,0x2a,0x20,0x73, 0x61,0x74,0x75,0x72,0x61,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x73, 0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f,0x61, 0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77,0x61, 0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61, 0x74,0x33,0x20,0x61,0x67,0x78,0x4f,0x75,0x74,0x73,0x65,0x74,0x28,0x74,0x68,0x72, 0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, 0x26,0x20,0x76,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, 0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61,0x74, 0x33,0x28,0x31,0x2e,0x31,0x39,0x36,0x38,0x37,0x39,0x30,0x32,0x39,0x32,0x37,0x33, 0x39,0x38,0x36,0x38,0x31,0x36,0x34,0x30,0x36,0x32,0x35,0x2c,0x20,0x2d,0x30,0x2e, 0x30,0x35,0x32,0x38,0x39,0x36,0x38,0x35,0x33,0x35,0x33,0x36,0x33,0x36,0x37,0x34, 0x31,0x36,0x33,0x38,0x31,0x38,0x33,0x35,0x39,0x33,0x37,0x35,0x2c,0x20,0x2d,0x30, 0x2e,0x30,0x35,0x32,0x39,0x37,0x31,0x36,0x33,0x35,0x30,0x31,0x33,0x38,0x31,0x38, 0x37,0x34,0x30,0x38,0x34,0x34,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x29,0x2c,0x20, 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x2d,0x30,0x2e,0x30,0x39,0x38,0x30,0x32,0x30, 0x38,0x38,0x31,0x34,0x31,0x34,0x34,0x31,0x33,0x34,0x35,0x32,0x31,0x34,0x38,0x34, 0x33,0x37,0x35,0x2c,0x20,0x31,0x2e,0x31,0x35,0x31,0x39,0x30,0x33,0x31,0x35,0x32, 0x34,0x36,0x35,0x38,0x32,0x30,0x33,0x31,0x32,0x35,0x2c,0x20,0x2d,0x30,0x2e,0x30, 0x39,0x38,0x30,0x34,0x33,0x34,0x34,0x39,0x32,0x32,0x33,0x30,0x34,0x31,0x35,0x33, 0x34,0x34,0x32,0x33,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x2c,0x20,0x66,0x6c,0x6f, 0x61,0x74,0x33,0x28,0x2d,0x30,0x2e,0x30,0x39,0x39,0x30,0x32,0x39,0x37,0x34,0x32, 0x31,0x38,0x31,0x33,0x30,0x31,0x31,0x31,0x36,0x39,0x34,0x33,0x33,0x35,0x39,0x33, 0x37,0x35,0x2c,0x20,0x2d,0x30,0x2e,0x30,0x39,0x38,0x39,0x36,0x31,0x31,0x37,0x34, 0x34,0x38,0x38,0x30,0x36,0x37,0x36,0x32,0x36,0x39,0x35,0x33,0x31,0x32,0x35,0x2c, 0x20,0x31,0x2e,0x31,0x35,0x31,0x30,0x37,0x33,0x36,0x39,0x34,0x32,0x32,0x39,0x31, 0x32,0x35,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x76,0x3b, 0x0a,0x7d,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,0x61,0x69, 0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69, 0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65, 0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20, 0x75,0x62,0x5f,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x26,0x20,0x5f,0x31,0x34,0x34, 0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20, 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e, 0x20,0x74,0x65,0x78,0x5f,0x73,0x63,0x65,0x6e,0x65,0x20,0x5b,0x5b,0x74,0x65,0x78, 0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c, 0x65,0x72,0x20,0x73,0x6d,0x70,0x5f,0x73,0x63,0x65,0x6e,0x65,0x20,0x5b,0x5b,0x73, 0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20, 0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74, 0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, 0x20,0x5f,0x31,0x35,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, 0x31,0x34,0x34,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x79,0x20,0x3e,0x20,0x30, 0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x5f,0x31,0x35,0x35,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x76,0x5f,0x75,0x76, 0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c, 0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, 0x20,0x5f,0x31,0x35,0x35,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x69,0x6e, 0x2e,0x76,0x5f,0x75,0x76,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20, 0x3d,0x20,0x74,0x65,0x78,0x5f,0x73,0x63,0x65,0x6e,0x65,0x2e,0x73,0x61,0x6d,0x70, 0x6c,0x65,0x28,0x73,0x6d,0x70,0x5f,0x73,0x63,0x65,0x6e,0x65,0x2c,0x20,0x66,0x6c, 0x6f,0x61,0x74,0x32,0x28,0x69,0x6e,0x2e,0x76,0x5f,0x75,0x76,0x2e,0x78,0x2c,0x20, 0x5f,0x31,0x35,0x35,0x29,0x2c,0x20,0x6c,0x65,0x76,0x65,0x6c,0x28,0x30,0x2e,0x30, 0x29,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x70,0x6f,0x77,0x72,0x28,0x32,0x2e, 0x30,0x2c,0x20,0x5f,0x31,0x34,0x34,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x78, 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31, 0x39,0x37,0x20,0x3d,0x20,0x61,0x67,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, 0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x31,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20, 0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20, 0x5f,0x31,0x34,0x34,0x2e,0x70,0x61,0x72,0x61,0x6d,0x73,0x2e,0x7a,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, 0x33,0x20,0x3d,0x20,0x61,0x67,0x78,0x4c,0x6f,0x6f,0x6b,0x28,0x70,0x61,0x72,0x61, 0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x29,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x6f,0x75,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a, 0x63,0x6c,0x61,0x6d,0x70,0x28,0x61,0x67,0x78,0x4f,0x75,0x74,0x73,0x65,0x74,0x28, 0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, 0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e, 0x30,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, 0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; static inline const sg_shader_desc* tonemap_prog_shader_desc(sg_backend backend) { if (backend == SG_BACKEND_GLCORE) { static sg_shader_desc desc; static bool valid; if (!valid) { valid = true; desc.vertex_func.source = (const char*)tonemap_vs_source_glsl430; desc.vertex_func.entry = "main"; desc.fragment_func.source = (const char*)tonemap_fs_source_glsl430; desc.fragment_func.entry = "main"; desc.uniform_blocks[0].stage = SG_SHADERSTAGE_FRAGMENT; desc.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; desc.uniform_blocks[0].size = 16; desc.uniform_blocks[0].glsl_uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "ub_tonemap"; desc.views[0].texture.stage = SG_SHADERSTAGE_FRAGMENT; desc.views[0].texture.image_type = SG_IMAGETYPE_2D; desc.views[0].texture.sample_type = SG_IMAGESAMPLETYPE_FLOAT; desc.views[0].texture.multisampled = false; desc.samplers[0].stage = SG_SHADERSTAGE_FRAGMENT; desc.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; desc.texture_sampler_pairs[0].stage = SG_SHADERSTAGE_FRAGMENT; desc.texture_sampler_pairs[0].view_slot = 0; desc.texture_sampler_pairs[0].sampler_slot = 0; desc.texture_sampler_pairs[0].glsl_name = "tex_scene_smp_scene"; desc.label = "tonemap_prog_shader"; } return &desc; } if (backend == SG_BACKEND_D3D11) { static sg_shader_desc desc; static bool valid; if (!valid) { valid = true; desc.vertex_func.source = (const char*)tonemap_vs_source_hlsl5; desc.vertex_func.d3d11_target = "vs_5_0"; desc.vertex_func.entry = "main"; desc.fragment_func.source = (const char*)tonemap_fs_source_hlsl5; desc.fragment_func.d3d11_target = "ps_5_0"; desc.fragment_func.entry = "main"; desc.uniform_blocks[0].stage = SG_SHADERSTAGE_FRAGMENT; desc.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; desc.uniform_blocks[0].size = 16; desc.uniform_blocks[0].hlsl_register_b_n = 0; desc.views[0].texture.stage = SG_SHADERSTAGE_FRAGMENT; desc.views[0].texture.image_type = SG_IMAGETYPE_2D; desc.views[0].texture.sample_type = SG_IMAGESAMPLETYPE_FLOAT; desc.views[0].texture.multisampled = false; desc.views[0].texture.hlsl_register_t_n = 0; desc.samplers[0].stage = SG_SHADERSTAGE_FRAGMENT; desc.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; desc.samplers[0].hlsl_register_s_n = 0; desc.texture_sampler_pairs[0].stage = SG_SHADERSTAGE_FRAGMENT; desc.texture_sampler_pairs[0].view_slot = 0; desc.texture_sampler_pairs[0].sampler_slot = 0; desc.label = "tonemap_prog_shader"; } return &desc; } if (backend == SG_BACKEND_METAL_MACOS) { static sg_shader_desc desc; static bool valid; if (!valid) { valid = true; desc.vertex_func.source = (const char*)tonemap_vs_source_metal_macos; desc.vertex_func.entry = "main0"; desc.fragment_func.source = (const char*)tonemap_fs_source_metal_macos; desc.fragment_func.entry = "main0"; desc.uniform_blocks[0].stage = SG_SHADERSTAGE_FRAGMENT; desc.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; desc.uniform_blocks[0].size = 16; desc.uniform_blocks[0].msl_buffer_n = 0; desc.views[0].texture.stage = SG_SHADERSTAGE_FRAGMENT; desc.views[0].texture.image_type = SG_IMAGETYPE_2D; desc.views[0].texture.sample_type = SG_IMAGESAMPLETYPE_FLOAT; desc.views[0].texture.multisampled = false; desc.views[0].texture.msl_texture_n = 0; desc.samplers[0].stage = SG_SHADERSTAGE_FRAGMENT; desc.samplers[0].sampler_type = SG_SAMPLERTYPE_FILTERING; desc.samplers[0].msl_sampler_n = 0; desc.texture_sampler_pairs[0].stage = SG_SHADERSTAGE_FRAGMENT; desc.texture_sampler_pairs[0].view_slot = 0; desc.texture_sampler_pairs[0].sampler_slot = 0; desc.label = "tonemap_prog_shader"; } return &desc; } return 0; }