diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-11 17:17:13 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-11 17:17:51 +0200 |
commit | 4dac45c9ee59ff6586d90d423654da91523ab679 (patch) | |
tree | cd4a4adf2cbc9e77bf86d2d11e71ec66afdf3be4 /tests/manual/rhi/computeimage/image.comp | |
parent | 078cd61751aeaa310d35a3d596a21a36004a1a0f (diff) | |
parent | f44850b5c3464cdda0ee9b1ee858d95f3ffaa3e2 (diff) |
Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
Diffstat (limited to 'tests/manual/rhi/computeimage/image.comp')
-rw-r--r-- | tests/manual/rhi/computeimage/image.comp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/manual/rhi/computeimage/image.comp b/tests/manual/rhi/computeimage/image.comp new file mode 100644 index 0000000000..9826ed7c6c --- /dev/null +++ b/tests/manual/rhi/computeimage/image.comp @@ -0,0 +1,20 @@ +#version 440 + +layout (local_size_x = 16, local_size_y = 16) in; + +layout(std140, binding = 0) uniform UniformBuffer +{ + float factor; +} ubuf; + +layout (binding = 1, rgba8) uniform readonly image2D texIn; +layout (binding = 2, rgba8) uniform writeonly image2D texOut; + +void main() +{ + ivec2 pos = ivec2(gl_GlobalInvocationID.xy); + ivec2 d = ivec2(1, 1); + vec4 diff = imageLoad(texIn, pos + d) - imageLoad(texIn, pos - d); + float c = (diff.x + diff.y + diff.z) / ubuf.factor + 0.5f; + imageStore(texOut, pos, vec4(c, c, c, 1.0)); +} |