tests/auto/qshaderbaker/data/texturesize.frag
raw| 1 | #version 440 |
| 2 | |
| 3 | layout(location = 0) in vec2 v_texcoord; |
| 4 | layout(location = 0) out vec4 fragColor; |
| 5 | layout(binding = 0) uniform sampler2D tex; |
| 6 | |
| 7 | void main() |
| 8 | { |
| 9 | vec2 size = vec2(textureSize(tex, 0)); |
| 10 | vec2 d = vec2(1.0 / size.x, 1.0 / size.y); |
| 11 | fragColor = texture(tex, v_texcoord + d); |
| 12 | } |