Skip to content

Commit 49d5284

Browse files
committed
fix(glsl): static arrays fix typo
1 parent 95ccc39 commit 49d5284

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/glsl/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ function handleAlloc(init, typeAnnotation, name) {
340340
const [first] = init.arguments;
341341
if (first.type === 'ArrayExpression') {
342342
const els = first.elements.map((n) => `${handleNode(n)}`).join(', ');
343-
allocation = ` = ${name}[${first.elements.length}](${els});`;
343+
allocation = ` = ${typeAnnotation}(${els});`;
344344
} else {
345345
allocation = ` = ${handleNode(init.arguments[0])}`;
346346
}

test/glsl/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ float bar = float(foo[x][1]);
212212
});
213213

214214
const expected = `
215-
float[2] foo = foo[2](1.0, 2.0);
215+
float[2] foo = float[2](1.0, 2.0);
216216
`;
217217

218218
assert.equal(glsl.trim(), expected.trim());
@@ -224,7 +224,7 @@ float[2] foo = foo[2](1.0, 2.0);
224224
});
225225

226226
const expected = `
227-
vec2[2] foo = foo[2](vec2(1.0, 2.0), vec(3.0, 4.0));
227+
vec2[2] foo = vec2[2](vec2(1.0, 2.0), vec(3.0, 4.0));
228228
`;
229229

230230
assert.equal(glsl.trim(), expected.trim());

0 commit comments

Comments
 (0)