Skip to content

Commit

Permalink
make paths relative
Browse files Browse the repository at this point in the history
Note: Still need to fix some generated svg paths I think
  • Loading branch information
greggman committed May 27, 2024
1 parent d2c6e87 commit e4e2249
Show file tree
Hide file tree
Showing 119 changed files with 142 additions and 141 deletions.
2 changes: 1 addition & 1 deletion test/tests/data-byte-diagram-tests.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it } from '../mocha-support.js';
import {
makeShaderDataDefinitions,
} from '/3rdparty/webgpu-utils-1.x.module.js';
} from '../../3rdparty/webgpu-utils-1.x.module.js';
import { assertEqual } from '../assert.js';
import {
createByteDiagramForType,
Expand Down
2 changes: 1 addition & 1 deletion webgpu/background.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div id="fail" style="display: none;"></div>
<script type="module">
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#wgpu-matrix
import {mat4} from '/3rdparty/wgpu-matrix.module.js';
import {mat4} from '../3rdparty/wgpu-matrix.module.js';
import data from './resources/models/raw/webgpu.raw.js';

async function main() {
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/ko/webgpu-textures.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ struct OurVertexShaderOutput {
저는 "muigui"라는, [dat.GUI](https://github.com/dataarts/dat.gui)와 유사한 API를 갖는 라이브러리를 사용합니다.
```js
import GUI from '/3rdparty/muigui-0.x.module.js';
import GUI from '../3rdparty/muigui-0.x.module.js';

...

Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/byte-diagram-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#webgpu-utils
import {
makeShaderDataDefinitions,
} from '/3rdparty/webgpu-utils-1.x.module.js';
} from '../../../3rdparty/webgpu-utils-1.x.module.js';
import {
createByteDiagramForType,
getCodeForUniform,
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/cube-normals.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
}
</script>
<script type="module">
import * as twgl from '/3rdparty/twgl-full.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';

const { v3, m4 } = twgl;

Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/data-byte-diagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
getSizeAndAlignmentOfUnsizedArrayElement,
makeBindGroupLayoutDescriptors,
makeStructuredView,
} from '/3rdparty/webgpu-utils-1.x.module.js';
} from '../../../3rdparty/webgpu-utils-1.x.module.js';
import typeInfo from './wgsl-data-types.js';
import {
createElem as el,
Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/resources/data-tables.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { makeTable } from '/webgpu/lessons/resources/elem.js';
import { zip } from '/webgpu/lessons/resources/utils.js';
import { makeTable } from './elem.js';
import { zip } from './utils.js';

document.querySelectorAll('[data-table]').forEach(elem => {
const data = JSON.parse(elem.dataset.table);
Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/resources/directional-lighting.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<canvas id="canvas"></canvas>
</body>
<script type="module">
import GUI from '/3rdparty/muigui-0.x.module.js';
import * as twgl from '/3rdparty/twgl-full.module.js';
import GUI from '../../../3rdparty/muigui-0.x.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';
import * as diagram from './diagram.js';
import { rgb, hsl } from './utils.js';

Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/dot-product.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
</body>
</html>
<script type="module">
import * as twgl from '/3rdparty/twgl-full.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';
const m4 = twgl.m4;
const v3 = twgl.v3;

Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/resources/environment-mapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
</body>
</html>
<script type="module">
import GUI from '/3rdparty/muigui-0.x.module.js';
import * as twgl from '/3rdparty/twgl-full.module.js';
import GUI from '../../../3rdparty/muigui-0.x.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';
import * as diagram from './diagram.js';
import { rgb, hsl } from './utils.js';
const { v3 } = twgl;
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/lesson.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '/webgpu/lessons/resources/data-tables.js';
import './data-tables.js';
// Licensed under a BSD license. See license.html for license
/* eslint-disable strict */
/* global settings, contributors, jQuery */
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/normals-scaled.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
</body>
</html>
<script type="module">
import * as twgl from '/3rdparty/twgl-full.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';
const m4 = twgl.m4;
const v3 = twgl.v3;

Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/normals.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
}
</script>
<script type="module">
import * as twgl from '/3rdparty/twgl-full.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';
const m4 = twgl.m4;
const v3 = twgl.v3;

Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/resources/point-lighting.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
</body>
</html>
<script type="module">
import GUI from '/3rdparty/muigui-0.x.module.js';
import * as twgl from '/3rdparty/twgl-full.module.js';
import GUI from '../../../3rdparty/muigui-0.x.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';
import * as diagram from './diagram.js';
import { hsl, rgb } from './utils.js';

Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/resources/power-graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
</body>
</html>
<script type="module">
import GUI from '/3rdparty/muigui-0.x.module.js';
import * as twgl from '/3rdparty/twgl-full.module.js';
import GUI from '../../../3rdparty/muigui-0.x.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';

function main() {
const ctx = document.querySelector('#canvas').getContext('2d');
Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/resources/specular-lighting.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
</body>
</html>
<script type="module">
import GUI from '/3rdparty/muigui-0.x.module.js';
import * as twgl from '/3rdparty/twgl-full.module.js';
import GUI from '../../../3rdparty/muigui-0.x.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';
import * as diagram from './diagram.js';
import { rgb, hsl } from './utils.js';

Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/resources/spot-lighting.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
</body>
</html>
<script type="module">
import GUI from '/3rdparty/muigui-0.x.module.js';
import * as twgl from '/3rdparty/twgl-full.module.js';
import GUI from '../../../3rdparty/muigui-0.x.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';
import * as diagram from './diagram.js';
import { rgb, hsl } from './utils.js';
const { v3 } = twgl;
Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/resources/surface-reflection.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
</body>
</html>
<script type="module">
import GUI from '/3rdparty/muigui-0.x.module.js';
import * as twgl from '/3rdparty/twgl-full.module.js';
import GUI from '../../../3rdparty/muigui-0.x.module.js';
import * as twgl from '../../../3rdparty/twgl-full.module.js';
import * as diagram from './diagram.js';
import { rgb, hsl } from './utils.js';

Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/wgsl-offset-computer.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ <h1>WGSL Offset Computer</h1>
import {
makeShaderDataDefinitions,
setIntrinsicsToView,
} from '/3rdparty/webgpu-utils-1.x.module.js';
} from '../../../3rdparty/webgpu-utils-1.x.module.js';
import {
createByteDiagramForType,
getCodeForUniform,
Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/webgpu-cameras.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
import {
createRequestAnimationFrameLoop,
} from './resources/good-raf.js';
import { SVG as svg } from '/3rdparty/svg.esm.js';
import * as twgl from '/3rdparty/twgl-full.module.js';
import { SVG as svg } from '../../3rdparty/svg.esm.js';
import * as twgl from '../../3rdparty/twgl-full.module.js';

const darkColors = {
lines: [1, 1, 1, 1],
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-compute-shaders-histogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
import {
createRequestAnimationFrameLoop,
} from './resources/good-raf.js';
import { SVG as svg } from '/3rdparty/svg.esm.js';
import { SVG as svg } from '../../3rdparty/svg.esm.js';
import {
createElem as el, select, makeTable,
} from './resources/elem.js';
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-environment-maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from './resources/elem.js';
import {
createTextureFromSources,
} from '/3rdparty/webgpu-utils.module.js';
} from '../../3rdparty/webgpu-utils.module.js';

import {mat4} from 'http://localhost:8080/3rdparty/wgpu-matrix.module.js';
import GUI from 'http://localhost:8080/3rdparty/muigui-0.x.module.js';
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-fundamentals.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
import {
createElem as el,
} from './resources/elem.js';
import { SVG as svg } from '/3rdparty/svg.esm.js';
import { SVG as svg } from '../../3rdparty/svg.esm.js';
import { clamp } from './resources/utils.js';

const darkColors = {
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-importing-textures.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
renderDiagrams
} from './resources/diagrams.js';
import { SVG as svg } from '/3rdparty/svg.esm.js';
import { SVG as svg } from '../../3rdparty/svg.esm.js';
import {
createElem as el,
} from './resources/elem.js';
Expand Down
3 changes: 2 additions & 1 deletion webgpu/lessons/webgpu-limits-and-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const kLimitInfo = makeObjectFromTable(
'maxTextureArrayLayers': [ , 256, ],

'maxBindGroups': [ , 4, ],
'maxBindGroupsPlusVertexBuffers': [ , 24, ],
'maxBindingsPerBindGroup': [ , 1000, ],
'maxDynamicUniformBuffersPerPipelineLayout': [ , 8, ],
'maxDynamicStorageBuffersPerPipelineLayout': [ , 4, ],
Expand Down Expand Up @@ -95,7 +96,7 @@ renderDiagrams({
limits(elem) {
const addRow = makeTable(elem, ['limit name', 'your device', 'min']);
for (const key of getObjLikeKeys(adapter.limits).sort(sortAlphabetically)) {
addRow([key, [adapter.limits[key] > kLimitInfo[key].default ? 'exceeds-limit' : '', withShortSize(adapter.limits[key])], withShortSize(kLimitInfo[key].default)]);
addRow([key, [adapter.limits[key] > kLimitInfo[key]?.default ? 'exceeds-limit' : '', withShortSize(adapter.limits[key])], withShortSize(kLimitInfo[key]?.default)]);
}
},

Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/webgpu-matrix-math.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
makeShaderDataDefinitions,
} from '/3rdparty/webgpu-utils-1.x.module.js';
} from '../../3rdparty/webgpu-utils-1.x.module.js';
import {
renderDiagrams
} from './resources/diagrams.js';
Expand All @@ -16,7 +16,7 @@ import {
import {
mat3,
vec2,
} from '/3rdparty/wgpu-matrix.module.js';
} from '../../3rdparty/wgpu-matrix.module.js';
import {
hsla,
} from './resources/utils.js';
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-memory-layout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
makeShaderDataDefinitions,
} from '/3rdparty/webgpu-utils-1.x.module.js';
} from '../../3rdparty/webgpu-utils-1.x.module.js';
import {
renderDiagrams
} from './resources/diagrams.js';
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-multisampling.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
import {
createElem as el,
} from './resources/elem.js';
import { SVG as svg } from '/3rdparty/svg.esm.js';
import { SVG as svg } from '../../3rdparty/svg.esm.js';
import { clamp } from './resources/utils.js';

const darkColors = {
Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/webgpu-orthographic-projection.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
import {
makeShaderDataDefinitions,
} from '/3rdparty/webgpu-utils-1.x.module.js';
} from '../../3rdparty/webgpu-utils-1.x.module.js';
import {
renderDiagrams
} from './resources/diagrams.js';
Expand All @@ -14,7 +14,7 @@ import {
import {
mat4,
vec3,
} from '/3rdparty/wgpu-matrix.module.js';
} from '../../3rdparty/wgpu-matrix.module.js';
import {
hsla,
} from './resources/utils.js';
Expand Down
6 changes: 3 additions & 3 deletions webgpu/lessons/webgpu-perspective-projection.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
} from './resources/elem.js';
import {
mat4,
} from '/3rdparty/wgpu-matrix.module.js';
import * as twgl from '/3rdparty/twgl-full.module.js';
import GUI from '/3rdparty/muigui-0.x.module.js';
} from '../../3rdparty/wgpu-matrix.module.js';
import * as twgl from '../../3rdparty/twgl-full.module.js';
import GUI from '../../3rdparty/muigui-0.x.module.js';

const darkColors = {
lines: [1, 1, 1, 1],
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-storage-buffers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
renderDiagrams
} from './resources/diagrams.js';
import { SVG as svg } from '/3rdparty/svg.esm.js';
import { SVG as svg } from '../../3rdparty/svg.esm.js';

function createCircleVertices({
radius = 1,
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-textures.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
import {
createRequestAnimationFrameLoop,
} from './resources/good-raf.js';
import { SVG as svg } from '/3rdparty/svg.esm.js';
import { SVG as svg } from '../../3rdparty/svg.esm.js';
import {
rgba8unormFromCSS,
hsl,
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-textures.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ and when the setting change we need to re-render. I'm using a library
called "muigui" which at the moment has an API similar to [dat.GUI](https://github.com/dataarts/dat.gui)
```js
import GUI from '/3rdparty/muigui-0.x.module.js';
import GUI from '../3rdparty/muigui-0.x.module.js';

...

Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ And then we need to set a translation at render time
Finally let's add a UI so we can adjust the translation
```js
+import GUI from '/3rdparty/muigui-0.x.module.js';
+import GUI from '../3rdparty/muigui-0.x.module.js';

...
const settings = {
Expand Down
4 changes: 2 additions & 2 deletions webgpu/lessons/webgpu-transparency.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
import {
createElem as el
} from './resources/elem.js';
import {mat4} from '/3rdparty/wgpu-matrix.module.js';
import {createTextureFromSource} from '/3rdparty/webgpu-utils-1.x.module.js';
import {mat4} from '../../3rdparty/wgpu-matrix.module.js';
import {createTextureFromSource} from '../../3rdparty/webgpu-utils-1.x.module.js';


const hsl = (h, s, l) => `hsl(${h * 360 | 0}, ${s * 100}%, ${l * 100 | 0}%)`;
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-transparency.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ To that let's add a UI so we can set the alpha and color of
the clear value as well as whether or not it's premultiplied
```js
+import GUI from '/3rdparty/muigui-0.x.module.js';
+import GUI from '../3rdparty/muigui-0.x.module.js';

...

Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/zh_cn/webgpu-textures.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ const settings = {
的 API
```js
import GUI from '/3rdparty/muigui-0.x.module.js';
import GUI from '../3rdparty/muigui-0.x.module.js';

...

Expand Down
2 changes: 1 addition & 1 deletion webgpu/resources/js/unit-circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import { SVG as svg } from '/3rdparty/svg.esm.js';
import { SVG as svg } from '../../3rdparty/svg.esm.js';


const setTranslation = (e, x, y) => e.attr({transform: `translate(${x}, ${y})`});
Expand Down
2 changes: 1 addition & 1 deletion webgpu/webgl-cube-multiple.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</body>
<script type="module">
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#wgpu-matrix
import {vec3, mat4} from '/3rdparty/wgpu-matrix.module.js';
import {vec3, mat4} from '../3rdparty/wgpu-matrix.module.js';

function main() {
const gl = document.querySelector('canvas').getContext('webgl');
Expand Down
Loading

0 comments on commit e4e2249

Please sign in to comment.