spv.aggOps.frag 836 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #version 450
  2. uniform sampler2D samp2D;
  3. in mediump vec2 coord;
  4. in vec4 u, w;
  5. out vec4 color;
  6. struct s1 {
  7. int i;
  8. float f;
  9. };
  10. struct s2 {
  11. int i;
  12. float f;
  13. s1 s1_1;
  14. };
  15. layout(std140) uniform ub1 { s2 foo2a; } uName1;
  16. layout(std430) buffer ub2 { s2 foo2b; } uName2;
  17. void main()
  18. {
  19. vec4 v;
  20. s1 a[3], b[3];
  21. a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0));
  22. b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w));
  23. if (uName1.foo2a == uName2.foo2b)
  24. v = texture(samp2D, coord);
  25. else
  26. v = texture(samp2D, 2.0*coord);
  27. if (u == v)
  28. v *= 3.0;
  29. if (u != v)
  30. v *= 4.0;
  31. if (coord == v.yw)
  32. v *= 5.0;
  33. if (a == b)
  34. v *= 6.0;
  35. if (a != b)
  36. v *= 7.0;
  37. color = v;
  38. }