CmGenericBufferView.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. namespace CamelotEngine
  4. {
  5. class CM_EXPORT GenericBufferView
  6. {
  7. public:
  8. struct Key
  9. {
  10. Key()
  11. { }
  12. Key(const GenericBufferView& view)
  13. : mFirstElement(view.mFirstElement), mElementWidth(view.mElementWidth)
  14. , mNumElements(view.mNumElements), mRandomGpuWrite(view.mRandomGpuWrite)
  15. { }
  16. Key(UINT32 firstElement, UINT32 elementWidth, UINT32 numElements, bool randomGpuWrite)
  17. : mFirstElement(firstElement), mElementWidth(elementWidth)
  18. , mNumElements(numElements), mRandomGpuWrite(randomGpuWrite)
  19. { }
  20. UINT32 mFirstElement;
  21. UINT32 mElementWidth;
  22. UINT32 mNumElements;
  23. bool mRandomGpuWrite;
  24. };
  25. class HashFunction
  26. {
  27. public:
  28. size_t operator()(const Key &key) const;
  29. };
  30. class EqualFunction
  31. {
  32. public:
  33. bool operator()(const Key &a, const Key &b) const;
  34. };
  35. GenericBufferView(UINT32 firstElement, UINT32 elementWidth, UINT32 numElements, bool randomGpuWrite);
  36. virtual ~GenericBufferView();
  37. private:
  38. UINT32 mFirstElement;
  39. UINT32 mElementWidth;
  40. UINT32 mNumElements;
  41. bool mRandomGpuWrite;
  42. };
  43. }