CmBindableGpuParamBlock.h 721 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmCommonEnums.h"
  4. #include "CmCoreObject.h"
  5. namespace CamelotFramework
  6. {
  7. /**
  8. * @note Due to the way allocation is handled, this class is not allowed to have a destructor.
  9. */
  10. class CM_EXPORT BindableGpuParamBlock
  11. {
  12. public:
  13. BindableGpuParamBlock();
  14. /**
  15. * @brief Uploads the current data to the specified buffer, and marks the block a non-dirty.
  16. * Should only be called from the core thread.
  17. */
  18. void uploadToBuffer(GpuParamBlockBufferPtr buffer);
  19. bool isDirty() const { return mDirty; }
  20. protected:
  21. friend class GpuParams;
  22. friend class BindableGpuParams;
  23. UINT8* mData;
  24. UINT32 mSize;
  25. bool mDirty;
  26. };
  27. }