GpuVisibilityTypes.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <AnKi/Shaders/Include/Common.h>
  7. ANKI_BEGIN_NAMESPACE
  8. struct FrustumGpuVisibilityConsts
  9. {
  10. Vec4 m_clipPlanes[6u];
  11. Vec4 m_maxLodDistances;
  12. Vec3 m_lodReferencePoint;
  13. F32 m_padding3;
  14. Mat4 m_viewProjectionMat;
  15. Vec2 m_finalRenderTargetSize;
  16. };
  17. struct DistanceGpuVisibilityConstants
  18. {
  19. Vec3 m_pointOfTest;
  20. F32 m_testRadius;
  21. Vec4 m_maxLodDistances;
  22. Vec3 m_lodReferencePoint;
  23. F32 m_padding3;
  24. };
  25. struct GpuVisibilityNonRenderableConstants
  26. {
  27. Vec4 m_clipPlanes[6u];
  28. };
  29. struct GpuVisibilityAccelerationStructuresConstants
  30. {
  31. Vec4 m_clipPlanes[6u];
  32. Vec3 m_pointOfTest;
  33. F32 m_testRadius;
  34. Vec4 m_maxLodDistances;
  35. };
  36. struct GpuVisibilityHash
  37. {
  38. U32 m_renderablesHash;
  39. U32 m_containsDeformable;
  40. };
  41. struct GpuVisibilityVisibleRenderableDesc
  42. {
  43. U32 m_lod_2bit_renderableIndex_20bit_renderStageBucket_10bit;
  44. };
  45. struct GpuVisibilityVisibleMeshletDesc
  46. {
  47. U32 m_renderableIndex_30bit_renderStageBucket_12bit;
  48. U32 m_lod_2bit_meshletIndex_30bit;
  49. };
  50. struct GpuVisibilityMeshletConstants
  51. {
  52. Mat4 m_viewProjectionMatrix;
  53. Vec3 m_cameraPos;
  54. U32 m_padding1;
  55. Vec2 m_viewportSizef;
  56. UVec2 m_padding2;
  57. };
  58. enum class GpuVisibilityCounter : U32
  59. {
  60. kVisibleRenderableCount,
  61. kMeshletsSurvivingStage1Count,
  62. kThreadgroupCount,
  63. kMeshletsCulledByHzbCount,
  64. kCount
  65. };
  66. enum class GpuVisibilityIndirectDispatches : U32
  67. {
  68. k2ndStageLegacy,
  69. k2ndStageMeshlets,
  70. k3rdStageMeshlets,
  71. kCount
  72. };
  73. /// Counters used in non-renderables visibility
  74. struct GpuVisibilityNonRenderablesCounters
  75. {
  76. U32 m_threadgroupCount; ///< Counts the no of threadgroups
  77. U32 m_visibleObjectCount; ///< Counts the visible objects
  78. U32 m_feedbackObjectCount; ///< Counts the visbile objects that need feedback
  79. };
  80. ANKI_END_NAMESPACE