// Copyright 2021, Collabora Ltd. // Author: Jakob Bornecrantz // SPDX-License-Identifier: BSL-1.0 #version 460 layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in; layout(set = 0, binding = 2) uniform writeonly restrict image2D target; layout(set = 0, binding = 3) uniform restrict Config { ivec4 views[2]; vec4 pre_transform[2]; vec4 post_transform[2]; mat4 transform[2]; } data; void main() { uint ix = gl_GlobalInvocationID.x; uint iy = gl_GlobalInvocationID.y; uint iz = gl_GlobalInvocationID.z; ivec2 offset = ivec2(data.views[iz].xy); ivec2 extent = ivec2(data.views[iz].zw); if (ix >= extent.x || iy >= extent.y) { return; } vec4 colour = vec4(vec3(0.2), 1.0); imageStore(target, ivec2(offset.x + ix, offset.y + iy), colour); }