Skip to content

Conversation

@greggman
Copy link
Contributor

vertex shaders in webgl default to highp

#8627

vertex shaders in webgl default to highp
@kripken
Copy link
Member

kripken commented May 17, 2019

cc @kenrussell @kainino0x @juj

Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct to me, but I also don't know why this code was written in the first place.

Can you remove ensurePrecision as well? It seems unused.

@greggman
Copy link
Contributor Author

ensurePrecision was used for both vertex and fragment shaders. This PR removes its usage for vertex shaders where it's not needed.

@kainino0x
Copy link
Collaborator

Ah, sorry, I tried to search for other usages and I failed. LGTM

@juj
Copy link
Collaborator

juj commented May 18, 2019

This looks correct to me, but I also don't know why this code was written in the first place.

This change relates to legacy GL emulation, where source fragment shaders may come in without a precision qualifier, but in WebGL fragment shaders, precision qualifiers are mandatory. So to emulate, one is added automatically.

LGTM to remove the precision qualifier from WebGL vertex shaders, that is not required (unlike WebGL fragment shaders do)

@kripken kripken merged commit 3b624cf into emscripten-core:incoming May 21, 2019
@greggman greggman deleted the glsles-not-vertex-shader-mediump branch May 24, 2019 03:46
belraquib pushed a commit to belraquib/emscripten that referenced this pull request Dec 23, 2020
…ipten-core#8628)

Vertex shaders in webgl default to highp. And vertex shaders (unlike fragment shaders) do not need a precision, so we don't need to add one there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants