Skip to content

A bug of glShaderSource in libwebgl.js? #25828

@SetoKaiba

Description

@SetoKaiba

Version of emscripten/emsdk:
The latest main branch

https://github.com/emscripten-core/emscripten/blob/main/src/lib/libwebgl.js#L3273-L3278
Check the code here.
According the comment, the 1st replacement should not overrides the 2nd & the 3rd replacement.
The layout rules should be kept.

Actually, the 1st replacement make the 2nd & the 3rd replacement useless.
This makes some custom development WebGL2 implementation render incorrectly on some devices.
For example, the Kwai Minigame renders incorrectly on Vivo S18.

source = "layout(binding = 1, std140)";
Actual Result: source = ""
Expected Result: source = "layout(std140)"

source = "layout(std140, binding = 1)" ;
Actual Result: source = ""
Expected Result: source = "layout(std140)"

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