Skip to content

Commit

Permalink
Add undefined parameter.value warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sockmaster27 committed Oct 15, 2024
1 parent c0e2ef4 commit d775bfc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/WebGlShader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,11 @@
const { gl, shaderProgram } = await configPromise;
for (const parameter of parameters) {
if (parameter.value === undefined)
throw new Error(
"One or more parameters had an undefined value field.",
);
if (!isBuiltinParameter(parameter)) {
const uniformPosition = gl.getUniformLocation(
shaderProgram,
Expand Down
5 changes: 5 additions & 0 deletions src/lib/WebGpuShader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@
/** @type {GPUBuffer[]} */
const parameterBuffers = parameters.map(parameter => {
if (parameter.value === undefined)
throw new Error(
"One or more parameters had an undefined value field.",
);
/** @type {number} */
let byteLength;
if (isBuiltinParameter(parameter))
Expand Down

0 comments on commit d775bfc

Please sign in to comment.