struct Unorm8x4_ { bits: u32, } struct Quad { rect: vec4, uv: vec4, color: Unorm8x4_, clip: u32, scale: f32, radius: f32, kind: u32, third: vec2, } struct Uniforms_quad_corner_quad_color { screen: vec2, } struct QuadVertex_io { @builtin(position) v0_: vec4, @location(0) v1_: vec2, @location(1) v2_: vec2, @location(2) v3_: vec2, @location(3) @interpolate(flat, first) v4_: vec4, @location(4) @interpolate(flat, first) v5_: vec4, @location(5) @interpolate(flat, first) v6_: vec4, @location(6) @interpolate(flat, first) v7_: vec4, @location(7) @interpolate(flat, first) v8_: vec2, @location(8) @interpolate(flat, first) v9_: u32, } struct VertexIndex { index: u32, } struct InstanceIndex { index: u32, } struct ClipPosition { position: vec4, } struct Flat_vec4_ { value: vec4, } struct Flat_vec2_ { value: vec2, } struct Flat_u32_ { value: u32, } struct QuadVertex { clip_pos: ClipPosition, uv: vec2, local: vec2, pixel: vec2, color: Flat_vec4_, clip: Flat_vec4_, shape: Flat_vec4_, ends: Flat_vec4_, third: Flat_vec2_, kind: Flat_u32_, } struct quad_color_out { @location(0) color0_: vec4, } struct Over { color: vec4, } @group(0) @binding(1) var quads: array; @group(0) @binding(2) var clips: array>; @group(0) @binding(3) var atlas: texture_2d; @group(0) @binding(4) var linear: sampler; @group(0) @binding(0) var u: Uniforms_quad_corner_quad_color; @vertex fn quad_corner(@builtin(vertex_index) input0_: u32, @builtin(instance_index) input1_: u32) -> QuadVertex_io { var corners: array, 6>; var local: u32; var local_1: u32; var local_2: u32; let v0_ = VertexIndex(input0_); let v1_ = InstanceIndex(input1_); let _e8 = vec2(1f, 0f); let _e9 = vec2(0f, 1f); corners = array, 6>(vec2(0f, 0f), _e8, _e9, _e9, _e8, vec2(1f, 1f)); let v24_ = corners[v0_.index]; let v25_ = quads[v1_.index].rect; let v28_ = quads[v1_.index].rect; let _e28 = (v25_.xy + (v24_ * v28_.zw)); let v35_ = u.screen.x; let v42_ = u.screen.y; let _e46 = vec2((((2f * _e28.x) / v35_) - 1f), (1f - ((2f * _e28.y) / v42_))); let v54_ = quads[v1_.index].uv; let v56_ = quads[v1_.index].uv; let _e63 = vec2(0.5f); let v64_ = quads[v1_.index].rect; let v93_ = quads[v1_.index].color.bits; let v97_ = quads[v1_.index].color.bits; local = 8u; let _e86 = local; let v103_ = quads[v1_.index].color.bits; local_1 = 16u; let _e97 = local_1; let v109_ = quads[v1_.index].color.bits; local_2 = 24u; let _e108 = local_2; let v71_ = quads[v1_.index].clip; let v72_ = clips[v71_]; let v74_ = quads[v1_.index].scale; let v75_ = quads[v1_.index].radius; let v76_ = quads[v1_.index].rect; let _e137 = (_e63 * v76_.zw); let v85_ = quads[v1_.index].uv; let v87_ = quads[v1_.index].third; let v89_ = quads[v1_.index].kind; let _e157 = QuadVertex(ClipPosition(vec4(_e46.x, _e46.y, 0f, 1f)), mix(v54_.xy, v56_.zw, v24_), ((v24_ - _e63) * v64_.zw), _e28, Flat_vec4_((vec4(f32((v93_ & 255u)), f32(((v97_ >> _e86) & 255u)), f32(((v103_ >> _e97) & 255u)), f32((v109_ >> _e108))) / vec4(255f))), Flat_vec4_(v72_), Flat_vec4_(vec4(v74_, v75_, _e137.x, _e137.y)), Flat_vec4_(v85_), Flat_vec2_(v87_), Flat_u32_(v89_)); return QuadVertex_io(_e157.clip_pos.position, _e157.uv, _e157.local, _e157.pixel, _e157.color.value, _e157.clip.value, _e157.shape.value, _e157.ends.value, _e157.third.value, _e157.kind.value); } @fragment fn quad_color(varyings: QuadVertex_io) -> quad_color_out { var coverage: f32; var rgb: vec3; var logic: bool; var if_: f32; var logic_1: bool; var logic_2: bool; var logic_3: bool; var logic_4: bool; var if_1: f32; var logic_5: bool; var logic_6: bool; var if_2: f32; var if_3: f32; var if_4: f32; var if_5: f32; let v0_1 = QuadVertex(ClipPosition(varyings.v0_), varyings.v1_, varyings.v2_, varyings.v3_, Flat_vec4_(varyings.v4_), Flat_vec4_(varyings.v5_), Flat_vec4_(varyings.v6_), Flat_vec4_(varyings.v7_), Flat_vec2_(varyings.v8_), Flat_u32_(varyings.v9_)); coverage = 1f; rgb = v0_1.color.value.xyz; if (v0_1.kind.value == 4u) { let v193_ = textureSampleLevel(atlas, linear, v0_1.uv, 0f); rgb = v193_.xyz; coverage = v193_.w; } else { if (v0_1.shape.value.x > 0f) { let v196_ = textureSampleLevel(atlas, linear, v0_1.uv, 0f); coverage = saturate(((((max(min(v196_.x, v196_.y), min(max(v196_.x, v196_.y), v196_.z)) - 0.5f) * v0_1.shape.value.x) + 0.5f) + v0_1.shape.value.y)); } else { if (v0_1.kind.value == 5u) { let _e67 = v0_1.ends.value.xy; let _e68 = v0_1.ends.value.zw; let _e71 = (_e68 - _e67); let _e72 = (v0_1.third.value - _e68); let _e73 = (_e67 - v0_1.third.value); let _e74 = (v0_1.pixel - _e67); let _e75 = (v0_1.pixel - _e68); let _e76 = (v0_1.pixel - v0_1.third.value); let _e85 = (_e74 - (_e71 * vec2(clamp((dot(_e74, _e71) / max(dot(_e71, _e71), 0.000000001f)), 0f, 1f)))); let _e93 = (_e75 - (_e72 * vec2(clamp((dot(_e75, _e72) / max(dot(_e72, _e72), 0.000000001f)), 0f, 1f)))); let _e101 = (_e76 - (_e73 * vec2(clamp((dot(_e76, _e73) / max(dot(_e73, _e73), 0.000000001f)), 0f, 1f)))); let _e107 = sqrt(min(min(dot(_e85, _e85), dot(_e93, _e93)), dot(_e101, _e101))); let _e114 = ((_e71.x * _e73.y) - (_e71.y * _e73.x)); let _e135 = ((((_e74.x * _e71.y) - (_e74.y * _e71.x)) * _e114) >= 0f); logic_5 = _e135; let v457_ = logic_5; logic_5 = select(v457_, ((((_e75.x * _e72.y) - (_e75.y * _e72.x)) * _e114) >= 0f), _e135); let v318_ = logic_5; logic_6 = v318_; let v319_ = logic_5; let v459_ = logic_6; logic_6 = select(v459_, ((((_e76.x * _e73.y) - (_e76.y * _e73.x)) * _e114) >= 0f), v319_); let v323_ = logic_6; if_2 = select(_e107, -(_e107), v323_); let v327_ = if_2; let _e161 = saturate((0.5f - v327_)); coverage = _e161; let v462_ = coverage; coverage = select(v462_, (_e161 * saturate(((0.5f + v327_) + v0_1.shape.value.y))), (v0_1.shape.value.y > 0f)); } else { if (v0_1.kind.value == 3u) { let _e178 = v0_1.ends.value.xy; let _e180 = (v0_1.ends.value.zw - _e178); let _e181 = dot(_e180, _e180); let _e183 = (v0_1.pixel - _e178); if_3 = select(0f, clamp((dot(_e183, _e180) / _e181), 0f, 1f), (_e181 > 0f)); let v348_ = if_3; coverage = saturate((0.5f - (length((_e183 - (_e180 * vec2(v348_)))) - v0_1.shape.value.y))); } else { let _e202 = (v0_1.kind.value == 1u); logic = _e202; let v465_ = logic; logic = select(v465_, (v0_1.kind.value == 2u), !(_e202)); let v88_ = logic; if v88_ { if _e202 { let _e214 = v0_1.shape.value.zw; let _e216 = length((v0_1.local / _e214)); let _e219 = length((v0_1.local / (_e214 * _e214))); if_4 = select(-(min(_e214.x, _e214.y)), ((_e216 * (_e216 - 1f)) / _e219), (_e219 > 0f)); let v382_ = if_4; if_ = v382_; } else { let _e234 = v0_1.shape.value.zw; let _e235 = abs(v0_1.local); let _e251 = clamp(((((_e234.x - (2f * _e235.x)) * _e234.x) - ((_e234.y - (2f * _e235.y)) * _e234.y)) / dot(_e234, _e234)), -1f, 1f); let _e260 = length((_e235 - ((vec2(0.5f) * _e234) * vec2((1f - _e251), (1f + _e251))))); if_5 = select(-(_e260), _e260, ((((_e235.x * _e234.y) + (_e235.y * _e234.x)) - (_e234.x * _e234.y)) > 0f)); let v438_ = if_5; if_ = v438_; } let v100_ = if_; let _e277 = saturate((0.5f - v100_)); coverage = _e277; let v469_ = coverage; coverage = select(v469_, (_e277 * saturate(((0.5f + v100_) + v0_1.uv.x))), (v0_1.uv.x > 0f)); } else { let _e291 = (v0_1.shape.value.y > 0f); logic_1 = _e291; let _e296 = (v0_1.uv.x > 0f); let v471_ = logic_1; logic_1 = select(v471_, _e296, !(_e291)); let v123_ = logic_1; if v123_ { let _e308 = ((abs(v0_1.local) - v0_1.shape.value.zw) + vec2(v0_1.shape.value.y)); let _e317 = ((length(max(_e308, vec2(0f))) + min(max(_e308.x, _e308.y), 0f)) - v0_1.shape.value.y); let _e320 = saturate((0.5f - _e317)); coverage = _e320; let v473_ = coverage; coverage = select(v473_, (_e320 * saturate(((0.5f + _e317) + v0_1.uv.x))), _e296); } } } } } } let _e335 = (v0_1.pixel.x >= v0_1.clip.value.x); logic_2 = _e335; let v475_ = logic_2; logic_2 = select(v475_, (v0_1.pixel.x < v0_1.clip.value.z), _e335); let v167_ = logic_2; logic_3 = v167_; let v168_ = logic_2; let v477_ = logic_3; logic_3 = select(v477_, (v0_1.pixel.y >= v0_1.clip.value.y), v168_); let v172_ = logic_3; logic_4 = v172_; let v173_ = logic_3; let v479_ = logic_4; logic_4 = select(v479_, (v0_1.pixel.y < v0_1.clip.value.w), v173_); let v177_ = logic_4; let v180_ = coverage; if_1 = select(0f, (v0_1.color.value.w * v180_), v177_); let v183_ = if_1; let v184_ = rgb; return quad_color_out(Over(vec4(v184_.x, v184_.y, v184_.z, v183_)).color); }