Open wolfspider opened 18 hours ago
Thanks for the research! I was able to run aether.glsl
with this diff but never hit the charCodeAt
error 🤔
diff --git a/shaderplay.ts b/shaderplay.ts
index 92b79db..38d4a71 100644
--- a/shaderplay.ts
+++ b/shaderplay.ts
@@ -1,5 +1,5 @@
import { EventType, WindowBuilder } from "jsr:@divy/sdl2@0.13.0";
-import loadGlslang from "npm:@webgpu/glslang@0.0.15";
+import loadGlslang from "npm:@webgpu/glslang@0.0.15/dist/web-devel/glslang.js";
import "./vendor/cdn.babylonjs.com/twgsl/twgsl.js";
const twgsl = await (globalThis as any).twgsl(
$ deno --version
deno 2.0.0-rc.7+183130f (canary, release, aarch64-apple-darwin)
For some reason GLSL translation was not working and had a closer look at it to find that whatever was in node-devel did not work on my system. I'm running Linux Ubuntu 22 on Vulkan and Wayland is the WM. It would either not run at all and when I tried to force the module to load outside of an async function it would peg the CPU. The first thing I did was switch it over to web-devel:
Afterwards I got an error about charCodeAt() and went ahead and patched it:
Since this package has not been updated for a while I figured I would share this if it helps anyone else.
On line 17 of gslang.js
var f=a.charCodeAt(g);
just needs to be changed tovar f=a.toString().charCodeAt(g);
.These files are located in the cache folder so on my system they are at:
~/.cache/deno/npm/registry.npmjs.org/@webgpu/glslang/0.0.15
I am not sure what the good solution would be in this case since it is happening outside of ShaderPlay.
I've been really enjoying ShaderPlay and all the other additions to Deno as well, thank you!
I'm also including the shader which I have been using to test this with: