Latest chapter from vkguide but doesn't work yet.
This commit is contained in:
parent
40717cf8e4
commit
a5c13d8654
10 changed files with 321 additions and 7 deletions
28
gradient.comp
Normal file
28
gradient.comp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
//GLSL version to use
|
||||
#version 460
|
||||
|
||||
//size of a workgroup for compute
|
||||
layout (local_size_x = 16, local_size_y = 16) in;
|
||||
|
||||
//descriptor bindings for the pipeline
|
||||
layout(rgba16f,set = 0, binding = 0) uniform image2D image;
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
ivec2 texelCoord = ivec2(gl_GlobalInvocationID.xy);
|
||||
ivec2 size = imageSize(image);
|
||||
|
||||
if(texelCoord.x < size.x && texelCoord.y < size.y)
|
||||
{
|
||||
vec4 color = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
if(gl_LocalInvocationID.x != 0 && gl_LocalInvocationID.y != 0)
|
||||
{
|
||||
color.x = float(texelCoord.x)/(size.x);
|
||||
color.y = float(texelCoord.y)/(size.y);
|
||||
}
|
||||
|
||||
imageStore(image, texelCoord, color);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue