CmBindableGpuParamBlock.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmCommonEnums.h"
  4. #include "CmCoreObject.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Specialized class for binding GPU parameters to the render system. Represents a single
  9. * parameter block buffer and is used for temporary storage of GPU parameters.
  10. *
  11. * @note Due to the way allocation is handled, this class is not allowed to have a destructor.
  12. *
  13. * @see BindableGpuParams
  14. */
  15. class CM_EXPORT BindableGpuParamBlock
  16. {
  17. public:
  18. BindableGpuParamBlock();
  19. /**
  20. * @brief Uploads the current data to the specified buffer, and marks the block a non-dirty.
  21. *
  22. * @note Core thread only.
  23. */
  24. void uploadToBuffer(GpuParamBlockBufferPtr buffer);
  25. /**
  26. * @brief Query if this object is dirty. If dirty the data of this block
  27. * will need to be uploaded to a GPU buffer.
  28. *
  29. * @note Core thread only.
  30. */
  31. bool isDirty() const { return mDirty; }
  32. protected:
  33. friend class GpuParams;
  34. friend class BindableGpuParams;
  35. UINT8* mData;
  36. UINT32 mSize;
  37. bool mDirty;
  38. };
  39. }