Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. This is a custom shader we are using right now to render flat shaded geometry into a deferred render buffer. Please ignore the custom made stuff (#pragma), it shouldn't be of relevance in this case.
  2.  
  3. Now, this shader works. Most of the time.
  4.  
  5. On **some particular systems**, namely a Surface Pro 4 and a Surface Pro 3 with Intel Iris 540 / HD 5000 GPUs, both running Windows 10, the following **"optimization"** breaks rendering.
  6.  
  7. - vertex shader:
  8. - line 13: remove unused *out* attribute, `out vec3 v_position;`
  9. - line 20: change into local var, `vec3 _position = a_position;`
  10. - line 23: change to use local var, `vec4 position = vec4(_position, 1.0);`
  11. - fragment shader:
  12. - line 34: remove unused *in* attribute, `in vec3 v_position;`
  13.  
  14. Result is, that on this GPU, it now renders all black. Actually, judging by the output I see it looks like the alpha test fails all the time, discarding all fragments.
  15.  
  16. On other GPUs (NVidia on Win10/OS X, Intel on OS X) it works as intended.
  17.  
  18. It's been a horrible exercise to track the problem down this one *innocently looking* change. Would be nice to get an idea what's wrong about it...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement