spv.paramMemory.frag 958 B

12345678910111213141516171819202122232425262728293031
  1. #version 310 es
  2. // readonly coherent uniform layout(set = 0, binding = 0) highp image2D image1;
  3. // readonly uniform layout(set = 0, binding = 2) highp image2D image2;
  4. writeonly coherent uniform layout(set = 0, binding = 1, rgba32f) highp image2D image3;
  5. writeonly uniform layout(set = 0, binding = 3, rgba16f) highp image2D image4;
  6. flat in layout(location = 0) highp ivec2 in_coords;
  7. out layout(location = 0) highp vec4 out_color;
  8. highp vec4 image_load(readonly coherent highp image2D image, highp ivec2 coords)
  9. {
  10. return imageLoad(image, in_coords);
  11. }
  12. void image_store(writeonly coherent highp image2D image, highp ivec2 coords, highp vec4 data)
  13. {
  14. imageStore(image, in_coords, data);
  15. }
  16. void main()
  17. {
  18. highp vec4 read1 = vec4(0.4); // = image_load(image1, in_coords);
  19. highp vec4 read2 = vec4(0.5); // = image_load(image2, in_coords);
  20. image_store(image3, in_coords, read1*0.5);
  21. image_store(image4, in_coords, read2*2.0);
  22. out_color = vec4(0.0);
  23. }