pub const GPU_DEVICE_FALLBACK: &str = "euv-software-fallback";
pub const GPU_DEVICE_WEB: &str = "Browser WebGL2 / WebGPU";
pub const GPU_DEVICE_D3D12: &str = "Windows Direct3D 12";
pub const GPU_DEVICE_VULKAN: &str = "Vulkan Physical GPU";
pub const GPU_DRIVER_RING_SLOTS: usize = 3;
pub const MOBILE_MAX_MULTI_UPLOAD_RECTS: usize = 12;
pub const MOBILE_UPLOAD_PER_RECT_OVERHEAD_BYTES: usize = 16_384;
pub const MOBILE_UPLOAD_FULL_FRAME_COVERAGE_THRESHOLD: f32 = 0.70;
pub const MOBILE_UPLOAD_COALESCE_PAD_PX: u32 = 4;
pub const GLSL_ES3_BACKDROP_BLUR_VERTEX_SHADER: &str = "#version 300 es\n\
precision highp float;\n\
precision highp int;\n\
out highp vec2 v_uv;\n\
void main() {\n\
vec2 p = vec2((gl_VertexID == 1) ? 3.0 : -1.0, (gl_VertexID == 2) ? 3.0 : -1.0);\n\
gl_Position = vec4(p, 0.0, 1.0);\n\
v_uv = vec2(p.x * 0.5 + 0.5, 0.5 - p.y * 0.5);\n\
}\n";
pub const MOBILE_TIMING_UNOBSERVABLE_REASON_SIMULATOR: &str = "simulator_compositor_unobservable";
pub const MOBILE_TIMING_UNOBSERVABLE_REASON_UNSUPPORTED: &str = "presentation_time_unsupported";
pub const WEB_GL2_BLIT_VERT_SHADER: &str = "#version 300 es\n\
precision highp float;\n\
precision highp int;\n\
void main() {\n\
vec2 pos = vec2((gl_VertexID == 1) ? 3.0 : -1.0, (gl_VertexID == 2) ? 3.0 : -1.0);\n\
gl_Position = vec4(pos, 0.0, 1.0);\n\
}\n";
pub const WEB_GL2_BLIT_FRAG_SHADER: &str = "#version 300 es\n\
precision highp float;\n\
precision highp int;\n\
precision highp sampler2D;\n\
uniform highp sampler2D u_tex;\n\
uniform highp vec2 u_view;\n\
out highp vec4 out_color;\n\
void main() {\n\
ivec2 tex_size = textureSize(u_tex, 0);\n\
highp vec2 view = max(u_view, vec2(1.0));\n\
ivec2 view_size = ivec2(view + vec2(0.5));\n\
if (tex_size == view_size) {\n\
ivec2 texel = ivec2(int(gl_FragCoord.x), tex_size.y - 1 - int(gl_FragCoord.y));\n\
out_color = texelFetch(u_tex, clamp(texel, ivec2(0), tex_size - ivec2(1)), 0);\n\
} else {\n\
highp vec2 uv = vec2(gl_FragCoord.x, view.y - gl_FragCoord.y) / view;\n\
out_color = texture(u_tex, uv);\n\
}\n\
}\n";
pub const WGSL_FLUID_OCEAN_SHADER: &str = r#"struct OceanUniforms {
viewport_time_agitation: vec4<f32>,
sun_dir_horizon: vec4<f32>,
roll_cos_sin_pad: vec4<f32>,
};
@group(0) @binding(0) var<uniform> u_ocean: OceanUniforms;
struct OceanVertOut {
@builtin(position) pos: vec4<f32>,
@location(0) uv: vec2<f32>,
};
@vertex
fn euv_ocean_vertex(@builtin(vertex_index) vid: u32) -> OceanVertOut {
let px = select(-1.0, 3.0, vid == 1u);
let py = select(-1.0, 3.0, vid == 2u);
var out: OceanVertOut;
out.pos = vec4<f32>(px, py, 0.0, 1.0);
out.uv = vec2<f32>(px * 0.5 + 0.5, 0.5 - py * 0.5);
return out;
}
fn euv_ocean_aces(hdr: vec3<f32>) -> vec3<f32> {
let num = hdr * (2.51 * hdr + 0.03);
let den = hdr * (2.43 * hdr + 0.59) + 0.14;
return clamp(num / max(den, vec3<f32>(0.0001)), vec3<f32>(0.0), vec3<f32>(1.0));
}
@fragment
fn euv_ocean_fragment(in: OceanVertOut) -> @location(0) vec4<f32> {
let sim_time = u_ocean.viewport_time_agitation.z;
let agitation = max(u_ocean.viewport_time_agitation.w, 1.0);
let sun_dir = normalize(u_ocean.sun_dir_horizon.xyz);
let horizon_v = u_ocean.sun_dir_horizon.w;
let ray = normalize(vec3<f32>((in.uv.x - 0.5) * 2.0, (horizon_v - in.uv.y) * 2.0, 1.62));
var col = vec3<f32>(0.0);
if (ray.y >= 0.0) {
let sdot = clamp(dot(ray, sun_dir), 0.0, 1.0);
let glow = pow(sdot, 16.0);
let disk = smoothstep(0.9992, 0.9997, sdot);
let sky_t = smoothstep(0.0, 0.55, ray.y);
let horiz = vec3<f32>(0.16, 0.17, 0.19) + vec3<f32>(0.68, 0.48, 0.22) * glow;
col = mix(horiz, vec3<f32>(0.01, 0.015, 0.024), sky_t) + vec3<f32>(3.2, 2.7, 2.0) * disk;
} else {
let dist = min(1.42 / max(-ray.y, 0.0024), 240.0);
let wp = ray.xz * dist;
let w0 = sin(wp.x * 0.05 + wp.y * 0.62 + sim_time * 0.88) * 0.22 * agitation;
let w1 = sin(-wp.x * 0.19 + wp.y * 1.06 + sim_time * 1.18) * 0.15 * agitation;
let norm = normalize(vec3<f32>(-(w0 * 0.12 - w1 * 0.20), 1.0, -(w0 * 0.62 + w1 * 1.06)));
let vdir = -ray;
let ndv = clamp(dot(norm, vdir), 0.002, 1.0);
let fresnel = clamp(0.0204 + 0.9796 * pow(1.0 - ndv, 5.0), 0.022, 0.88);
let hvec = normalize(vdir + sun_dir);
let ndh = max(dot(norm, hvec), 0.0);
let den = ndh * ndh * (0.00018 - 1.0) + 1.0;
let ggx = min(0.00018 / (3.14159265 * den * den), 24.0);
let body = vec3<f32>(0.0004, 0.052, 0.086) + vec3<f32>(0.002, 0.34, 0.43) * clamp(w0 + w1 + 0.12, 0.0, 1.0) * exp(-dist * 0.05);
col = mix(body, vec3<f32>(0.02, 0.09, 0.16), fresnel * 0.58) + vec3<f32>(1.16, 1.02, 0.82) * ggx * 0.55;
}
return vec4<f32>(pow(euv_ocean_aces(col), vec3<f32>(1.0 / 2.2)), 1.0);
}
"#;
pub const MSL_FLUID_OCEAN_SHADER: &str = r#"#include <metal_stdlib>
using namespace metal;
struct OceanUniforms {
float4 viewport_time_agitation;
float4 sun_dir_horizon;
float4 roll_cos_sin_pad;
};
struct OceanVertOut {
float4 pos [[position]];
float2 uv;
};
vertex OceanVertOut euv_ocean_vertex(uint vid [[vertex_id]]) {
float2 pos = float2((vid == 1) ? 3.0 : -1.0, (vid == 2) ? 3.0 : -1.0);
OceanVertOut out;
out.pos = float4(pos, 0.0, 1.0);
out.uv = float2(pos.x * 0.5 + 0.5, 0.5 - pos.y * 0.5);
return out;
}
static inline float3 euv_ocean_aces(float3 hdr) {
float3 num = hdr * (2.51 * hdr + 0.03);
float3 den = hdr * (2.43 * hdr + 0.59) + 0.14;
return clamp(num / max(den, float3(0.0001)), float3(0.0), float3(1.0));
}
fragment float4 euv_ocean_fragment(
OceanVertOut in [[stage_in]],
constant OceanUniforms& u [[buffer(0)]]
) {
float sim_time = u.viewport_time_agitation.z;
float agitation = max(u.viewport_time_agitation.w, 1.0);
float3 sun_dir = normalize(u.sun_dir_horizon.xyz);
float horizon_v = u.sun_dir_horizon.w;
float2 centered = float2((in.uv.x - 0.5) * 2.0, (horizon_v - in.uv.y) * 2.0);
float3 ray = normalize(float3(centered.x, centered.y, 1.62));
float3 color;
if (ray.y >= 0.0) {
float sun_dot = clamp(dot(ray, sun_dir), 0.0, 1.0);
float glow = pow(sun_dot, 16.0);
float disk = smoothstep(0.9992, 0.9997, sun_dot);
float sky_t = smoothstep(0.0, 0.55, ray.y);
float3 horiz = float3(0.16, 0.17, 0.19) + float3(0.68, 0.48, 0.22) * glow;
float3 zenith = float3(0.01, 0.015, 0.024);
color = mix(horiz, zenith, sky_t) + float3(3.2, 2.7, 2.0) * disk;
} else {
float dist = min(1.42 / max(-ray.y, 0.0024), 240.0);
float2 wp = ray.xz * dist;
float w0 = sin(wp.x * 0.05 + wp.y * 0.62 + sim_time * 0.88) * 0.22 * agitation;
float w1 = sin(-wp.x * 0.19 + wp.y * 1.06 + sim_time * 1.18) * 0.15 * agitation;
float3 norm = normalize(float3(-(w0 * 0.12 - w1 * 0.20), 1.0, -(w0 * 0.62 + w1 * 1.06)));
float3 view_dir = -ray;
float ndv = clamp(dot(norm, view_dir), 0.002, 1.0);
float fresnel = clamp(0.0204 + 0.9796 * pow(1.0 - ndv, 5.0), 0.022, 0.88);
float3 half_vec = normalize(view_dir + sun_dir);
float ndh = max(dot(norm, half_vec), 0.0);
float denom = ndh * ndh * (0.00018 - 1.0) + 1.0;
float ggx = min(0.00018 / (3.14159265 * denom * denom), 24.0);
float3 body = float3(0.0004, 0.052, 0.086) + float3(0.002, 0.34, 0.43) * clamp(w0 + w1 + 0.12, 0.0, 1.0) * exp(-dist * 0.05);
float3 sky_refl = float3(0.02, 0.09, 0.16);
color = mix(body, sky_refl, fresnel * 0.58) + float3(1.16, 1.02, 0.82) * ggx * 0.55;
}
float3 ldr = pow(euv_ocean_aces(color), float3(1.0 / 2.2));
return float4(ldr, 1.0);
}
"#;
pub const GLSL_ES3_FLUID_OCEAN_FRAGMENT_SHADER: &str = r#"#version 300 es
precision highp float;
in highp vec2 v_uv;
uniform highp vec4 u_viewport_time_agitation;
uniform highp vec4 u_sun_dir_horizon;
out vec4 out_color;
vec3 euv_ocean_aces(vec3 hdr) {
vec3 num = hdr * (2.51 * hdr + 0.03);
vec3 den = hdr * (2.43 * hdr + 0.59) + 0.14;
return clamp(num / max(den, vec3(0.0001)), vec3(0.0), vec3(1.0));
}
void main() {
float sim_time = u_viewport_time_agitation.z;
float agitation = max(u_viewport_time_agitation.w, 1.0);
vec3 sun_dir = normalize(u_sun_dir_horizon.xyz);
vec3 ray = normalize(vec3((v_uv.x - 0.5) * 2.0, (u_sun_dir_horizon.w - v_uv.y) * 2.0, 1.62));
vec3 color;
if (ray.y >= 0.0) {
float sdot = clamp(dot(ray, sun_dir), 0.0, 1.0);
color = mix(vec3(0.16, 0.17, 0.19) + vec3(0.68, 0.48, 0.22) * pow(sdot, 16.0), vec3(0.01, 0.015, 0.024), smoothstep(0.0, 0.55, ray.y));
} else {
float dist = min(1.42 / max(-ray.y, 0.0024), 240.0);
vec2 wp = ray.xz * dist;
float w0 = sin(wp.x * 0.05 + wp.y * 0.62 + sim_time * 0.88) * 0.22 * agitation;
vec3 norm = normalize(vec3(-w0 * 0.12, 1.0, -w0 * 0.62));
float ndv = clamp(dot(norm, -ray), 0.002, 1.0);
float fresnel = clamp(0.0204 + 0.9796 * pow(1.0 - ndv, 5.0), 0.022, 0.88);
color = mix(vec3(0.0004, 0.052, 0.086), vec3(0.02, 0.09, 0.16), fresnel * 0.58);
}
out_color = vec4(pow(euv_ocean_aces(color), vec3(1.0 / 2.2)), 1.0);
}
"#;
pub const HLSL_FLUID_OCEAN_SHADER: &str = r#"cbuffer OceanUniforms : register(b0) {
float4 viewport_time_agitation;
float4 sun_dir_horizon;
float4 roll_cos_sin_pad;
};
struct OceanVertOut {
float4 pos : SV_Position;
float2 uv : TEXCOORD0;
};
OceanVertOut euv_ocean_vertex(uint vid : SV_VertexID) {
float2 p = float2((vid == 1) ? 3.0 : -1.0, (vid == 2) ? 3.0 : -1.0);
OceanVertOut o;
o.pos = float4(p, 0.0, 1.0);
o.uv = float2(p.x * 0.5 + 0.5, 0.5 - p.y * 0.5);
return o;
}
float3 euv_ocean_aces(float3 hdr) {
float3 num = hdr * (2.51 * hdr + 0.03);
float3 den = hdr * (2.43 * hdr + 0.59) + 0.14;
return saturate(num / max(den, float3(0.0001, 0.0001, 0.0001)));
}
float4 euv_ocean_fragment(OceanVertOut i) : SV_Target {
float3 sun_dir = normalize(sun_dir_horizon.xyz);
float3 ray = normalize(float3((i.uv.x - 0.5) * 2.0, (sun_dir_horizon.w - i.uv.y) * 2.0, 1.62));
float3 col = (ray.y >= 0.0) ? lerp(float3(0.16, 0.17, 0.19), float3(0.01, 0.015, 0.024), smoothstep(0.0, 0.55, ray.y)) : float3(0.002, 0.08, 0.12);
return float4(pow(euv_ocean_aces(col), 1.0 / 2.2), 1.0);
}
"#;
pub(crate) const MTL_SIMULATOR_TOKEN: &str = "simulator";
pub(crate) const MTL_VIRTUAL_TOKEN: &str = "virtual";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_CLS_NS_STRING: &str = "NSString\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_CLS_NS_URL: &str = "NSURL\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_CLS_NS_ARRAY: &str = "NSArray\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_CLS_PIPELINE_DESC: &str = "MTLRenderPipelineDescriptor\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_CLS_PASS_DESC: &str = "MTLRenderPassDescriptor\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_CLS_TEX_DESC: &str = "MTLTextureDescriptor\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_CLS_BINARY_ARCHIVE_DESC: &str = "MTLBinaryArchiveDescriptor\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_ALLOC: &str = "alloc\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_INIT: &str = "init\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_RETAIN: &str = "retain\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_STRING_UTF8: &str = "stringWithUTF8String:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_FILE_URL_WITH_PATH: &str = "fileURLWithPath:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_ARRAY_WITH_OBJECT: &str = "arrayWithObject:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_UTF8_STRING: &str = "UTF8String\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_NAME: &str = "name\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_NEW_CMD_QUEUE: &str = "newCommandQueue\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_NEW_LIBRARY: &str = "newLibraryWithSource:options:error:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_NEW_FUNCTION: &str = "newFunctionWithName:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_NEW_PIPELINE_STATE: &str = "newRenderPipelineStateWithDescriptor:error:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_NEW_BINARY_ARCHIVE: &str = "newBinaryArchiveWithDescriptor:error:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_ADD_PIPELINE_TO_ARCHIVE: &str =
"addRenderPipelineFunctionsWithDescriptor:error:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SERIALIZE_TO_URL: &str = "serializeToURL:error:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_URL: &str = "setUrl:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_BINARY_ARCHIVES: &str = "setBinaryArchives:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_VERTEX_FUNCTION: &str = "setVertexFunction:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_FRAGMENT_FUNCTION: &str = "setFragmentFunction:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_COLOR_ATTACHMENTS: &str = "colorAttachments\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_OBJECT_AT_INDEX: &str = "objectAtIndexedSubscript:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_PIXEL_FORMAT: &str = "setPixelFormat:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_BLENDING_ENABLED: &str = "setBlendingEnabled:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_RGB_BLEND_OP: &str = "setRgbBlendOperation:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_ALPHA_BLEND_OP: &str = "setAlphaBlendOperation:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_SRC_RGB_BLEND: &str = "setSourceRGBBlendFactor:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_DST_RGB_BLEND: &str = "setDestinationRGBBlendFactor:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_SRC_ALPHA_BLEND: &str = "setSourceAlphaBlendFactor:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_DST_ALPHA_BLEND: &str = "setDestinationAlphaBlendFactor:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_TEX_2D_DESC: &str =
"texture2DDescriptorWithPixelFormat:width:height:mipmapped:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_USAGE: &str = "setUsage:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_NEW_TEXTURE: &str = "newTextureWithDescriptor:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_REPLACE_REGION: &str =
"replaceRegion:mipmapLevel:withBytes:bytesPerRow:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_NEW_BUFFER: &str = "newBufferWithBytes:length:options:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_NEW_BUFFER_LENGTH: &str = "newBufferWithLength:options:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_CONTENTS: &str = "contents\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_CMD_BUFFER: &str = "commandBuffer\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_RENDER_ENCODER: &str = "renderCommandEncoderWithDescriptor:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_PIPELINE_STATE: &str = "setRenderPipelineState:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_VERTEX_BUFFER: &str = "setVertexBuffer:offset:atIndex:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_VERTEX_BYTES: &str = "setVertexBytes:length:atIndex:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_FRAGMENT_TEXTURE: &str = "setFragmentTexture:atIndex:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_SCISSOR_RECT: &str = "setScissorRect:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_DRAW_PRIMITIVES_INSTANCED: &str =
"drawPrimitives:vertexStart:vertexCount:instanceCount:baseInstance:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_END_ENCODING: &str = "endEncoding\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_PRESENT_DRAWABLE: &str = "presentDrawable:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_ADD_PRESENTED_HANDLER: &str = "addPresentedHandler:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_ADD_COMPLETED_HANDLER: &str = "addCompletedHandler:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_PRESENTED_TIME: &str = "presentedTime\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_STATUS: &str = "status\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_WAIT_UNTIL_COMPLETED: &str = "waitUntilCompleted\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_GPU_START_TIME: &str = "GPUStartTime\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_GPU_END_TIME: &str = "GPUEndTime\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_NEXT_DRAWABLE: &str = "nextDrawable\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_TEXTURE: &str = "texture\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_WIDTH: &str = "width\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_HEIGHT: &str = "height\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_RENDER_PASS_DESC: &str = "renderPassDescriptor\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_TEXTURE: &str = "setTexture:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_LOAD_ACTION: &str = "setLoadAction:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_STORE_ACTION: &str = "setStoreAction:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_CLEAR_COLOR: &str = "setClearColor:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_DEVICE: &str = "setDevice:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_FRAMEBUFFER_ONLY: &str = "setFramebufferOnly:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_MAX_DRAWABLE_COUNT: &str = "setMaximumDrawableCount:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_DISPLAY_SYNC: &str = "setDisplaySyncEnabled:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_DRAWABLE_SIZE: &str = "drawableSize\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_DRAWABLE_SIZE: &str = "setDrawableSize:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_RESPONDS_TO_SEL: &str = "respondsToSelector:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_COMMIT: &str = "commit\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_RELEASE: &str = "release\0";
pub(crate) const SHADER_STATE_LABEL_VALIDATED_FALLBACK: &str = "LUT + Hash Warm";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_FN_VERTEX: &str = "euv_ui_vertex";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_FN_FRAGMENT: &str = "euv_ui_fragment";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_FN_BLUR_VERTEX: &str = "euv_blur_vertex";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_FN_BLUR_DOWN: &str = "euv_blur_downsample";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_FN_BLUR_UP: &str = "euv_blur_upsample";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_FN_3D_VERTEX: &str = "euv_3d_vertex";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_FN_3D_FRAGMENT: &str = "euv_3d_fragment";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_FN_OCEAN_VERTEX: &str = "euv_ocean_vertex";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_FN_OCEAN_FRAGMENT: &str = "euv_ocean_fragment";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_CLS_VERTEX_DESC: &str = "MTLVertexDescriptor\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_ATTRIBUTES: &str = "attributes\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_LAYOUTS: &str = "layouts\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_FORMAT: &str = "setFormat:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_OFFSET: &str = "setOffset:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_BUFFER_INDEX: &str = "setBufferIndex:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_STRIDE: &str = "setStride:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_STEP_FUNCTION: &str = "setStepFunction:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_STEP_RATE: &str = "setStepRate:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_SEL_SET_VERTEX_DESC: &str = "setVertexDescriptor:\0";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_VERTEX_FORMAT_FLOAT3: usize = 30;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_VERTEX_STEP_PER_VERTEX: usize = 1;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const GPU_DEVICE_APPLE_METAL: &str = "Apple Metal GPU";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_ARCHIVE_FILE_PREFIX: &str = "euv-mtl-pipeline-";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_ARCHIVE_FILE_SUFFIX: &str = ".metallib.archive";
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_PIXEL_FORMAT_R8_UNORM: usize = 10;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_PIXEL_FORMAT_RGBA8_UNORM: usize = 70;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_PIXEL_FORMAT_BGRA8_UNORM: usize = 80;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_LOAD_ACTION_CLEAR: usize = 2;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_STORE_ACTION_STORE: usize = 1;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_PRIMITIVE_TYPE_TRIANGLE: usize = 3;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_CMD_BUFFER_STATUS_COMPLETED: usize = 4;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_BLEND_FACTOR_ONE: usize = 1;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_BLEND_FACTOR_SRC_ALPHA: usize = 4;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const MTL_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA: usize = 5;
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub(crate) const OBJC_BLOCK_IS_GLOBAL: i32 = 1 << 28;
#[cfg(target_os = "windows")]
pub(crate) const DLL_D3D12: &[u8] = b"d3d12.dll\0";
#[cfg(target_os = "windows")]
pub(crate) const DLL_D3DCOMPILER: &[u8] = b"d3dcompiler_47.dll\0";
#[cfg(target_os = "windows")]
pub(crate) const SYM_D3D12_CREATE_DEVICE: &[u8] = b"D3D12CreateDevice\0";
#[cfg(target_os = "windows")]
pub(crate) const SYM_D3D_COMPILE: &[u8] = b"D3DCompile\0";
#[cfg(target_os = "linux")]
pub(crate) const LIB_VULKAN_SONAME: &str = "libvulkan.so.1";
#[cfg(target_os = "android")]
pub(crate) const LIB_VULKAN_SONAME: &str = "libvulkan.so";
#[cfg(any(target_os = "linux", target_os = "android"))]
pub(crate) const SYM_VK_CREATE_INSTANCE: &str = "vkCreateInstance";
#[cfg(any(target_os = "linux", target_os = "android"))]
pub(crate) const SYM_VK_ENUM_DEVICES: &str = "vkEnumeratePhysicalDevices";
#[cfg(any(target_os = "linux", target_os = "android"))]
pub(crate) const RTLD_LAZY_GPU: i32 = 1;