3#include "../Interface/ShaderProgram.hpp"
5#include <initializer_list>
32 const std::vector<const WebGPUShader*>&
GetShaders()
const;
63 struct StorageBufferInfo {
64 WGPUShaderStageFlags shaderStages;
68 void AddMatrices(WGPUDevice device);
69 void AddStorageBuffers(WGPUDevice device,
const std::vector<StorageBufferInfo>& storageBufferInfos);
70 void AddMaterial(WGPUDevice device,
unsigned int count);
71 void AddPushConstants(WGPUDevice device,
unsigned int pushConstantCount, ShaderSource::ReflectionInfo::PushConstant* pushConstants);
72 void AddUniforms(WGPUDevice device,
bool hasUniformsBuffer);
74 std::vector<const WebGPUShader*> shaders;
76 WGPUBindGroupLayout bindGroupLayouts[ShaderProgram::BindingType::BINDING_TYPES];
77 bool bindGroupLayoutIsEmpty[ShaderProgram::BindingType::BINDING_TYPES];
79 bool hasUniformsBuffer =
false;
80 uint32_t pushConstantSize = 0;
A shader program.
Definition: ShaderProgram.hpp:11
BindingType
A type of bound resource.
Definition: ShaderProgram.hpp:14
WebGPU implementation of ShaderProgram.
Definition: WebGPUShaderProgram.hpp:16
~WebGPUShaderProgram() final
Destructor.
Definition: WebGPUShaderProgram.cpp:62
WebGPUShaderProgram(WGPUDevice device, std::initializer_list< const Shader * > shaders)
Create new WebGPU shader program.
Definition: WebGPUShaderProgram.cpp:8
bool HasUniformsBuffer() const
Get whether the UNIFORMS bind group has a uniform buffer.
Definition: WebGPUShaderProgram.cpp:80
const WGPUBindGroupLayout * GetBindGroupLayouts() const
Get the bind group layouts.
Definition: WebGPUShaderProgram.cpp:72
bool IsBindGroupLayoutEmpty(ShaderProgram::BindingType bindingType) const
Get whether a bind group layout is empty.
Definition: WebGPUShaderProgram.cpp:76
const std::vector< const WebGPUShader * > & GetShaders() const
Get the shaders in the shader program.
Definition: WebGPUShaderProgram.cpp:68
uint32_t GetPushConstantSize() const
Get the size of the push constants.
Definition: WebGPUShaderProgram.cpp:84
Definition: Editor.hpp:18