tests/manual/rhi/shared/texture_ms4.frag
raw| 1 | #version 440 |
| 2 | |
| 3 | layout(location = 0) in vec2 v_texcoord; |
| 4 | |
| 5 | layout(location = 0) out vec4 fragColor; |
| 6 | |
| 7 | layout(std140, binding = 0) uniform buf { |
| 8 | mat4 mvp; |
| 9 | int flip; |
| 10 | } ubuf; |
| 11 | |
| 12 | layout(binding = 1) uniform sampler2DMS tex; |
| 13 | |
| 14 | void main() |
| 15 | { |
| 16 | ivec2 tc = ivec2(floor(vec2(textureSize(tex)) * v_texcoord)); |
| 17 | vec4 c = texelFetch(tex, tc, 0) + texelFetch(tex, tc, 1) + texelFetch(tex, tc, 2) + texelFetch(tex, tc, 3); |
| 18 | c /= 4.0; |
| 19 | fragColor = vec4(c.rgb * c.a, c.a); |
| 20 | } |