struct MarkRun { ab: vec4, cuts: vec4, after: vec4, shape: vec4, } struct Ink { centre: vec2, origin: vec2, ems: f32, count: u32, } struct Uniforms_quad_mark_ink { screen: vec2, rect: vec4, look: Ink, } struct Vertex_io { @builtin(position) v0_: vec4, @location(0) v1_: vec2, @location(1) v2_: vec2, } struct VertexIndex { index: u32, } struct ClipPosition { position: vec4, } struct Vertex { position: ClipPosition, uv: vec2, pixel: vec2, } struct mark_ink_out { @location(0) color0_: vec4, } @group(0) @binding(1) var runs: array; @group(0) @binding(0) var u: Uniforms_quad_mark_ink; @vertex fn quad(@builtin(vertex_index) input0_: u32) -> Vertex_io { var corners: array, 6>; let v0_ = VertexIndex(input0_); let _e5 = vec2(1f, 0f); let _e6 = vec2(0f, 1f); corners = array, 6>(vec2(0f, 0f), _e5, _e6, _e6, _e5, vec2(1f, 1f)); let v21_ = corners[v0_.index]; let v22_ = u.rect; let v24_ = u.rect; let _e23 = (v22_.xy + (v24_.zw * v21_)); let v30_ = u.screen.x; let v37_ = u.screen.y; let _e43 = Vertex(ClipPosition(vec4((((_e23.x / v30_) * 2f) - 1f), (1f - ((_e23.y / v37_) * 2f)), 0f, 1f)), v21_, _e23); return Vertex_io(_e43.position.position, _e43.uv, _e43.pixel); } @fragment fn mark_ink(varyings: Vertex_io) -> mark_ink_out { var d: f32; var counter: u32; var logic: bool; var logic_1: bool; var logic_2: bool; var d_1: f32; var local: f32; let v0_1 = Vertex(ClipPosition(varyings.v0_), varyings.v1_, varyings.v2_); let v2_ = u.look.origin; let _e11 = (v0_1.pixel + v2_); let v23_ = u.look.centre.x; let v25_ = u.look.centre.y; let v29_ = u.look.ems; local = 0.7f; let _e36 = local; let _e40 = ((vec2((_e11.x - v23_), (v25_ - _e11.y)) / vec2(v29_)) + vec2(0f, (_e36 * 0.5f))); let v7_ = u.look.ems; let _e48 = vec2((0.56f + (0.5f / v7_))); d = 100f; let v43_ = u.look.count; counter = 0u; loop { let v45_ = counter; if (v45_ >= v43_) { break; } let v47_ = counter; let v50_ = runs[v47_].ab; let v52_ = runs[v47_].ab; let _e73 = (min(v50_.xy, v52_.zw) - _e48); let v59_ = runs[v47_].ab; let v61_ = runs[v47_].ab; let _e85 = (max(v59_.xy, v61_.zw) + _e48); let _e88 = (_e40.x < _e73.x); logic = _e88; let v168_ = logic; logic = select(v168_, (_e40.y < _e73.y), !(_e88)); let v73_ = logic; logic_1 = v73_; let v74_ = logic; let v170_ = logic_1; logic_1 = select(v170_, (_e40.x > _e85.x), !(v74_)); let v79_ = logic_1; logic_2 = v79_; let v80_ = logic_1; let v172_ = logic_2; logic_2 = select(v172_, (_e40.y > _e85.y), !(v80_)); let v85_ = logic_2; if v85_ { continue; } let v89_ = runs[v47_].ab; let _e128 = v89_.xy; let v91_ = runs[v47_].ab; let _e133 = v91_.zw; let _e135 = normalize((_e133 - _e128)); let _e136 = (_e40 - _e128); let v106_ = runs[v47_].shape.x; let _e148 = (abs(dot(_e136, vec2(-(_e135.y), _e135.x))) - v106_); let v111_ = runs[v47_].cuts; let _e156 = (_e40 - _e133); let v118_ = runs[v47_].cuts; let _e164 = max(_e148, max(-(dot(_e136, v111_.xy)), dot(_e156, v118_.zw))); d_1 = _e164; let v124_ = runs[v47_].after.z; if (v124_ > 0.5f) { let v127_ = runs[v47_].after; let _e176 = v127_.xy; let v138_ = runs[v47_].shape.x; let v146_ = runs[v47_].cuts; d_1 = min(_e164, max(max(_e148, (abs(dot(_e156, vec2(-(_e176.y), _e176.x))) - v138_)), -(dot(_e136, v146_.xy)))); } let v153_ = runs[v47_].shape.y; let v157_ = runs[v47_].shape.z; let v160_ = d_1; let v162_ = d; d = min(v162_, max(v160_, max((v153_ - _e40.y), (_e40.y - v157_)))); continuing { let v164_ = counter; counter = (v164_ + 1u); } } let v167_ = d; let v13_ = u.look.ems; return mark_ink_out(vec4(saturate((0.5f - (v167_ * v13_))), 0f, 0f, 1f)); }