spv.debugInfo.frag 721 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #version 450
  2. struct S {
  3. int a;
  4. };
  5. uniform ubuf {
  6. S s;
  7. };
  8. uniform sampler2D s2d;
  9. layout(location = 0) in vec4 inv;
  10. layout(location = 0) out vec4 outv;
  11. vec4 foo(S s)
  12. {
  13. vec4 r = s.a * inv;
  14. ++r;
  15. if (r.x > 3.0)
  16. --r;
  17. else
  18. r *= 2;
  19. return r;
  20. }
  21. void main()
  22. {
  23. outv = foo(s);
  24. outv += texture(s2d, vec2(0.5));
  25. switch (s.a) {
  26. case 10:
  27. ++outv;
  28. break;
  29. case 20:
  30. outv = 2 * outv;
  31. ++outv;
  32. break;
  33. default:
  34. --outv;
  35. break;
  36. }
  37. for (int i = 0; i < 10; ++i)
  38. outv *= 3.0;
  39. outv.x < 10.0 ?
  40. outv = sin(outv) :
  41. outv = cos(outv);
  42. }