Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebc96c33d4 |
+28
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1792506237,
|
||||
"narHash": "sha256-Q/8KLB6jNfpaUN1HAedE/u/Et9feE/zYSsutBLKrCFk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5adc50831c259f87faeb09ddf930d43597197473",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"narHash": "sha256-Q/8KLB6jNfpaUN1HAedE/u/Et9feE/zYSsutBLKrCFk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5adc50831c259f87faeb09ddf930d43597197473",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
description = "A devbox shell";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/5adc50831c259f87faeb09ddf930d43597197473?narHash=sha256-Q%2F8KLB6jNfpaUN1HAedE%2Fu%2FEt9feE%2FzYSsutBLKrCFk%3D";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
}:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
in
|
||||
{
|
||||
devShells.x86_64-linux.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
(builtins.trace "downloading nodejs@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/m7vfpzl1rjwjpwlcsqs166jn3lywzpq1-nodejs-26.11.1";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
(builtins.trace "downloading chromium@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/ky199ji3a5drs6rm3wr5zidamx9dhz56-chromium-155.0.8059.39";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
test -z $DEVBOX_COREPACK_ENABLED || corepack enable --install-directory "/home/davide/Projects/GDR/FFF_vtt/prototype-pixi-perf/.devbox/virtenv/nodejs/corepack-bin/"
|
||||
test -z $DEVBOX_COREPACK_ENABLED || export PATH="/home/davide/Projects/GDR/FFF_vtt/prototype-pixi-perf/.devbox/virtenv/nodejs/corepack-bin/:$PATH"
|
||||
echo 'Welcome to devbox!' > /dev/null
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_82777949af64e60588d04946c294a711c1152a3ab8a1985294adb029b7cb93e1" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-pixi-perf/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
echo "Error: no test specified" && exit 1
|
||||
@@ -0,0 +1,11 @@
|
||||
let
|
||||
pkgs = import
|
||||
(fetchTarball {
|
||||
url = "https://github.com/nixos/nixpkgs/archive/b9c00c1d41ccd6385da243415299b39aa73357be.tar.gz";
|
||||
})
|
||||
{ };
|
||||
in
|
||||
with pkgs;
|
||||
mkShell {
|
||||
packages = [];
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
# ARCHIVE SNAPSHOT — prototype-pixi-perf (artifacts only)
|
||||
|
||||
Stale working directory of the throwaway *Pixi v8 VTT perf prototype* (page title:
|
||||
`Pixi v8 VTT perf prototype (throwaway)`): a measurement harness asking whether PixiJS v8 can draw
|
||||
a VTT-sized scene (large maps, many tokens, fog, labels) on modest hardware.
|
||||
|
||||
It contained **no source when it was archived** — the `src/`, `package.json`, `tsconfig.json`,
|
||||
`bench.mjs` and `devbox.json`/`devbox.lock` are gone. The source tree already lives in the repo at
|
||||
[`docs/archive/prototypes/pixi-perf/`](../../docs/archive/prototypes/pixi-perf/) (with its README and
|
||||
benchmark tables); this snapshot is kept only as the surviving build/built-environment evidence.
|
||||
|
||||
## What is here
|
||||
|
||||
| Path | What |
|
||||
|---|---|
|
||||
| `dist/` | vite/rolldown build output, two builds side by side (`index.html` + `assets/`). Some 60-byte chunks are re-export stubs of chunks from the other build. No recorded commit/version. |
|
||||
| `.devbox/gen/` | devbox-generated files from the missing `devbox.json`: `flake/flake.nix`, `flake/flake.lock`, `shell.nix`, `scripts/{.hooks.sh,test.sh}`. The flake pins nodejs 26.11.1 and chromium 155 via `fetchClosure`. `scripts/*.sh` contain absolute paths to the original directory and are not runnable here. |
|
||||
|
||||
## What was left out (still on the owner's disk, not committed)
|
||||
|
||||
- `node_modules/` — 176 MB, reproducible from the lost `package.json`.
|
||||
- `.devbox/` runtime state: `nix/`, `virtenv/`, `.nix-print-dev-env-cache`, `state.json`, `shell_history`.
|
||||
|
||||
Do not build or revive this tree; the maintained client is `/client`.
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
export{t as CanvasRenderer}from"./CanvasRenderer-B9I0uwRT.js";
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
export{t as WebGLRenderer}from"./WebGLRenderer-xtFIoQ3h.js";
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
export{t as WebGPURenderer}from"./WebGPURenderer-Ah1UBSE1.js";
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,195 @@
|
||||
import{$ as e,i as t,it as n,m as r,r as i,z as a}from"./CanvasPool-D7boKVdp.js";import{k as o,w as s}from"./RenderTargetSystem-CMoV04MF.js";var c={name:`local-uniform-bit`,vertex:{header:`
|
||||
|
||||
struct LocalUniforms {
|
||||
uTransformMatrix:mat3x3<f32>,
|
||||
uColor:vec4<f32>,
|
||||
uRound:f32,
|
||||
}
|
||||
|
||||
@group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
||||
`,main:`
|
||||
vColor *= localUniforms.uColor;
|
||||
modelMatrix *= localUniforms.uTransformMatrix;
|
||||
`,end:`
|
||||
if(localUniforms.uRound == 1)
|
||||
{
|
||||
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
||||
}
|
||||
`}},l={...c,vertex:{...c.vertex,header:c.vertex.header.replace(`group(1)`,`group(2)`)}},u={name:`local-uniform-bit`,vertex:{header:`
|
||||
|
||||
uniform mat3 uTransformMatrix;
|
||||
uniform vec4 uColor;
|
||||
uniform float uRound;
|
||||
`,main:`
|
||||
vColor *= uColor;
|
||||
modelMatrix = uTransformMatrix;
|
||||
`,end:`
|
||||
if(uRound == 1.)
|
||||
{
|
||||
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
||||
}
|
||||
`}},d={name:`texture-bit`,vertex:{header:`
|
||||
|
||||
struct TextureUniforms {
|
||||
uTextureMatrix:mat3x3<f32>,
|
||||
}
|
||||
|
||||
@group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;
|
||||
`,main:`
|
||||
uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;
|
||||
`},fragment:{header:`
|
||||
@group(2) @binding(0) var uTexture: texture_2d<f32>;
|
||||
@group(2) @binding(1) var uSampler: sampler;
|
||||
|
||||
|
||||
`,main:`
|
||||
outColor = textureSample(uTexture, uSampler, vUV);
|
||||
`}},f={name:`texture-bit`,vertex:{header:`
|
||||
uniform mat3 uTextureMatrix;
|
||||
`,main:`
|
||||
uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
|
||||
`},fragment:{header:`
|
||||
uniform sampler2D uTexture;
|
||||
|
||||
|
||||
`,main:`
|
||||
outColor = texture(uTexture, vUV);
|
||||
`}};function p(e,t){for(let n in e.attributes){let r=e.attributes[n],i=t[n];i?(r.format??=i.format,r.offset??=i.offset,r.instance??=i.instance):r.format||a(`Attribute ${n} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}m(e)}function m(e){let{buffers:t,attributes:n}=e,i={},a={};for(let e in t){let n=t[e];i[n.uid]=0,a[n.uid]=0}for(let e in n){let t=n[e];i[t.buffer.uid]+=r(t.format).stride}for(let e in n){let t=n[e];t.stride??=i[t.buffer.uid],t.start??=a[t.buffer.uid],a[t.buffer.uid]+=r(t.format).stride}}var h=[];h[s.NONE]=void 0,h[s.DISABLED]={stencilWriteMask:0,stencilReadMask:0},h[s.RENDERING_MASK_ADD]={stencilFront:{compare:`equal`,passOp:`increment-clamp`},stencilBack:{compare:`equal`,passOp:`increment-clamp`}},h[s.RENDERING_MASK_REMOVE]={stencilFront:{compare:`equal`,passOp:`decrement-clamp`},stencilBack:{compare:`equal`,passOp:`decrement-clamp`}},h[s.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:`equal`,passOp:`keep`},stencilBack:{compare:`equal`,passOp:`keep`}},h[s.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:`not-equal`,passOp:`keep`},stencilBack:{compare:`not-equal`,passOp:`keep`}};var g=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck()}_systemCheck(){if(!o())throw Error(`Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.`)}ensureUniformGroup(e){let n=this.getUniformGroupData(e);e.buffer||=new i({data:new Float32Array(n.layout.size/4),usage:t.UNIFORM|t.COPY_DST})}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){let t=e._signature,n=this._syncFunctionHash[t];if(!n){let r=Object.keys(e.uniformStructures).map(t=>e.uniformStructures[t]),i=this._adaptor.createUboElements(r),a=this._generateUboSync(i.uboElements);n=this._syncFunctionHash[t]={layout:i,syncFunction:a}}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,n,r){let a=this.getUniformGroupData(e);e.buffer||=new i({data:new Float32Array(a.layout.size/4),usage:t.UNIFORM|t.COPY_DST});let o=null;return n||(n=e.buffer.data,o=e.buffer.dataInt32),r||=0,a.syncFunction(e.uniforms,n,o,r),!0}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return!1;e._dirtyId=0;let t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null}},_=[{type:`mat3x3<f32>`,test:e=>e.value.a!==void 0,ubo:`
|
||||
var matrix = uv[name].toArray(true);
|
||||
data[offset] = matrix[0];
|
||||
data[offset + 1] = matrix[1];
|
||||
data[offset + 2] = matrix[2];
|
||||
data[offset + 4] = matrix[3];
|
||||
data[offset + 5] = matrix[4];
|
||||
data[offset + 6] = matrix[5];
|
||||
data[offset + 8] = matrix[6];
|
||||
data[offset + 9] = matrix[7];
|
||||
data[offset + 10] = matrix[8];
|
||||
`,uniform:`
|
||||
gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
|
||||
`},{type:`vec4<f32>`,test:e=>e.type===`vec4<f32>`&&e.size===1&&e.value.width!==void 0,ubo:`
|
||||
v = uv[name];
|
||||
data[offset] = v.x;
|
||||
data[offset + 1] = v.y;
|
||||
data[offset + 2] = v.width;
|
||||
data[offset + 3] = v.height;
|
||||
`,uniform:`
|
||||
cv = ud[name].value;
|
||||
v = uv[name];
|
||||
if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {
|
||||
cv[0] = v.x;
|
||||
cv[1] = v.y;
|
||||
cv[2] = v.width;
|
||||
cv[3] = v.height;
|
||||
gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);
|
||||
}
|
||||
`},{type:`vec2<f32>`,test:e=>e.type===`vec2<f32>`&&e.size===1&&e.value.x!==void 0,ubo:`
|
||||
v = uv[name];
|
||||
data[offset] = v.x;
|
||||
data[offset + 1] = v.y;
|
||||
`,uniform:`
|
||||
cv = ud[name].value;
|
||||
v = uv[name];
|
||||
if (cv[0] !== v.x || cv[1] !== v.y) {
|
||||
cv[0] = v.x;
|
||||
cv[1] = v.y;
|
||||
gl.uniform2f(ud[name].location, v.x, v.y);
|
||||
}
|
||||
`},{type:`vec4<f32>`,test:e=>e.type===`vec4<f32>`&&e.size===1&&e.value.red!==void 0,ubo:`
|
||||
v = uv[name];
|
||||
data[offset] = v.red;
|
||||
data[offset + 1] = v.green;
|
||||
data[offset + 2] = v.blue;
|
||||
data[offset + 3] = v.alpha;
|
||||
`,uniform:`
|
||||
cv = ud[name].value;
|
||||
v = uv[name];
|
||||
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {
|
||||
cv[0] = v.red;
|
||||
cv[1] = v.green;
|
||||
cv[2] = v.blue;
|
||||
cv[3] = v.alpha;
|
||||
gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);
|
||||
}
|
||||
`},{type:`vec3<f32>`,test:e=>e.type===`vec3<f32>`&&e.size===1&&e.value.red!==void 0,ubo:`
|
||||
v = uv[name];
|
||||
data[offset] = v.red;
|
||||
data[offset + 1] = v.green;
|
||||
data[offset + 2] = v.blue;
|
||||
`,uniform:`
|
||||
cv = ud[name].value;
|
||||
v = uv[name];
|
||||
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {
|
||||
cv[0] = v.red;
|
||||
cv[1] = v.green;
|
||||
cv[2] = v.blue;
|
||||
gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
|
||||
}
|
||||
`}];function v(e,t,n){let r=[`
|
||||
var v = null;
|
||||
var v2 = null;
|
||||
var t = 0;
|
||||
var index = 0;
|
||||
var name = null;
|
||||
var arrayOffset = null;
|
||||
`],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=o.data.name,c=!1,l=0;for(let e=0;e<_.length;e++)if(_[e].test(o.data)){l=o.offset/4,r.push(`name = "${s}";`,`offset += ${l-i};`,_[e].ubo),c=!0;break}if(!c){if(o.data.size>1)l=o.offset/4,r.push(n(o,l-i));else{let e=t[o.data.type];l=o.offset/4,r.push(`
|
||||
v = uv.${s};
|
||||
offset += ${l-i};
|
||||
${e};
|
||||
`)}}i=l}let a=r.join(`
|
||||
`);return Function(`uv`,`data`,`dataInt32`,`offset`,a)}function y(e,t){return`
|
||||
for (let i = 0; i < ${e*t}; i++) {
|
||||
data[offset + (((i / ${e})|0) * 4) + (i % ${e})] = v[i];
|
||||
}
|
||||
`}var b={f32:`
|
||||
data[offset] = v;`,i32:`
|
||||
dataInt32[offset] = v;`,u32:`
|
||||
dataInt32[offset] = v;`,"vec2<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];`,"vec3<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];
|
||||
data[offset + 2] = v[2];`,"vec4<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];
|
||||
data[offset + 2] = v[2];
|
||||
data[offset + 3] = v[3];`,"vec2<i32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];`,"vec3<i32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];
|
||||
dataInt32[offset + 2] = v[2];`,"vec4<i32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];
|
||||
dataInt32[offset + 2] = v[2];
|
||||
dataInt32[offset + 3] = v[3];`,"vec2<u32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];`,"vec3<u32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];
|
||||
dataInt32[offset + 2] = v[2];`,"vec4<u32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];
|
||||
dataInt32[offset + 2] = v[2];
|
||||
dataInt32[offset + 3] = v[3];`,"mat2x2<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];
|
||||
data[offset + 4] = v[2];
|
||||
data[offset + 5] = v[3];`,"mat3x3<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];
|
||||
data[offset + 2] = v[2];
|
||||
data[offset + 4] = v[3];
|
||||
data[offset + 5] = v[4];
|
||||
data[offset + 6] = v[5];
|
||||
data[offset + 8] = v[6];
|
||||
data[offset + 9] = v[7];
|
||||
data[offset + 10] = v[8];`,"mat4x4<f32>":`
|
||||
for (let i = 0; i < 16; i++) {
|
||||
data[offset + i] = v[i];
|
||||
}`,"mat3x2<f32>":y(3,2),"mat4x2<f32>":y(4,2),"mat2x3<f32>":y(2,3),"mat4x3<f32>":y(4,3),"mat2x4<f32>":y(2,4),"mat3x4<f32>":y(3,4)},x={...b,"mat2x2<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];
|
||||
data[offset + 2] = v[2];
|
||||
data[offset + 3] = v[3];
|
||||
`},S=class extends n{constructor({buffer:t,offset:n,size:r}){super(),this.uid=e(`buffer`),this._resourceType=`bufferResource`,this._resourceId=e(`resource`),this._bufferResource=!0,this.destroyed=!1,this.buffer=t,this.offset=n|0,this.size=r,this.buffer.on(`change`,this.onBufferChange,this)}get _gcLastUsed(){return this.buffer?._gcLastUsed??-1}set _gcLastUsed(e){this.buffer&&(this.buffer._gcLastUsed=e)}onBufferChange(){this._resourceId=e(`resource`),this.emit(`change`,this)}destroy(e=!1){this.destroyed=!0,e&&this.buffer.destroy(),this.emit(`change`,this),this.buffer=null,this.removeAllListeners()}};function C(e,t,n,r,i){if(e=Math.max(0,e),t=Math.min(t,n*r),e>=t)return 0;let a=Math.floor(e/n),o=e-a*n,s=Math.floor(t/n),c=t-s*n;if(a===s)return i[0].set(o,a,c-o,1),1;let l=0,u=a;return o>0&&(i[l++].set(o,a,n-o,1),u++),s>u&&i[l++].set(0,u,n,s-u),c>0&&i[l++].set(0,s,c,1),l}export{v as a,h as c,f as d,c as f,x as i,p as l,l as m,S as n,_ as o,u as p,b as r,g as s,C as t,d as u};
|
||||
@@ -0,0 +1 @@
|
||||
import{H as e,d as t}from"./CanvasPool-D7boKVdp.js";var n={};function r(e,t,r){let a=2166136261;for(let n=0;n<t;n++)a^=e[n].uid,a=Math.imul(a,16777619),a>>>=0;return n[a]||i(e,t,a,r)}function i(r,i,a,o){let s={},c=0;for(let t=0;t<o;t++){let n=t<i?r[t]:e.EMPTY.source;s[c++]=n.source,s[c++]=n.style}let l=new t(s);return n[a]=l,l}export{r as t};
|
||||
+176
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import"./init-B6Qf-G3_.js";import"./init-DhuZGTya.js";
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
<title>Pixi v8 VTT perf prototype (throwaway)</title>
|
||||
<style>html,body{color:#eee;background:#111;height:100%;margin:0;font:12px monospace;overflow:hidden}canvas{touch-action:none;display:block}.panel{background:#000000bf;border-radius:4px;padding:6px 8px;position:fixed}#stats{white-space:pre;pointer-events:none;top:4px;left:4px}#ctl{flex-direction:column;gap:4px;max-width:280px;max-height:96vh;display:flex;top:4px;right:4px;overflow:auto}#ctl label{justify-content:space-between;align-items:center;gap:6px;display:flex}#out{width:100%;height:120px;font:10px monospace}button,select,input{font:inherit}</style>
|
||||
<script type="module" crossorigin src="/assets/index-DGEUfWn8.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/CanvasPool-D7boKVdp.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/canvasUtils-CaEVVZFN.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/init-B6Qf-G3_.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/RenderTargetSystem-CMoV04MF.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/getTexelRangeRects-C0M2ZYld.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/getTextureBatchBindGroup-DSYuDkeh.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/CanvasRenderer-B9I0uwRT.js">
|
||||
</head>
|
||||
<body>
|
||||
<div id="stats" class="panel"></div>
|
||||
<div id="ctl" class="panel"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1792506237,
|
||||
"narHash": "sha256-Q/8KLB6jNfpaUN1HAedE/u/Et9feE/zYSsutBLKrCFk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5adc50831c259f87faeb09ddf930d43597197473",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"narHash": "sha256-Q/8KLB6jNfpaUN1HAedE/u/Et9feE/zYSsutBLKrCFk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5adc50831c259f87faeb09ddf930d43597197473",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
{
|
||||
description = "A devbox shell";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/5adc50831c259f87faeb09ddf930d43597197473?narHash=sha256-Q%2F8KLB6jNfpaUN1HAedE%2Fu%2FEt9feE%2FzYSsutBLKrCFk%3D";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
}:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
in
|
||||
{
|
||||
devShells.x86_64-linux.default = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
(builtins.trace "downloading gettext@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/gfkkr23q11kvyz6xxyxz3qbsp1msxdcv-gettext-1.0";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
(builtins.trace "downloading gettext@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/njdszjnrb0n7c6m6jzmx5539ac0ybn9g-gettext-1.0-man";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
(builtins.trace "downloading gawk@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/63g104xwbzfpcq0h7c99w19m6j9ly3p1-gawk-5.4.1";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
(builtins.trace "downloading gawk@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/0azvqykndxs3clnj974q99cjfnmpprjv-gawk-5.4.1-man";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
(builtins.trace "downloading nim@2" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/0cbdz34lsakfirycixckf6ypsd8hazhg-x86_64-unknown-linux-gnu-nim-wrapper-2.2.12";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
(builtins.trace "downloading nimble@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/8f5wx2s80gnw0lkmdpbl63n1xlilcfxi-nimble-0.24.1";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
(builtins.trace "downloading nginx@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/6k4rgdzx05z7yk2l98r28p6wrbnlv63z-nginx-1.30.5";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
(builtins.trace "downloading nodejs@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/m7vfpzl1rjwjpwlcsqs166jn3lywzpq1-nodejs-26.11.1";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
(builtins.trace "downloading sqlite@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/9x0m6s73sg89fv5awb95vsac2mbns8n0-sqlite-3.53.3";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
(builtins.trace "downloading sqlite@latest" (builtins.fetchClosure {
|
||||
|
||||
fromStore = "https://cache.nixos.org";
|
||||
fromPath = "/nix/store/iy2zkfn4l0w24xabv6ryi0vh7bpjvqm6-sqlite-3.53.3-bin";
|
||||
inputAddressed = true;
|
||||
}))
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
eval $DEVBOX_RUN_CMD
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
test -z $DEVBOX_COREPACK_ENABLED || corepack enable --install-directory "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/virtenv/nodejs/corepack-bin/"
|
||||
test -z $DEVBOX_COREPACK_ENABLED || export PATH="/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/virtenv/nodejs/corepack-bin/:$PATH"
|
||||
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
mkdir -p results; nim c -d:release --hints:off -r -o:run/bench tools/bench.nim | tee results/bench.log
|
||||
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
cd client && npm install --silent && npm run check && npm run build
|
||||
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
mkdir -p results; (cd client && npm run check) > results/client-tests.log 2>&1; rc=$?; cat results/client-tests.log; exit $rc
|
||||
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
mkdir -p results; D=${DUR:-60}; N=${TAG:-${D}s}; tools/withserver.sh node tools/concurrency.mjs > results/concurrency-$N.log 2>&1; rc=$?; cat results/concurrency-$N.log; grep STATS run/test/server.log | awk '{k=$0; sub(/ n=.*/, "", k); a[k]=$0} END{for (k in a) print a[k]}' | sort > results/concurrency-$N-server.log; { grep SLOW run/test/server.log >> results/concurrency-$N-server.log || true; }; exit $rc
|
||||
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
tools/faulttest.sh
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
node tools/genmap.mjs
|
||||
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
tools/leaktest.sh
|
||||
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
tools/mutation.sh
|
||||
@@ -0,0 +1,9 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
mkdir -p run/temp client/dist
|
||||
sed "s/NGX_PORT/${PORT:-8080}/;s/NGX_BACKEND/${BACKEND_PORT:-9000}/" nginx/nginx.conf > run/nginx.conf
|
||||
nginx -p "$PWD/" -c run/nginx.conf -e run/error.log
|
||||
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
NOSERVE=1 tools/withserver.sh node tools/restart.mjs
|
||||
@@ -0,0 +1,9 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
nimble build -d:release -y
|
||||
mkdir -p run
|
||||
./server
|
||||
@@ -0,0 +1,7 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
tools/withserver.sh node tools/smoke.mjs
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
set -e
|
||||
|
||||
if [ -z "$__DEVBOX_SKIP_INIT_HOOK_ce5e2edaef5c70bf214c5c2dd76d3628faaabaa3231c31e9aa5ad25e9380a5a4" ]; then
|
||||
. "/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/gen/scripts/.hooks.sh"
|
||||
fi
|
||||
|
||||
node tools/genmap.mjs
|
||||
nimble test
|
||||
devbox run smoke
|
||||
devbox run leaktest
|
||||
devbox run faulttest
|
||||
devbox run restart
|
||||
DUR=15 devbox run concurrency
|
||||
@@ -0,0 +1,11 @@
|
||||
let
|
||||
pkgs = import
|
||||
(fetchTarball {
|
||||
url = "https://github.com/nixos/nixpkgs/archive/b9c00c1d41ccd6385da243415299b39aa73357be.tar.gz";
|
||||
})
|
||||
{ };
|
||||
in
|
||||
with pkgs;
|
||||
mkShell {
|
||||
packages = [];
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
# ARCHIVE SNAPSHOT — prototype-server-vision (artifacts only)
|
||||
|
||||
Stale working directory of the throwaway *server-authoritative vision prototype*: the question was
|
||||
whether the server alone decides what each player sees (tokens, fog, map tiles) so a modified client
|
||||
learns nothing hidden. Stack per its devbox flake and build output: Nim + mummy (WS/HTTP), SQLite,
|
||||
nginx (`X-Accel-Redirect` tiles), Vite + TS + Pixi v8 client.
|
||||
|
||||
It contained **no source when it was archived** (`src/`, `tools/`, `tests/*.nim`, `nginx/`,
|
||||
`devbox.json`, the client `src/` are gone). That source tree already lives in the repo at
|
||||
[`docs/archive/prototypes/server-vision/`](../../docs/archive/prototypes/server-vision/) with its
|
||||
README, NOTES/HANDOFF and committed result logs; this snapshot is only the leftover build output,
|
||||
generated devbox scripts and one run result.
|
||||
|
||||
## What is here
|
||||
|
||||
| Path | What |
|
||||
|---|---|
|
||||
| `client/dist/` | built Pixi client bundle (`index.html` + `assets/`), the only surviving client code. |
|
||||
| `.devbox/gen/` | devbox-generated files from the missing `devbox.json`: `flake/flake.nix` (nim 2.2.12, nimble, nginx, nodejs, sqlite, gettext, gawk), `flake.lock`, `shell.nix`, `scripts/*.sh` — one wrapper per devbox command (`gen`, `client`, `clienttest`, `server`, `nginx`, `smoke`, `leaktest`, `faulttest`, `restart`, `concurrency`, `mutation`, `bench`, `test`). The wrappers document the command set and reference the missing `nginx/nginx.conf` and `tools/*`; they carry absolute paths to the original directory and are not runnable here. |
|
||||
| `run/nginx.conf` | the nginx config actually used for a live run (port 8088, backend 9000, `/ws` upgrade, `internal` `/_tiles/` alias to `data/tiles/`). |
|
||||
| `run/conc.out` | output of one concurrency run: `concurrency: PASS` (10394 GM moves, 13846 acked intents, intent->ack avg 0.92 ms / p95 1.98 ms). |
|
||||
| `nimble.paths` | generated nimble search paths — names the dependency set (`webby`, `mummy`, `zippy`, `crunchy`, `nimsimd`, `db_connector`) that the missing `servervision.nimble` pulled. `nimble.paths` is gitignored repo-wide, so it is committed here with `git add -f`. |
|
||||
|
||||
## What was left out (still on the owner's disk, not committed)
|
||||
|
||||
| Path | Size | Why |
|
||||
|---|---|---|
|
||||
| `client/node_modules/`, `node_modules/` | ~137 MB | npm-installable |
|
||||
| `data/tiles/` (256 PNGs) | 1.1 MB | generated map tileset, regenerated by the archived `tools/genmap.mjs` |
|
||||
| `run/access.log`, `run/test/access.log` | 7.1 MB, 65 MB | logs over 1 MB |
|
||||
| `run/test/*` nimcache dirs (`nimcache`, `nimcache-clean`, `nimcachedleakfault`) | 23 MB | compiler output |
|
||||
| `run/state.db{,-wal,-shm}`, `run/test/state.db{,-wal,-shm}` | 8.7 MB | runtime SQLite state (excluded: `*.db`, contains live session rows and invite secrets) |
|
||||
| `server`, `run/test/server`, `run/test/server-clean`, `run/bench`, `run/leakcheck`, `run/test/leakcheck`, `tests/tgeometry` | 3.0 MB | ELF build products |
|
||||
| `run/leak-transcript.jsonl`, `run/test/leak-transcript.jsonl` | 1.3 MB each | transcripts over 1 MB; committed equivalents are in `docs/archive/prototypes/server-vision/results/` |
|
||||
| `run/test/server.log`, `run/{error,server,server2}.log`, `nginx.out`, `invites.txt` | < 1 MB | runtime noise; `invites.txt` holds throwaway join tokens (localhost URLs) and is not committed |
|
||||
| `.devbox/nimble/`, `nix/`, `virtenv/`, `.nix-print-dev-env-cache`, `state.json` | 3.1 MB | devbox/nix runtime state |
|
||||
| `run/temp/` | empty nginx temp dirs | — |
|
||||
|
||||
Do not build or revive this tree; the maintained server is `/server`.
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{S as n,a as u,G as o,b as f}from"./CanvasPool-BzI4Xw-3.js";const s=class i extends n{constructor(e){e={...i.defaultOptions,...e},super(e),this.enabled=!0,this._state=u.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,t,a,r){e.applyFilter(this,t,a,r)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:a,...r}=e;let l,d;return t&&(l=o.from(t)),a&&(d=f.from(a)),new i({gpuProgram:l,glProgram:d,...r})}};s.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let b=s;export{b as F};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,195 @@
|
||||
import{w as _,d as g,e as y,f as p,h as U,u as h}from"./CanvasPool-BzI4Xw-3.js";import{S as d,u as I}from"./BatchableSprite-CzCuzdKh.js";const x={name:"local-uniform-bit",vertex:{header:`
|
||||
|
||||
struct LocalUniforms {
|
||||
uTransformMatrix:mat3x3<f32>,
|
||||
uColor:vec4<f32>,
|
||||
uRound:f32,
|
||||
}
|
||||
|
||||
@group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
||||
`,main:`
|
||||
vColor *= localUniforms.uColor;
|
||||
modelMatrix *= localUniforms.uTransformMatrix;
|
||||
`,end:`
|
||||
if(localUniforms.uRound == 1)
|
||||
{
|
||||
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
||||
}
|
||||
`}},E={...x,vertex:{...x.vertex,header:x.vertex.header.replace("group(1)","group(2)")}},C={name:"local-uniform-bit",vertex:{header:`
|
||||
|
||||
uniform mat3 uTransformMatrix;
|
||||
uniform vec4 uColor;
|
||||
uniform float uRound;
|
||||
`,main:`
|
||||
vColor *= uColor;
|
||||
modelMatrix = uTransformMatrix;
|
||||
`,end:`
|
||||
if(uRound == 1.)
|
||||
{
|
||||
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
||||
}
|
||||
`}},D={name:"texture-bit",vertex:{header:`
|
||||
|
||||
struct TextureUniforms {
|
||||
uTextureMatrix:mat3x3<f32>,
|
||||
}
|
||||
|
||||
@group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;
|
||||
`,main:`
|
||||
uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;
|
||||
`},fragment:{header:`
|
||||
@group(2) @binding(0) var uTexture: texture_2d<f32>;
|
||||
@group(2) @binding(1) var uSampler: sampler;
|
||||
|
||||
|
||||
`,main:`
|
||||
outColor = textureSample(uTexture, uSampler, vUV);
|
||||
`}},O={name:"texture-bit",vertex:{header:`
|
||||
uniform mat3 uTextureMatrix;
|
||||
`,main:`
|
||||
uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
|
||||
`},fragment:{header:`
|
||||
uniform sampler2D uTexture;
|
||||
|
||||
|
||||
`,main:`
|
||||
outColor = texture(uTexture, vUV);
|
||||
`}};function A(e,t){for(const a in e.attributes){const s=e.attributes[a],r=t[a];r?(s.format??(s.format=r.format),s.offset??(s.offset=r.offset),s.instance??(s.instance=r.instance)):s.format||_(`Attribute ${a} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}S(e)}function S(e){const{buffers:t,attributes:a}=e,s={},r={};for(const o in t){const f=t[o];s[f.uid]=0,r[f.uid]=0}for(const o in a){const f=a[o];s[f.buffer.uid]+=g(f.format).stride}for(const o in a){const f=a[o];f.stride??(f.stride=s[f.buffer.uid]),f.start??(f.start=r[f.buffer.uid]),r[f.buffer.uid]+=g(f.format).stride}}const m=[];m[d.NONE]=void 0;m[d.DISABLED]={stencilWriteMask:0,stencilReadMask:0};m[d.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};m[d.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};m[d.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};m[d.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}};class B{constructor(t){this._syncFunctionHash=Object.create(null),this._adaptor=t,this._systemCheck()}_systemCheck(){if(!I())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(t){const a=this.getUniformGroupData(t);t.buffer||(t.buffer=new y({data:new Float32Array(a.layout.size/4),usage:p.UNIFORM|p.COPY_DST}))}getUniformGroupData(t){return this._syncFunctionHash[t._signature]||this._initUniformGroup(t)}_initUniformGroup(t){const a=t._signature;let s=this._syncFunctionHash[a];if(!s){const r=Object.keys(t.uniformStructures).map(n=>t.uniformStructures[n]),o=this._adaptor.createUboElements(r),f=this._generateUboSync(o.uboElements);s=this._syncFunctionHash[a]={layout:o,syncFunction:f}}return this._syncFunctionHash[a]}_generateUboSync(t){return this._adaptor.generateUboSync(t)}syncUniformGroup(t,a,s){const r=this.getUniformGroupData(t);t.buffer||(t.buffer=new y({data:new Float32Array(r.layout.size/4),usage:p.UNIFORM|p.COPY_DST}));let o=null;return a||(a=t.buffer.data,o=t.buffer.dataInt32),s||(s=0),r.syncFunction(t.uniforms,a,o,s),!0}updateUniformGroup(t){if(t.isStatic&&!t._dirtyId)return!1;t._dirtyId=0;const a=this.syncUniformGroup(t);return t.buffer.update(),a}destroy(){this._syncFunctionHash=null}}const b=[{type:"mat3x3<f32>",test:e=>e.value.a!==void 0,ubo:`
|
||||
var matrix = uv[name].toArray(true);
|
||||
data[offset] = matrix[0];
|
||||
data[offset + 1] = matrix[1];
|
||||
data[offset + 2] = matrix[2];
|
||||
data[offset + 4] = matrix[3];
|
||||
data[offset + 5] = matrix[4];
|
||||
data[offset + 6] = matrix[5];
|
||||
data[offset + 8] = matrix[6];
|
||||
data[offset + 9] = matrix[7];
|
||||
data[offset + 10] = matrix[8];
|
||||
`,uniform:`
|
||||
gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
|
||||
`},{type:"vec4<f32>",test:e=>e.type==="vec4<f32>"&&e.size===1&&e.value.width!==void 0,ubo:`
|
||||
v = uv[name];
|
||||
data[offset] = v.x;
|
||||
data[offset + 1] = v.y;
|
||||
data[offset + 2] = v.width;
|
||||
data[offset + 3] = v.height;
|
||||
`,uniform:`
|
||||
cv = ud[name].value;
|
||||
v = uv[name];
|
||||
if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {
|
||||
cv[0] = v.x;
|
||||
cv[1] = v.y;
|
||||
cv[2] = v.width;
|
||||
cv[3] = v.height;
|
||||
gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);
|
||||
}
|
||||
`},{type:"vec2<f32>",test:e=>e.type==="vec2<f32>"&&e.size===1&&e.value.x!==void 0,ubo:`
|
||||
v = uv[name];
|
||||
data[offset] = v.x;
|
||||
data[offset + 1] = v.y;
|
||||
`,uniform:`
|
||||
cv = ud[name].value;
|
||||
v = uv[name];
|
||||
if (cv[0] !== v.x || cv[1] !== v.y) {
|
||||
cv[0] = v.x;
|
||||
cv[1] = v.y;
|
||||
gl.uniform2f(ud[name].location, v.x, v.y);
|
||||
}
|
||||
`},{type:"vec4<f32>",test:e=>e.type==="vec4<f32>"&&e.size===1&&e.value.red!==void 0,ubo:`
|
||||
v = uv[name];
|
||||
data[offset] = v.red;
|
||||
data[offset + 1] = v.green;
|
||||
data[offset + 2] = v.blue;
|
||||
data[offset + 3] = v.alpha;
|
||||
`,uniform:`
|
||||
cv = ud[name].value;
|
||||
v = uv[name];
|
||||
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {
|
||||
cv[0] = v.red;
|
||||
cv[1] = v.green;
|
||||
cv[2] = v.blue;
|
||||
cv[3] = v.alpha;
|
||||
gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);
|
||||
}
|
||||
`},{type:"vec3<f32>",test:e=>e.type==="vec3<f32>"&&e.size===1&&e.value.red!==void 0,ubo:`
|
||||
v = uv[name];
|
||||
data[offset] = v.red;
|
||||
data[offset + 1] = v.green;
|
||||
data[offset + 2] = v.blue;
|
||||
`,uniform:`
|
||||
cv = ud[name].value;
|
||||
v = uv[name];
|
||||
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {
|
||||
cv[0] = v.red;
|
||||
cv[1] = v.green;
|
||||
cv[2] = v.blue;
|
||||
gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
|
||||
}
|
||||
`}];function k(e,t,a){const s=[`
|
||||
var v = null;
|
||||
var v2 = null;
|
||||
var t = 0;
|
||||
var index = 0;
|
||||
var name = null;
|
||||
var arrayOffset = null;
|
||||
`];let r=0;for(let f=0;f<e.length;f++){const n=e[f],v=n.data.name;let u=!1,i=0;for(let c=0;c<b.length;c++)if(b[c].test(n.data)){i=n.offset/4,s.push(`name = "${v}";`,`offset += ${i-r};`,b[c].ubo),u=!0;break}if(!u)if(n.data.size>1)i=n.offset/4,s.push(a(n,i-r));else{const c=t[n.data.type];i=n.offset/4,s.push(`
|
||||
v = uv.${v};
|
||||
offset += ${i-r};
|
||||
${c};
|
||||
`)}r=i}const o=s.join(`
|
||||
`);return new Function("uv","data","dataInt32","offset",o)}function l(e,t){return`
|
||||
for (let i = 0; i < ${e*t}; i++) {
|
||||
data[offset + (((i / ${e})|0) * 4) + (i % ${e})] = v[i];
|
||||
}
|
||||
`}const M={f32:`
|
||||
data[offset] = v;`,i32:`
|
||||
dataInt32[offset] = v;`,u32:`
|
||||
dataInt32[offset] = v;`,"vec2<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];`,"vec3<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];
|
||||
data[offset + 2] = v[2];`,"vec4<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];
|
||||
data[offset + 2] = v[2];
|
||||
data[offset + 3] = v[3];`,"vec2<i32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];`,"vec3<i32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];
|
||||
dataInt32[offset + 2] = v[2];`,"vec4<i32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];
|
||||
dataInt32[offset + 2] = v[2];
|
||||
dataInt32[offset + 3] = v[3];`,"vec2<u32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];`,"vec3<u32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];
|
||||
dataInt32[offset + 2] = v[2];`,"vec4<u32>":`
|
||||
dataInt32[offset] = v[0];
|
||||
dataInt32[offset + 1] = v[1];
|
||||
dataInt32[offset + 2] = v[2];
|
||||
dataInt32[offset + 3] = v[3];`,"mat2x2<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];
|
||||
data[offset + 4] = v[2];
|
||||
data[offset + 5] = v[3];`,"mat3x3<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];
|
||||
data[offset + 2] = v[2];
|
||||
data[offset + 4] = v[3];
|
||||
data[offset + 5] = v[4];
|
||||
data[offset + 6] = v[5];
|
||||
data[offset + 8] = v[6];
|
||||
data[offset + 9] = v[7];
|
||||
data[offset + 10] = v[8];`,"mat4x4<f32>":`
|
||||
for (let i = 0; i < 16; i++) {
|
||||
data[offset + i] = v[i];
|
||||
}`,"mat3x2<f32>":l(3,2),"mat4x2<f32>":l(4,2),"mat2x3<f32>":l(2,3),"mat4x3<f32>":l(4,3),"mat2x4<f32>":l(2,4),"mat3x4<f32>":l(3,4)},w={...M,"mat2x2<f32>":`
|
||||
data[offset] = v[0];
|
||||
data[offset + 1] = v[1];
|
||||
data[offset + 2] = v[2];
|
||||
data[offset + 3] = v[3];
|
||||
`};class P extends U{constructor({buffer:t,offset:a,size:s}){super(),this.uid=h("buffer"),this._resourceType="bufferResource",this._resourceId=h("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=t,this.offset=a|0,this.size=s,this.buffer.on("change",this.onBufferChange,this)}get _gcLastUsed(){return this.buffer?._gcLastUsed??-1}set _gcLastUsed(t){this.buffer&&(this.buffer._gcLastUsed=t)}onBufferChange(){this._resourceId=h("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 L(e,t,a,s,r){if(e=Math.max(0,e),t=Math.min(t,a*s),e>=t)return 0;const o=Math.floor(e/a),f=e-o*a,n=Math.floor(t/a),v=t-n*a;if(o===n)return r[0].set(f,o,v-f,1),1;let u=0,i=o;return f>0&&(r[u++].set(f,o,a-f,1),i++),n>i&&r[u++].set(0,i,a,n-i),v>0&&r[u++].set(0,n,v,1),u}export{P as B,m as G,B as U,x as a,M as b,k as c,b as d,A as e,C as f,L as g,O as h,E as l,D as t,w as u};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{T as a,B as p}from"./CanvasPool-BzI4Xw-3.js";const d={};function G(r,o,u){let e=2166136261;for(let t=0;t<o;t++)e^=r[t].uid,e=Math.imul(e,16777619),e>>>=0;return d[e]||l(r,o,e,u)}function l(r,o,u,e){const t={};let c=0;for(let n=0;n<e;n++){const s=n<o?r[n]:a.EMPTY.source;t[c++]=s.source,t[c++]=s.style}const i=new p(t);return d[u]=i,i}export{G as g};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+13
@@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<script type="module" crossorigin src="./assets/index-MsgVpT4r.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="./assets/CanvasPool-BzI4Xw-3.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/canvasUtils-DTvh64tg.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/getPo2TextureFromSource-Bh1CeN-Z.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/BatchableSprite-CzCuzdKh.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/getTextureBatchBindGroup-Bb1xMdCC.js">
|
||||
<link rel="modulepreload" crossorigin href="./assets/Graphics-C3fe99qu.js">
|
||||
|
||||
<meta charset="utf-8"><title>servervision</title>
|
||||
<style>html,body{margin:0;height:100%;overflow:hidden;background:#000}
|
||||
#bar{position:fixed;top:0;left:0;right:0;padding:2px 8px;font:12px monospace;color:#0f0;background:#000a;z-index:1;pointer-events:none}</style>
|
||||
<div id="bar"></div>
|
||||
@@ -0,0 +1,8 @@
|
||||
--noNimblePath
|
||||
--path:"/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/nimble/pkgs2/db_connector-0.1.0-4f2e67d0e4b61af9ac5575509305660b473f01a4"
|
||||
--path:"/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/src"
|
||||
--path:"/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/nimble/pkgs2/crunchy-0.1.11-d34f03fc0f6876dbf53f99601096728ec31f47a3"
|
||||
--path:"/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/nimble/pkgs2/nimsimd-1.3.2-5202ce48d46eaf593da54e884774cdb2a884e717"
|
||||
--path:"/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/nimble/pkgs2/mummy-0.4.8-dc4a55ec49b272ddacc3a25b7987354f2deb9030"
|
||||
--path:"/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/nimble/pkgs2/webby-0.2.1-1d9978ac16fdb56fad2ee9eaa0fcbb7860229d39"
|
||||
--path:"/home/davide/Projects/GDR/FFF_vtt/prototype-server-vision/.devbox/nimble/pkgs2/zippy-0.10.20-fae5430d597432ea2916a6d45dee53542784d51e"
|
||||
@@ -0,0 +1,7 @@
|
||||
Info: Running script "concurrency" on /home/davide/Projects/GDR/FFF_vtt/prototype-server-vision
|
||||
gm: sent 10394 moves (169/s), acks 10394 (nack 21), recv 24270 msgs 2961 KiB, final gseq 13876, tokens in view 8
|
||||
A: sent 1723 moves (28/s), acks 1723 (nack 7), recv 6459 msgs 6381 KiB, final gseq 13868, tokens in view 1
|
||||
B: sent 1729 moves (28/s), acks 1729 (nack 0), recv 6171 msgs 5980 KiB, final gseq 13874, tokens in view 2
|
||||
latency intent->ack (sender): n=13846 avg=0.92ms p95=1.98ms worst=13.92ms
|
||||
latency intent->arrival at other clients: n=5329 avg=1.26ms p95=2.37ms worst=11.15ms
|
||||
concurrency: PASS
|
||||
@@ -0,0 +1,33 @@
|
||||
# run via `devbox run nginx`; prefix = project root, all temp/log paths in run/
|
||||
daemon off;
|
||||
pid run/nginx.pid;
|
||||
error_log run/error.log warn;
|
||||
events {}
|
||||
http {
|
||||
access_log run/access.log;
|
||||
client_body_temp_path run/temp/client_body;
|
||||
proxy_temp_path run/temp/proxy;
|
||||
fastcgi_temp_path run/temp/fastcgi;
|
||||
uwsgi_temp_path run/temp/uwsgi;
|
||||
scgi_temp_path run/temp/scgi;
|
||||
server_tokens off;
|
||||
include ../nginx/mime.types; # relative to the generated run/nginx.conf
|
||||
map $http_upgrade $conn_up { default upgrade; '' close; }
|
||||
server {
|
||||
listen 8088; # sed-substituted from $PORT (default 8080); 9000 from $BACKEND_PORT (default 9000)
|
||||
server_name localhost;
|
||||
root client/dist;
|
||||
index index.html;
|
||||
location /join/ { proxy_pass http://127.0.0.1:9000; }
|
||||
location /tiles/ { proxy_pass http://127.0.0.1:9000; }
|
||||
location /ws {
|
||||
proxy_pass http://127.0.0.1:9000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $conn_up;
|
||||
proxy_read_timeout 1h;
|
||||
}
|
||||
# only reachable via X-Accel-Redirect from Nim after its access check
|
||||
location /_tiles/ { internal; alias data/tiles/; add_header Cache-Control "private, no-cache"; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user