diff options
Diffstat (limited to 'spa/plugins/vulkan/shaders/main.comp')
-rw-r--r-- | spa/plugins/vulkan/shaders/main.comp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/spa/plugins/vulkan/shaders/main.comp b/spa/plugins/vulkan/shaders/main.comp new file mode 100644 index 0000000..368b7cf --- /dev/null +++ b/spa/plugins/vulkan/shaders/main.comp @@ -0,0 +1,50 @@ +#version 450 +#extension GL_ARB_separate_shader_objects : enable + +#define WORKGROUP_SIZE 32 +layout (local_size_x = WORKGROUP_SIZE, local_size_y = WORKGROUP_SIZE, local_size_z = 1 ) in; + +layout(rgba32f, binding = 0) uniform image2D resultImage; + +layout( push_constant ) uniform Constants { + float time; + int frame; + int width; + int height; +} PushConstant; + +float iTime; +int iFrame; +vec3 iResolution; +vec4 iMouse; + +void mainImage( out vec4 fragColor, in vec2 fragCoord ); + +void main() +{ + iTime = PushConstant.time; + iFrame = PushConstant.frame; + iResolution = vec3(float(PushConstant.width), float(PushConstant.height), 0.0); + iMouse = vec4(0.0, 0.0, 0.0, 0.0); + vec2 coord = vec2(float(gl_GlobalInvocationID.x), + iResolution.y - float(gl_GlobalInvocationID.y)); + vec4 outColor; + + if(coord.x >= iResolution.x || coord.y >= iResolution.y) + return; + + mainImage(outColor, coord); + + imageStore(resultImage, ivec2(gl_GlobalInvocationID.xy), outColor); +} + +//#include "plasma-globe.comp" +//#include "mandelbrot-distance.comp" +#include "disk-intersection.comp" +//#include "ring-twister.comp" +//#include "gears.comp" +//#include "protean-clouds.comp" +//#include "flame.comp" +//#include "shader.comp" +//#include "raymarching-primitives.comp" +//#include "3d-primitives.comp" |