Files
Nuake/Data/Shaders/Vulkan/background.comp
2025-01-31 18:04:43 -05:00

28 lines
791 B
Plaintext

// HLSL version for Shader Model 6.1
RWTexture2D<float4> image : register(u0);
// Define the size of a thread group
[numthreads(16, 16, 1)]
void main(
uint3 dispatchThreadID : SV_DispatchThreadID,
uint3 groupThreadID : SV_GroupThreadID,
uint3 groupID : SV_GroupID
) {
// Get the size of the image
uint2 size;
image.GetDimensions(size.x, size.y);
// Current texel coordinates
uint2 texelCoord = dispatchThreadID.xy;
if (texelCoord.x < size.x && texelCoord.y < size.y) {
float4 color = float4(0.0, 0.0, 0.0, 1.0);
if (groupThreadID.x != 0 && groupThreadID.y != 0) {
color.x = float(texelCoord.x) / float(size.x);
color.y = float(texelCoord.y) / float(size.y);
}
image[texelCoord] = color;
}
}