Add fb invalidation

This commit is contained in:
schmelczerandras 2020-10-31 16:02:55 +01:00
parent 9d22805fb0
commit 45b1948f7c
2 changed files with 11 additions and 0 deletions

View file

@ -39,6 +39,15 @@ export class IntermediateFrameBuffer extends FrameBuffer {
: [this.colorTexture];
}
public invalidate() {
if (this.gl.isWebGL2) {
this.gl.invalidateFramebuffer(this.gl.FRAMEBUFFER, [
this.gl.COLOR_ATTACHMENT0,
this.gl.COLOR_ATTACHMENT1,
]);
}
}
public setSize(canvasSize: ReadonlyVec2): boolean {
const hasChanged = super.setSize(canvasSize);

View file

@ -258,6 +258,8 @@ export class RendererImplementation implements Renderer {
);
this.gl.disable(this.gl.BLEND);
this.distanceFieldFrameBuffer.invalidate();
if (this.stopwatch?.isRunning) {
this.stopwatch?.stop();
}