MoonWorksGraphicsTests/Common/Content/Shaders/Source/GradientTexture.comp

24 lines
538 B
Plaintext

#version 450
#define LOCAL_SIZE 8
layout (local_size_x = LOCAL_SIZE, local_size_y = LOCAL_SIZE, local_size_z = 1) in;
layout (set = 1, binding = 0, rgba8) uniform writeonly image2D outImage;
layout(set = 2, binding = 0) uniform UBO
{
uvec2 workgroupSize;
} ubo;
void main()
{
vec2 coord = gl_GlobalInvocationID.xy;
vec2 totalWorkgroupSize = vec2(ubo.workgroupSize) * vec2(LOCAL_SIZE);
vec4 col = vec4(
coord.x / totalWorkgroupSize.x,
coord.y / totalWorkgroupSize.y,
1.0,
1.0
);
imageStore(outImage, ivec2(coord), col);
}