Skip to content

Commit f7a931e

Browse files
fix: #472 cleanup, and turn off debug
1 parent 4d46279 commit f7a931e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/backend/headless-gl/kernel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ class HeadlessGLKernel extends WebGLKernel {
137137

138138
setOutput(output) {
139139
super.setOutput(output);
140-
if (this.graphical) {
140+
if (this.graphical && this.extensions.STACKGL_resize_drawingbuffer) {
141141
this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0], this.maxTexSize[1]);
142142
}
143143
}
144144
}
145145

146146
module.exports = {
147147
HeadlessGLKernel
148-
};
148+
};

src/backend/web-gl/function-node.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ class WebGLFunctionNode extends FunctionNode {
739739
});
740740
if (i === 0 || lastType === null) {
741741
declarationResult.push('float ');
742-
} else if (actualType !== lastType) {
742+
} else if (type !== lastType) {
743743
throw new Error('Unhandled declaration');
744744
} else {
745745
declarationResult.push(',');
@@ -757,7 +757,7 @@ class WebGLFunctionNode extends FunctionNode {
757757
});
758758
if (i === 0 || lastType === null) {
759759
declarationResult.push(`${markupType} `);
760-
} else if (actualType !== lastType) {
760+
} else if (type !== lastType) {
761761
result.push(';');
762762
declarationResult.push(`${markupType} `);
763763
} else {
@@ -1309,4 +1309,4 @@ const operatorMap = {
13091309

13101310
module.exports = {
13111311
WebGLFunctionNode
1312-
};
1312+
};

test/issues/472-compilation-issue.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ function testCompilationIssue(mode) {
1919
constants: { w: 4, h: 4 },
2020
output: [2, 2],
2121
graphical: true,
22-
debug: true,
2322
});
2423
render(new Uint8ClampedArray([
2524
230,233,240,255,
@@ -51,6 +50,6 @@ test('gpu', () => {
5150
testCompilationIssue('headlessgl');
5251
});
5352

54-
test('cpu', () => {
53+
(GPU.isCanvasSupported ? test : skip)('cpu', () => {
5554
testCompilationIssue('cpu');
5655
});

0 commit comments

Comments
 (0)