diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2020-12-28 19:32:29 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2020-12-28 19:32:29 +0100 |
| commit | ae5b71f64715468d62ed889788969697a24cd794 (patch) | |
| tree | 312887271d4726627775474ccf11afa0aec58973 /shaders | |
| parent | c892cc73f911aa4d634af0225b4b3c6a43ecb906 (diff) | |
Compute shader write to image
Diffstat (limited to 'shaders')
| -rw-r--r-- | shaders/compute.comp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/shaders/compute.comp b/shaders/compute.comp index b1f8fef..f0bb220 100644 --- a/shaders/compute.comp +++ b/shaders/compute.comp @@ -1,7 +1,15 @@ layout(set = 0, binding = 0) buffer Inputs { - vec3 [] positions; -} spheres_positions; + vec3 sky_color; + vec3 ground_color; + vec3 [1920 * 1080] image; +}; void main() { - spheres_positions.positions[0] = vec3(0.0); + uint x = gl_GlobalInvocationID.x; + uint y = gl_GlobalInvocationID.y; + uint width = gl_NumWorkGroups.x; + uint height = gl_NumWorkGroups.y; + + // image[y * width + x] = vec3(x / width, y / height, 0.0); + image[y * width + x] = vec3(255.0, 255.0, 0.0); } |
