engine
engine copied to clipboard
[Impeller] Use the ES profile for shaderc ingestion
This is a step towards being able to control floating point precision. The GLSL 4.6 spec ignores precision (and so does glslang in this mode). The compiler is still not emitting half precision on Metal, so something else probably needs to be adjusted (perhaps the shaderc_env or spirv_target) since it appears to have support for doing so internally.
All of the shaders needed to be modified because explicitly specifying precision (and explicitly specifying conversions between different precisions) is mandatory for GLSL ES 3.2. If we end up needing to reverse this change for some reason, none of the shaders will need to be changed to do so, as all of the changes are also compatible with GLSL 4.6
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).
If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?
Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.
Might be worth experimenting with this a bit more before landing -- we may or may not end up needing it.
@bdero Do you still intend on landing this. If not, let's move this to the icebox?
@chinmaygarde I don't think we should land this right now -- moved to ice box. I didn't find a way to tease the compiler into emitting precision info and this needs a deeper look at shaderc internals.