Skip to content
Snippets Groups Projects
Commit ba8d6dc3 authored by Russell Parker's avatar Russell Parker
Browse files

Fix "empty textures" error on empty canvas

parent aa414485
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,10 @@ export class Passes { ...@@ -24,7 +24,10 @@ export class Passes {
updateSize() { updateSize() {
const { gl } = this.webgl; const { gl } = this.webgl;
this.draw.setSize(gl.drawingBufferWidth, gl.drawingBufferHeight); // Avoid setting dimensions to 0x0 because it causes "empty textures are not allowed" error.
const width = Math.max(gl.drawingBufferWidth, 2);
const height = Math.max(gl.drawingBufferHeight, 2);
this.draw.setSize(width, height);
this.pick.syncSize(); this.pick.syncSize();
this.multiSample.syncSize(); this.multiSample.syncSize();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment