Class StorageBuffer#
Defined in File StorageBuffer.h
Class Documentation#
-
class StorageBuffer#
Public Functions
-
constexpr StorageBuffer(StorageBuffer&&) noexcept = default#
Move constructor.
-
constexpr StorageBuffer &operator=(StorageBuffer&&) noexcept = default#
Move assignment operator.
-
consteval StorageBuffer(const StorageBuffer&) noexcept = delete#
Copy constructor.
-
consteval StorageBuffer &operator=(const StorageBuffer&) noexcept = delete#
Copy assignment operator.
-
constexpr ~StorageBuffer() = default#
Destructor.
-
constexpr UpdateFrequency GetUpdateFrequency() const noexcept#
Retrieve the update frequency of the SSBO.
- Returns:
Update frequency of the SSBO.
-
constexpr const std::vector<TRAP::Ref<TRAP::Graphics::Buffer>> &GetSSBOs() const noexcept#
Retrieve the underlying buffers.
- Returns:
Underlying buffers.
-
void SetData(const void *data, u64 size, u64 offset = 0)#
Update data of the SSBO.
- Parameters:
data – New data.
size – Byte size of the data.
offset – Offset into the currently used data.
-
inline void GetData(const auto *data, u64 size, u64 offset = 0, const Window &window = *TRAP::Application::GetWindow())#
Retrieve data of the SSBO.
Remark
Headless mode: This function is not available in headless mode.
-
bool IsLoaded() const#
Check whether uploading data to the GPU has finished.
- Returns:
True if uploading data to the GPU has finished.
-
void AwaitLoading() const#
Wait until uploading data to the GPU has finished.
-
template<typename T>
TRAP::Scope<TRAP::Graphics::StorageBuffer> Create(const T *const data, const u64 size, const UpdateFrequency updateFrequency)#
-
template<typename T>
TRAP::Scope<TRAP::Graphics::StorageBuffer> Init(const T *const data, const u64 size, const UpdateFrequency updateFrequency)#
Public Static Functions
-
static u64 CalculateAlignedSize(u64 byteSize) noexcept#
Calculate the aligned size of the SSBO.
- Parameters:
byteSize – Byte size of the SSBO.
-
static Scope<StorageBuffer> Create(u64 size, UpdateFrequency updateFrequency)#
Create a new shader storage buffer and set its size.
- Parameters:
size – Byte size for the uniform buffer.
updateFrequency – Update frequency for the buffer.
- Returns:
New shader storage buffer.
-
template<typename T>
static Scope<StorageBuffer> Create(const T *data, u64 size, UpdateFrequency updateFrequency)# Create a new shader storage buffer and set its data.
- Parameters:
data – Pointer to the data to upload.
size – Byte size of the data to upload.
updateFrequency – Update frequency for the buffer.
- Returns:
New shader storage buffer.
-
constexpr StorageBuffer(StorageBuffer&&) noexcept = default#