From 2fd2d671eb301f42f22267832fbb8655c4bec004 Mon Sep 17 00:00:00 2001 From: Stefnotch Date: Sat, 25 Oct 2025 19:44:20 +0200 Subject: [PATCH 01/10] Add shader debug labels --- README.md | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1197569..a32de04 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,8 @@ async initializePipelines() { layout: "auto", compute: { module: this.device.createShaderModule({ - code: SHADERS.add + code: SHADERS.add, + label: "add" }), } }); @@ -361,7 +362,10 @@ async initializePipelines() { this.aggregatePipeline = this.device.createComputePipeline({ layout: "auto", compute: { - module: this.device.createShaderModule({ code: SHADERS.aggregate }), + module: this.device.createShaderModule({ + code: SHADERS.aggregate, + label: "aggregrate" + }), } }); } @@ -533,7 +537,10 @@ First, for the pipeline: ```javascript async initializePipelines() { - const imageShaderModule = this.device.createShaderModule({ code: SHADERS.image }); + const imageShaderModule = this.device.createShaderModule({ + code: SHADERS.image, + label: "image" + }); this.imageRenderPipeline = this.device.createRenderPipeline({ layout: "auto", vertex: { @@ -803,7 +810,10 @@ Now that we have all the buffers set up, we can proceed to creating our **pipeli ```javascript async initializePipelines() { ... - const markersShaderModule = this.device.createShaderModule({ code: SHADERS.markers }); + const markersShaderModule = this.device.createShaderModule({ + code: SHADERS.markers, + label: "markers" + }); this.markersRenderPipeline = this.device.createRenderPipeline({ layout: "auto", vertex: { @@ -1140,7 +1150,10 @@ async initializePipelines() { const pipelineDescriptor = { layout: this.heatmapComputePipelineLayout, compute: { - module: this.device.createShaderModule({ code: SHADERS.heatmapCompute }), + module: this.device.createShaderModule({ + code: SHADERS.heatmapCompute, + label: "heatmapCompute" + }), entryPoint: "" // Set below for each pipeline } }; @@ -1312,7 +1325,10 @@ With the shader created, we go back to Javascript and introduce our new **pipeli ```javascript async initializePipelines() { ... - const heatmapRenderShaderModule = this.device.createShaderModule({ code: SHADERS.heatmapRender }); + const heatmapRenderShaderModule = this.device.createShaderModule({ + code: SHADERS.heatmapRender, + label: "heatmapRender" + }); this.heatmapRenderPipeline = this.device.createRenderPipeline({ layout: "auto", vertex: { From 447fc872cd6d400284e7ab1118e7169a8522b9b7 Mon Sep 17 00:00:00 2001 From: Stefnotch Date: Sat, 25 Oct 2025 20:10:34 +0200 Subject: [PATCH 02/10] Move files to standard structure --- .gitignore | 24 ++++++ index.html | 6 +- jsconfig.json | 10 --- loader.js => src/loader.js | 0 tree.js => src/tree.js | 0 tutorial.js => src/tutorial.js | 144 ++++++++++++++++----------------- types.js => src/types.js | 0 tsconfig.json | 28 +++++++ 8 files changed, 127 insertions(+), 85 deletions(-) create mode 100644 .gitignore delete mode 100644 jsconfig.json rename loader.js => src/loader.js (100%) rename tree.js => src/tree.js (100%) rename tutorial.js => src/tutorial.js (94%) rename types.js => src/types.js (100%) create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/index.html b/index.html index 3fd12c3..92308e1 100644 --- a/index.html +++ b/index.html @@ -19,8 +19,8 @@ - - + + @@ -31,7 +31,7 @@ - + - - @@ -30,10 +28,9 @@ - - + - - - - - - - - - - - -