RayTracingPassData.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #pragma once
  9. #include <Atom/RPI.Reflect/Asset/AssetReference.h>
  10. #include <Atom/RPI.Reflect/Pass/RenderPassData.h>
  11. namespace AZ
  12. {
  13. namespace Render
  14. {
  15. //! Custom data for the RayTracingPass, specified in the PassRequest.
  16. struct RayTracingPassData
  17. : public RPI::RenderPassData
  18. {
  19. AZ_RTTI(RayTracingPassData, "{26C2E2FD-D30A-4142-82A3-0167BC94B3EE}", RPI::RenderPassData);
  20. AZ_CLASS_ALLOCATOR(RayTracingPassData, SystemAllocator);
  21. RayTracingPassData() = default;
  22. virtual ~RayTracingPassData() = default;
  23. static void Reflect(ReflectContext* context)
  24. {
  25. if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
  26. {
  27. serializeContext->Class<RayTracingPassData, RenderPassData>()
  28. ->Version(1)
  29. ->Field("RayGenerationShaderAsset", &RayTracingPassData::m_rayGenerationShaderAssetReference)
  30. ->Field("RayGenerationShaderName", &RayTracingPassData::m_rayGenerationShaderName)
  31. ->Field("ClosestHitShaderAsset", &RayTracingPassData::m_closestHitShaderAssetReference)
  32. ->Field("ClosestHitShaderName", &RayTracingPassData::m_closestHitShaderName)
  33. ->Field("MissShaderAsset", &RayTracingPassData::m_missShaderAssetReference)
  34. ->Field("MissShaderName", &RayTracingPassData::m_missShaderName)
  35. ->Field("MaxPayloadSize", &RayTracingPassData::m_maxPayloadSize)
  36. ->Field("MaxAttributeSize", &RayTracingPassData::m_maxAttributeSize)
  37. ->Field("MaxRecursionDepth", &RayTracingPassData::m_maxRecursionDepth)
  38. ->Field("Thread Count X", &RayTracingPassData::m_threadCountX)
  39. ->Field("Thread Count Y", &RayTracingPassData::m_threadCountY)
  40. ->Field("Thread Count Z", &RayTracingPassData::m_threadCountZ)
  41. ->Field("Make Fullscreen Pass", &RayTracingPassData::m_makeFullscreenPass)
  42. ->Field("Max Ray Length", &RayTracingPassData::m_maxRayLength)
  43. ;
  44. }
  45. }
  46. RPI::AssetReference m_rayGenerationShaderAssetReference;
  47. AZStd::string m_rayGenerationShaderName;
  48. RPI::AssetReference m_closestHitShaderAssetReference;
  49. AZStd::string m_closestHitShaderName;
  50. RPI::AssetReference m_missShaderAssetReference;
  51. AZStd::string m_missShaderName;
  52. uint32_t m_maxPayloadSize = 64;
  53. uint32_t m_maxAttributeSize = 32;
  54. uint32_t m_maxRecursionDepth = 1;
  55. float m_maxRayLength = 1e27f;
  56. uint32_t m_threadCountX = 1;
  57. uint32_t m_threadCountY = 1;
  58. uint32_t m_threadCountZ = 1;
  59. bool m_makeFullscreenPass = false;
  60. };
  61. } // namespace RPI
  62. } // namespace AZ