CopyQueue.azsl 1007 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #include <Atom/Features/SrgSemantics.azsli>
  9. ShaderResourceGroup CopyQueueSrg : SRG_PerObject
  10. {
  11. Texture2D m_texture;
  12. Sampler m_sampler
  13. {
  14. MaxAnisotropy = 16;
  15. AddressU = Wrap;
  16. AddressV = Wrap;
  17. AddressW = Wrap;
  18. };
  19. }
  20. struct VSInput
  21. {
  22. float3 m_position : POSITION;
  23. float2 m_uv : UV0;
  24. };
  25. struct VSOutput
  26. {
  27. float4 m_position : SV_Position;
  28. float2 m_uv : UV0;
  29. };
  30. VSOutput MainVS(VSInput vsInput)
  31. {
  32. VSOutput OUT;
  33. OUT.m_position = float4(vsInput.m_position, 1.0);
  34. OUT.m_uv = vsInput.m_uv;
  35. return OUT;
  36. }
  37. struct PSOutput
  38. {
  39. float4 m_color : SV_Target0;
  40. };
  41. PSOutput MainPS(VSOutput psInput)
  42. {
  43. PSOutput OUT;
  44. float4 texture1 = CopyQueueSrg::m_texture.Sample(CopyQueueSrg::m_sampler, psInput.m_uv);
  45. OUT.m_color = texture1;
  46. return OUT;
  47. }