Enable WEBGL_debug_renderer_info extension before initializing the render (#5959)

This commit is contained in:
Elena Torró
2025-02-26 11:32:27 +01:00
committed by GitHub
parent fefb946a25
commit e30834bb2d

View File

@@ -877,11 +877,13 @@
(let [gl (unchecked-get internal-module "GL")
flags (debug-flags)
context (.getContext ^js canvas "webgl2" canvas-options)
;; Register the context with emscripten
handle (.registerContext ^js gl context #js {"majorVersion" 2})]
(.makeContextCurrent ^js gl handle)
;; Force the WEBGL_debug_renderer_info extension as emscripten does not enable it
(.getExtension context "WEBGL_debug_renderer_info")
;; Initialize Wasm Render Engine
(h/call internal-module "_init" (/ (.-width ^js canvas) dpr) (/ (.-height ^js canvas) dpr))
(h/call internal-module "_set_render_options" flags dpr))