9#include <glm/gtc/type_ptr.hpp>
14 static inline std::string
prefix =
"DirectionalLightBuffer_";
71 bufferDesc.usage = wgpu::BufferUsage::CopyDst | wgpu::BufferUsage::Uniform;
75 return context.
GetDevice()->createBuffer(bufferDesc);
82 context.
queue->writeBuffer(
_buffer, 0, std::addressof(directionalLightTransfer),
static std::string prefix
Definition DirectionalLightBuffer.hpp:14
void Destroy(Engine::Core &core) override
Definition DirectionalLightBuffer.hpp:38
const wgpu::Buffer & GetBuffer() const override
Definition DirectionalLightBuffer.hpp:61
DirectionalLightBuffer(Engine::Entity entity)
Definition DirectionalLightBuffer.hpp:27
wgpu::Buffer _buffer
Definition DirectionalLightBuffer.hpp:86
wgpu::Buffer _CreateBuffer(const Graphic::Resource::DeviceContext &context)
Definition DirectionalLightBuffer.hpp:68
~DirectionalLightBuffer() override
Definition DirectionalLightBuffer.hpp:29
bool _isCreated
Definition DirectionalLightBuffer.hpp:87
void _UpdateDebugName()
Definition DirectionalLightBuffer.hpp:66
std::string _debugName
Definition DirectionalLightBuffer.hpp:89
Engine::Entity _entity
Definition DirectionalLightBuffer.hpp:88
bool IsCreated(Engine::Core &core) const override
Definition DirectionalLightBuffer.hpp:49
void Destroy()
Definition DirectionalLightBuffer.hpp:40
std::string_view GetDebugName() const
Definition DirectionalLightBuffer.hpp:63
void _UpdateBuffer(const Graphic::Resource::Context &context, const Component::GPUDirectionalLight &GPUDirectionalLight)
Definition DirectionalLightBuffer.hpp:78
void Update(Engine::Core &core) override
Definition DirectionalLightBuffer.hpp:50
void Create(Engine::Core &core) override
Definition DirectionalLightBuffer.hpp:31
The core is the place where all the data of the engine is stored. It contains the registry (entities)...
Definition Core.hpp:33
TResource & GetResource()
Get a reference of a resource.
Definition Core.inl:14
Wrapper class providing a convenient interface for entity manipulation with the Core....
Definition Entity.hpp:20
Definition AGPUBuffer.hpp:7
std::optional< wgpu::Queue > queue
Definition Context.hpp:44
Definition AmbientLight.cpp:6
constexpr DefaultFlag Default
Definition webgpu.hpp:78
StringView(const std::string_view &cpp)
Definition webgpu.hpp:618
Definition GPUDirectionalLight.hpp:11
Definition DirectionalLightBuffer.hpp:15
static uint32_t CPUSize()
Definition DirectionalLightBuffer.hpp:23
glm::mat4 viewProjectionMatrix
Definition DirectionalLightBuffer.hpp:16
DirectionalLightTransfer(const Component::GPUDirectionalLight &GPUDirectionalLight)
Definition DirectionalLightBuffer.hpp:18
static uint32_t GPUSize()
Definition DirectionalLightBuffer.hpp:24
Definition DeviceContext.hpp:7
auto & GetDevice()
Definition DeviceContext.hpp:13