// SPDX-License-Identifier: BSD-3-Clause // vk_plasma.comp - compute-shader frame painter for the Vulkan guest test. #version 450 layout(local_size_x = 16, local_size_y = 16) in; layout(set = 0, binding = 0, rgba8) uniform writeonly image2D fb; layout(push_constant) uniform PC { float t; float w; float h; float pad; } pc; void main() { ivec2 p = ivec2(gl_GlobalInvocationID.xy); if (p.x >= int(pc.w) || p.y >= int(pc.h)) return; vec2 uv = vec2(p) / vec2(pc.w, pc.h); float v = sin(uv.x * 12.0 + pc.t * 2.0) * cos(uv.y * 9.0 - pc.t * 1.7); float r = 0.5 + 0.5 * sin(pc.t + uv.x * 6.2831); float g = 0.5 + 0.5 * sin(pc.t * 1.3 + uv.y * 6.2831); float b = 0.5 + 0.5 * v; imageStore(fb, p, vec4(r, g, b, 1.0)); }