summaryrefslogtreecommitdiffstats
path: root/spa/plugins/vulkan/shaders/main.comp
blob: 368b7cf41abe98d007bbfc3c5d481529d02a1f0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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"