BsBindableGpuParamBlock.h 1.0 KB

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