feat(webgl): Fix GL initialization and add GLSL ES shader conversion
Progress on WEBGL_GAL rendering: - Fix GLImmediateShim initialization by adding GL function dependencies (glBegin, glEnd, glVertex2f, etc.) to $GLImmediateShim__deps - Add COLOR4D(EDA_COLOR_T) constructor stub to wasm_stubs.cpp - Fix GAL context locking - add LockContext/UnlockContext calls - Add exception catching to build (-sNO_DISABLE_EXCEPTION_CATCHING) - Create GLSL ES 1.00 shader converter in generate_shaders.py: - Remove #version 120 directive (ES 1.00 default) - Add precision highp float/int qualifiers - Convert int * float to float literals (2 * x -> 2.0 * x) - Update build script to clean output files for linker flag changes - Add console capture to test spec for debugging Current status: - WASM builds and loads successfully - GLImmediateShim initializes correctly - WEBGL_GAL creates successfully - Shader compilation fails due to Emscripten LEGACY_GL_EMULATION prepending code that conflicts with custom shader precision Next: Investigate shader compilation with LEGACY_GL_EMULATION or consider alternative approaches for GL compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c23bc974be
commit
6c2cf85177
17 changed files with 182 additions and 24 deletions
|
|
@ -14,7 +14,7 @@ addToLibrary({
|
|||
// GLImmediateShim - State tracking and function wrapping
|
||||
// ==================================================================
|
||||
|
||||
$GLImmediateShim__deps: ['$GLImmediate'],
|
||||
$GLImmediateShim__deps: ['$GLImmediate', 'glBegin', 'glEnd', 'glVertex2f', 'glVertex3f', 'glColor3f', 'glColor4f'],
|
||||
$GLImmediateShim__postset: 'GLImmediateShim.init();',
|
||||
$GLImmediateShim: {
|
||||
// Current color state (persistent across vertices)
|
||||
|
|
|
|||
Loading…
Reference in a new issue