Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing e with (<must be false> ? ... : e) changes image dramatically #22

Closed
afd opened this issue Nov 28, 2016 · 2 comments
Closed

Comments

@afd
Copy link
Member

afd commented Nov 28, 2016

[Shaders, screenshots, error log, reproduction steps, etc.] [ZIP]

This fragment shader:

https://github.com/mc-imperial/shader-compiler-bugs/blob/master/ARM-Mali-T628-Chromebook-WebGL/wrong_images/small-v100-webgl-804943b2b630b741_inv_variant_4/original.frag

leads to this image being rendered on one of our Intel GPUs, and a visually identical image being rendered on other GPUs we have tested:

expected image

On the Chromebook, using WebGL, the following image is rendered instead:

actual image

This fragment shader:

https://github.com/mc-imperial/shader-compiler-bugs/blob/master/ARM-Mali-T628-Chromebook-WebGL/wrong_images/small-v100-webgl-804943b2b630b741_inv_variant_4/variant.frag

is identical to the original fragment shader, except that a reference to variable k has been changed to (injectionSwitch.x > injectionSwitch.y ? 1.0 : k). This should have no effect on rendering if we set injectionSwitch to the vector (0.0, 1.0), because the condition in the ternary will evaluate to false.

When we set injectionSwitch to this value and render on Mali using the modified shader, we get this image:

variant image

which is visually identical to the image that we see rendered on other GPUs we tried.

We speculate that a compiler bug is being triggered when the original shader is used for rendering, and that our modification somehow masks the compiler bug.

@afd
Copy link
Member Author

afd commented Nov 28, 2016

Reported to ARM here:

https://community.arm.com/message/39845

@afd
Copy link
Member Author

afd commented Jul 18, 2017

Closing this issue as, like #26, ARM reported it to be independently fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants