-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshader.comp
More file actions
30 lines (26 loc) · 761 Bytes
/
shader.comp
File metadata and controls
30 lines (26 loc) · 761 Bytes
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
#version 450
layout (local_size_x = 1000, local_size_y = 1, local_size_x = 1) in;
layout (set = 0, binding = 0, std430) buffer inputBuffer
{
uint valuesIn[];
};
layout (set = 0, binding = 1, std430) buffer outputBuffer
{
uint valuesOut[1000][1000];
};
void main()
{
//uint index = gl_LocalInvocationID.x + gl_WorkGroupID.x * 128;
//valuesOut[index] = valuesIn[index] * 1000.0;
float r = gl_WorkGroupID.x / 500.0 - 1.0;
float i = gl_LocalInvocationID.x / 500.0 - 1.0;
uint cnt = 0;
while ((r * r + i * i < 4.0) && (cnt < 63))
{
float temp = r*r - i * i + 0.17;
i = 2 * r * i + 0.57;
r = temp;
cnt++;
}
valuesOut[gl_WorkGroupID.x][gl_LocalInvocationID.x] = (cnt << 2) | 0xff000000;
}