diff options
Diffstat (limited to 'src/gpu/uniform_helper.h')
| -rw-r--r-- | src/gpu/uniform_helper.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gpu/uniform_helper.h b/src/gpu/uniform_helper.h index 8556c98..b2f3406 100644 --- a/src/gpu/uniform_helper.h +++ b/src/gpu/uniform_helper.h @@ -1,12 +1,10 @@ // This file is part of the 64k demo project. -// It provides a generic uniform buffer helper to reduce boilerplate. -// Templated on uniform struct type for type safety and automatic sizing. +// Generic uniform buffer helper. #pragma once #include "gpu/gpu.h" -// Generic uniform buffer helper // Usage: // UniformBuffer<MyUniforms> uniforms_; // uniforms_.init(device); @@ -15,18 +13,15 @@ template <typename T> class UniformBuffer { public: UniformBuffer() = default; - // Initialize the uniform buffer with the device void init(WGPUDevice device) { buffer_ = gpu_create_buffer( device, sizeof(T), WGPUBufferUsage_Uniform | WGPUBufferUsage_CopyDst); } - // Update the uniform buffer with new data void update(WGPUQueue queue, const T& data) { wgpuQueueWriteBuffer(queue, buffer_.buffer, 0, &data, sizeof(T)); } - // Get the underlying GpuBuffer (for bind group creation) GpuBuffer& get() { return buffer_; } |
