VrsSriVisualizeRenderTarget.ankiprog 721 B

12345678910111213141516171819202122232425
  1. // Copyright (C) 2009-2022, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma anki start vert
  6. #include <AnKi/Shaders/QuadVert.glsl>
  7. #pragma anki end
  8. #pragma anki start frag
  9. #include <AnKi/Shaders/Functions.glsl>
  10. layout(set = 0, binding = 0) uniform utexture2D u_inTex;
  11. layout(set = 0, binding = 1) uniform sampler u_nearestAnyClampSampler;
  12. layout(location = 0) in Vec2 in_uv;
  13. layout(location = 0) out Vec3 out_color;
  14. void main()
  15. {
  16. const U32 texel = textureLod(u_inTex, u_nearestAnyClampSampler, in_uv, 0.0).x;
  17. const UVec2 rate = decodeVrsRate(texel);
  18. out_color = visualizeVrsRate(rate);
  19. }
  20. #pragma anki end