3D engine that AI agents drive
Finish a linking post program before deleting it on dispose (part of #74)
Nguyen Xuan Ane6fbfe6b2d77
diff --git a/src/renderer.js b/src/renderer.jsindex 213b976e..e9e9cf0b 100644--- a/src/renderer.js+++ b/src/renderer.js@@ -2045,7 +2045,8 @@ export class Renderer67 {this.context.deleteProgram(this.program);this.context.deleteProgram(this.depthProgram);if (this.postProgram) this.context.deleteProgram(this.postProgram);- for (const variant of this.postVariants?.values() ?? []) this.context.deleteProgram(variant.program ?? variant.pending.program);+ // A program still linking must finish first: deleting it mid-link leaves a GL error that the next renderer on this context sees.+ for (const variant of this.postVariants?.values() ?? []) this.context.deleteProgram(variant.pending ? finishProgram(this.context, variant.pending) : variant.program);if (this.skyProgram) this.context.deleteProgram(this.skyProgram);if (this.bloomProgram) this.context.deleteProgram(this.bloomProgram);if (this.occlusionProgram) this.context.deleteProgram(this.occlusionProgram);