vulkan: use images

The filter can now run shadertoy filters.
This commit is contained in:
Wim Taymans 2022-05-31 18:00:24 +02:00
parent 24fc972164
commit b02ebec954
5 changed files with 102 additions and 63 deletions

View file

@ -4,14 +4,7 @@
#define WORKGROUP_SIZE 32
layout (local_size_x = WORKGROUP_SIZE, local_size_y = WORKGROUP_SIZE, local_size_z = 1 ) in;
struct Pixel{
vec4 value;
};
layout(std140, binding = 0) buffer buf
{
Pixel imageData[];
};
layout(rgba32f, binding = 0) uniform image2D resultImage;
layout( push_constant ) uniform Constants {
float time;
@ -42,8 +35,7 @@ void main()
mainImage(outColor, coord);
imageData[PushConstant.width * gl_GlobalInvocationID.y +
gl_GlobalInvocationID.x].value = outColor;
imageStore(resultImage, ivec2(gl_GlobalInvocationID.xy), outColor);
}
//#include "plasma-globe.comp"