PassLodKey.h 927 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef ANKI_RESOURCE_PASS_LEVEL_KEY_H
  2. #define ANKI_RESOURCE_PASS_LEVEL_KEY_H
  3. #include "anki/util/StdTypes.h"
  4. #include "anki/util/Assert.h"
  5. #include "anki/util/Array.h"
  6. namespace anki {
  7. /// The AnKi passes
  8. enum Pass
  9. {
  10. COLOR_PASS, ///< For MS
  11. DEPTH_PASS, ///< For shadows
  12. PASS_COUNT
  13. };
  14. /// Max level of detail
  15. const U MAX_LOD = 3;
  16. /// A key that consistst of the rendering pass and the level of detail
  17. struct PassLodKey
  18. {
  19. U8 pass;
  20. U8 level;
  21. PassLodKey()
  22. : pass(COLOR_PASS), level(0)
  23. {
  24. ANKI_ASSERT(level <= MAX_LOD);
  25. }
  26. PassLodKey(const PassLodKey& b)
  27. : pass(b.pass), level(b.level)
  28. {
  29. ANKI_ASSERT(level <= MAX_LOD);
  30. }
  31. explicit PassLodKey(const U8 pass_, const U8 level_)
  32. : pass(pass_), level(level_)
  33. {
  34. ANKI_ASSERT(level <= MAX_LOD);
  35. }
  36. };
  37. /// An array to store based on pass and LOD
  38. template<typename T>
  39. using PassLodArray = Array2d<T, PASS_COUNT, MAX_LOD + 1>;
  40. } // end namespace anki
  41. #endif