Skip to content

Rive Runtime Produces GL_INVALID_ENUM Errors in WebGL Browser Console #139

@VirtualMaestro

Description

@VirtualMaestro

Environment

Unity Version: 6000.3.2f1
Rive Runtime Version: v0.4.1-canary.6
Operating System: Windows 10 x64
Build Target: WebGL Desktop
Browser: (specify: Chrome/Firefox/Safari and version)

Summary
When running a WebGL build with Rive animations, the browser console continuously outputs GL_INVALID_ENUM: enum argument out of range errors. The application appears to function normally despite these errors, but they flood the console and may indicate underlying rendering issues or potential performance problems.
Steps to Reproduce

Create a Unity 6000.3.2 project with Rive Runtime v0.4.1-canary.6 (or take already created minimal project https://github.com/VirtualMaestro/Minimal_Rive_WebGL_Issue_Reproduction_Project)
Add Rive assets to the project and display them in a scene
Run the build in a web browser
Open browser Developer Console (F12)
Observe continuous stream of OpenGL errors

Expected Behavior
No OpenGL errors should appear in the browser console during normal operation. The Rive rendering should use only WebGL-compatible OpenGL ES calls.
Actual Behavior
The browser console is flooded with the following error repeatedly:
OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM: enum argument out of range
at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[839]:0x723f1
at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[16188]:0x8feecc
[... long stack trace through Rive rendering code ... Full stacktrace at the end of the message]

Impact

Severity: Medium
Visual Impact: None observed (animations appear to work correctly)
Performance Impact: Unknown (error handling overhead)
Development Impact: High (console spam makes debugging other issues difficult)
User Experience: Potentially affects performance on low-end devices

Analysis
The error GL_INVALID_ENUM in WebGL context typically occurs when:

Native code attempts to use OpenGL enums/constants that don't exist in WebGL (OpenGL ES subset)
Invalid enum values are passed to WebGL functions
Desktop OpenGL features are being called that aren't available in WebGL

Likely causes:

Rive's native rendering code may be using desktop OpenGL calls instead of WebGL-compatible OpenGL ES calls
Incorrect texture formats, blend modes, or rendering state enums
Missing WebGL compatibility layer in Rive's native code

Potential Root Causes

Texture format incompatibility: Using GL_RGBA8 instead of GL_RGBA, or other desktop-only formats
Blend mode issues: Using advanced blend equations not supported in WebGL 1.0/2.0
Framebuffer formats: Requesting unsupported internal formats
Query objects: Using GL query extensions not available in WebGL
Debug markers: Calling glPushDebugGroup/glPopDebugGroup which don't exist in WebGL

Full stacktrace:

WebGL.framework.js.br:9
OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM: enum argument out of range at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[839]:0x723f1 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[16188]:0x8feecc at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[16187]:0x8feb61 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[93160]:0x30e2e6f at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[91652]:0x30345d0 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[16368]:0x93236d at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[7844]:0x3c0bd9 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[88440]:0x2f9820b at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[103720]:0x3502741 at invoke_vi (http://localhost:52860/Build/WebGL.framework.js.br:9:435572) at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[19100]:0xba6d81 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[103722]:0x3502755 at invoke_vii (http://localhost:52860/Build/WebGL.framework.js.br:9:434199) at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[19004]:0xb9458a at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[103722]:0x3502755 at invoke_vii (http://localhost:52860/Build/WebGL.framework.js.br:9:434199) at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[54936]:0x1d7f625 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[103716]:0x3502713 at invoke_viii (http://localhost:52860/Build/WebGL.framework.js.br:9:434502) at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[54949]:0x1d873e5 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[103712]:0x35026c9 at invoke_viiii (http://localhost:52860/Build/WebGL.framework.js.br:9:435135) at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[54961]:0x1d8b57a at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[103712]:0x35026c9 at invoke_viiii (http://localhost:52860/Build/WebGL.framework.js.br:9:435135) at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[101875]:0x3495fd3 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[103712]:0x35026c9 at invoke_viiii (http://localhost:52860/Build/WebGL.framework.js.br:9:435135) at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[101421]:0x347260e at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[5099]:0x26a9bf at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[6708]:0x34f98a at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[103724]:0x3502778 at invoke_iiii (http://localhost:52860/Build/WebGL.framework.js.br:9:434352) at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[1446]:0xa3bb2 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[13525]:0x73aa19 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[1163]:0x8c2a3 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[945]:0x7b139 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[7965]:0x3d5773 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[93651]:0x3152220 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[15481]:0x893789 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[15481]:0x8937f9 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[91350]:0x3022163 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[103721]:0x3502749 at http://localhost:52860/Build/WebGL.framework.js.br:9:31125 at _JS_CallAsLongAsNoExceptionsSeen (http://localhost:52860/Build/WebGL.framework.js.br:9:31139) at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[91348]:0x301d0d0 at http://localhost:52860/Build/WebGL.wasm.br:wasm-function[103721]:0x3502749

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions