1import{a as F}from"./chunk-GN5HKZIM.js";import{k as v}from"./chunk-K3XQD52A.js";import{F as y,L as x,M as g,c as I,i as b,m as M}from"./chunk-SODT7SMS.js";import{a as d,b as p}from"./chunk-IFGU66OU.js";var _={name:"local-uniform-bit",vertex:{header:` 2 3 struct LocalUniforms { 4 uTransformMatrix:mat3x3<f32>, 5 uColor:vec4<f32>, 6 uRound:f32, 7 } 8 9 @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms; 10 `,main:` 11 vColor *= localUniforms.uColor; 12 modelMatrix *= localUniforms.uTransformMatrix; 13 `,end:` 14 if(localUniforms.uRound == 1) 15 { 16 vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw); 17 } 18 `}},A=p(d({},_),{vertex:p(d({},_.vertex),{header:_.vertex.header.replace("group(1)","group(2)")})}),k={name:"local-uniform-bit",vertex:{header:` 19 20 uniform mat3 uTransformMatrix; 21 uniform vec4 uColor; 22 uniform float uRound; 23 `,main:` 24 vColor *= uColor; 25 modelMatrix = uTransformMatrix; 26 `,end:` 27 if(uRound == 1.) 28 { 29 gl_Position.xy = roundPixels(gl_Position.xy, uResolution); 30 } 31 `}};var P={name:"texture-bit",vertex:{header:` 32 33 struct TextureUniforms { 34 uTextureMatrix:mat3x3<f32>, 35 } 36 37 @group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms; 38 `,main:` 39 uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy; 40 `},fragment:{header:` 41 @group(2) @binding(0) var uTexture: texture_2d<f32>; 42 @group(2) @binding(1) var uSampler: sampler; 43 44 45 `,main:` 46 outColor = textureSample(uTexture, uSampler, vUV); 47 `}},B={name:"texture-bit",vertex:{header:` 48 uniform mat3 uTextureMatrix; 49 `,main:` 50 uv = (uTextureMatrix * vec3(uv, 1.0)).xy; 51 `},fragment:{header:` 52 uniform sampler2D uTexture; 53 54 55 `,main:` 56 outColor = texture(uTexture, vUV); 57 `}};var T=class{constructor(t){this._syncFunctionHash=Object.create(null),this._adaptor=t,this._systemCheck()}_systemCheck(){if(!F())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(t){let a=this.getUniformGroupData(t);t.buffer||(t.buffer=new g({data:new Float32Array(a.layout.size/4),usage:x.UNIFORM|x.COPY_DST}))}getUniformGroupData(t){return this._syncFunctionHash[t._signature]||this._initUniformGroup(t)}_initUniformGroup(t){let a=t._signature,r=this._syncFunctionHash[a];if(!r){let o=Object.keys(t.uniformStructures).map(l=>t.uniformStructures[l]),n=this._adaptor.createUboElements(o),s=this._generateUboSync(n.uboElements);r=this._syncFunctionHash[a]={layout:n,syncFunction:s}}return this._syncFunctionHash[a]}_generateUboSync(t){return this._adaptor.generateUboSync(t)}syncUniformGroup(t,a,r){let o=this.getUniformGroupData(t);t.buffer||(t.buffer=new g({data:new Float32Array(o.layout.size/4),usage:x.UNIFORM|x.COPY_DST}));let n=null;return a||(a=t.buffer.data,n=t.buffer.dataInt32),r||(r=0),o.syncFunction(t.uniforms,a,n,r),!0}updateUniformGroup(t){if(t.isStatic&&!t._dirtyId)return!1;t._dirtyId=0;let a=this.syncUniformGroup(t);return t.buffer.update(),a}destroy(){this._syncFunctionHash=null}};var E=class extends I{constructor({buffer:t,offset:a,size:r}){super(),this.uid=b("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=b("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=t,this.offset=a|0,this.size=r,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=b("resource"),this.emit("change",this)}destroy(t=!1){this.destroyed=!0,t&&this.buffer.destroy(),this.emit("change",this),this.buffer=null,this.removeAllListeners()}};function W(e,t){for(let a in e.attributes){let r=e.attributes[a],o=t[a];o?(r.format??(r.format=o.format),r.offset??(r.offset=o.offset),r.instance??(r.instance=o.instance)):M(`Attribute ${a} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}C(e)}function C(e){let{buffers:t,attributes:a}=e,r={},o={};for(let n in t){let s=t[n];r[s.uid]=0,o[s.uid]=0}for(let n in a){let s=a[n];r[s.buffer.uid]+=y(s.format).stride}for(let n in a){let s=a[n];s.stride??(s.stride=r[s.buffer.uid]),s.start??(s.start=o[s.buffer.uid]),o[s.buffer.uid]+=y(s.format).stride}}var c=[];c[v.NONE]=void 0;c[v.DISABLED]={stencilWriteMask:0,stencilReadMask:0};c[v.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};c[v.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};c[v.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};c[v.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}};var h=[{type:"mat3x3<f32>",test:e=>e.value.a!==void 0,ubo:` 58 var matrix = uv[name].toArray(true); 59 data[offset] = matrix[0]; 60 data[offset + 1] = matrix[1]; 61 data[offset + 2] = matrix[2]; 62 data[offset + 4] = matrix[3]; 63 data[offset + 5] = matrix[4]; 64 data[offset + 6] = matrix[5]; 65 data[offset + 8] = matrix[6]; 66 data[offset + 9] = matrix[7]; 67 data[offset + 10] = matrix[8]; 68 `,uniform:` 69 gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true)); 70 `},{type:"vec4<f32>",test:e=>e.type==="vec4<f32>"&&e.size===1&&e.value.width!==void 0,ubo:` 71 v = uv[name]; 72 data[offset] = v.x; 73 data[offset + 1] = v.y; 74 data[offset + 2] = v.width; 75 data[offset + 3] = v.height; 76 `,uniform:` 77 cv = ud[name].value; 78 v = uv[name]; 79 if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) { 80 cv[0] = v.x; 81 cv[1] = v.y; 82 cv[2] = v.width; 83 cv[3] = v.height; 84 gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height); 85 } 86 `}
86,{type:"vec2<f32>",test:e=>e.type==="vec2<f32>"&&e.size===1&&e.value.x!==void 0,ubo:` 87 v = uv[name]; 88 data[offset] = v.x; 89 data[offset + 1] = v.y; 90 `,uniform:` 91 cv = ud[name].value; 92 v = uv[name]; 93 if (cv[0] !== v.x || cv[1] !== v.y) { 94 cv[0] = v.x; 95 cv[1] = v.y; 96 gl.uniform2f(ud[name].location, v.x, v.y); 97 } 98 `},{type:"vec4<f32>",test:e=>e.type==="vec4<f32>"&&e.size===1&&e.value.red!==void 0,ubo:` 99 v = uv[name]; 100 data[offset] = v.red; 101 data[offset + 1] = v.green; 102 data[offset + 2] = v.blue; 103 data[offset + 3] = v.alpha; 104 `,uniform:` 105 cv = ud[name].value; 106 v = uv[name]; 107 if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) { 108 cv[0] = v.red; 109 cv[1] = v.green; 110 cv[2] = v.blue; 111 cv[3] = v.alpha; 112 gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha); 113 } 114 `},{type:"vec3<f32>",test:e=>e.type==="vec3<f32>"&&e.size===1&&e.value.red!==void 0,ubo:` 115 v = uv[name]; 116 data[offset] = v.red; 117 data[offset + 1] = v.green; 118 data[offset + 2] = v.blue; 119 `,uniform:` 120 cv = ud[name].value; 121 v = uv[name]; 122 if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) { 123 cv[0] = v.red; 124 cv[1] = v.green; 125 cv[2] = v.blue; 126 gl.uniform3f(ud[name].location, v.red, v.green, v.blue); 127 } 128 `}];function tt(e,t,a,r){let o=[` 129 var v = null; 130 var v2 = null; 131 var t = 0; 132 var index = 0; 133 var name = null; 134 var arrayOffset = null; 135 `],n=0;for(let l=0;l<e.length;l++){let f=e[l],U=f.data.name,S=!1,i=0;for(let u=0;u<h.length;u++)if(h[u].test(f.data)){i=f.offset/4,o.push(`name = "${U}";`,`offset += ${i-n};`,h[u][t]||h[u].ubo),S=!0;break}if(!S)if(f.data.size>1)i=f.offset/4,o.push(a(f,i-n));else{let u=r[f.data.type];i=f.offset/4,o.push(` 136 v = uv.${U}; 137 offset += ${i-n}; 138 ${u}; 139 `)}n=i}let s=o.join(` 140`);return new Function("uv","data","dataInt32","offset",s)}function m(e,t){return` 141 for (let i = 0; i < ${e*t}; i++) { 142 data[offset + (((i / ${e})|0) * 4) + (i % ${e})] = v[i]; 143 } 144 `}var D={f32:` 145 data[offset] = v;`,i32:` 146 dataInt32[offset] = v;`,"vec2<f32>":` 147 data[offset] = v[0]; 148 data[offset + 1] = v[1];`,"vec3<f32>":` 149 data[offset] = v[0]; 150 data[offset + 1] = v[1]; 151 data[offset + 2] = v[2];`,"vec4<f32>":` 152 data[offset] = v[0]; 153 data[offset + 1] = v[1]; 154 data[offset + 2] = v[2]; 155 data[offset + 3] = v[3];`,"vec2<i32>":` 156 dataInt32[offset] = v[0]; 157 dataInt32[offset + 1] = v[1];`,"vec3<i32>":` 158 dataInt32[offset] = v[0]; 159 dataInt32[offset + 1] = v[1]; 160 dataInt32[offset + 2] = v[2];`,"vec4<i32>":` 161 dataInt32[offset] = v[0]; 162 dataInt32[offset + 1] = v[1]; 163 dataInt32[offset + 2] = v[2]; 164 dataInt32[offset + 3] = v[3];`,"mat2x2<f32>":` 165 data[offset] = v[0]; 166 data[offset + 1] = v[1]; 167 data[offset + 4] = v[2]; 168 data[offset + 5] = v[3];`,"mat3x3<f32>":` 169 data[offset] = v[0]; 170 data[offset + 1] = v[1]; 171 data[offset + 2] = v[2]; 172 data[offset + 4] = v[3]; 173 data[offset + 5] = v[4]; 174 data[offset + 6] = v[5]; 175 data[offset + 8] = v[6]; 176 data[offset + 9] = v[7]; 177 data[offset + 10] = v[8];`,"mat4x4<f32>":` 178 for (let i = 0; i < 16; i++) { 179 data[offset + i] = v[i]; 180 }`,"mat3x2<f32>":m(3,2),"mat4x2<f32>":m(4,2),"mat2x3<f32>":m(2,3),"mat4x3<f32>":m(4,3),"mat2x4<f32>":m(2,4),"mat3x4<f32>":m(3,4)},at=p(d({},D),{"mat2x2<f32>":` 181 data[offset] = v[0]; 182 data[offset + 1] = v[1]; 183 data[offset + 2] = v[2]; 184 data[offset + 3] = v[3]; 185 `});export{_ as a,A as b,k as c,P as d,B as e,T as f,h as g,tt as h,D as i,at as j,E as k,W as l,c as m};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.