RayTracingDraw.azsl 900 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. ShaderResourceGroupSemantic SRG_Frequency0
  9. {
  10. FrequencyId = 0;
  11. };
  12. ShaderResourceGroup BufferSrg : SRG_Frequency0
  13. {
  14. RWTexture2D<float4> m_output;
  15. };
  16. struct VSInput
  17. {
  18. float3 m_position : POSITION;
  19. float2 m_uv : UV0;
  20. };
  21. struct VSOutput
  22. {
  23. float4 m_position : SV_Position;
  24. float2 m_uv : UV0;
  25. };
  26. VSOutput MainVS(VSInput vsInput)
  27. {
  28. VSOutput OUT;
  29. OUT.m_position = float4(vsInput.m_position, 1.0);
  30. OUT.m_uv = vsInput.m_uv;
  31. return OUT;
  32. }
  33. struct PSOutput
  34. {
  35. float4 m_color : SV_Target0;
  36. };
  37. PSOutput MainPS(VSOutput psInput)
  38. {
  39. PSOutput OUT;
  40. OUT.m_color = float4(BufferSrg::m_output[psInput.m_position.xy].xyz, 1.0);
  41. return OUT;
  42. }