3#include "CommonWebGPU.h"
5#include "../Base/EffectsCommon.h"
8 class GraphicsDeviceWebGPU;
10 enum WebGPUConstantBufferUsage {
11 ShaderStage_None = 0x00000000,
12 ShaderStage_Vertex = 0x00000001,
13 ShaderStage_Fragment = 0x00000002,
14 ShaderStage_Compute = 0x00000004,
15 ShaderStage_Force32 = 0x7FFFFFFF
18 enum WebGPUConstantBufferType { UniformBuffer, Texture, Sampler };
23 WGPUBindGroupLayoutEntry bg_ent;
30 WGPUVertexFormat format;
36 static const size_t maxTexUnits = 128;
37 static const size_t maxConstantBuffers = 128;
38 static const size_t maxVertexAttribs = 32;
39 WGPUShaderModule vs_module;
40 WGPUShaderModule fs_module;
41 WGPUShaderModule cs_module;
90 bool addConstantBufferBindings(
EffectWebGPU& effect,
const std::vector<Cogs::WebGPUConstantBufferBinding>& bindings);
virtual void annotate(EffectHandle, const StringView &) override
Associate a name with an object for use in graphics debugging.
virtual void annotateVS(EffectHandle, const StringView &) override
Associate a name with an object for use in graphics debugging.
void releaseBufferBinding(BufferBindingHandle) override
Release a handle to a buffer binding.
TextureBindingHandle getTextureBinding(EffectHandle effectHandle, const StringView &name, const unsigned int slot) override
Get a handle to a texture object binding, mapping how to bind textures to the given effect.
virtual void annotateGS(EffectHandle, const StringView &) override
Associate a name with an object for use in graphics debugging.
virtual void releaseEffect(EffectHandle effectHandle) override
Release the effect with the given handle, freeing all resources generated during program loading.
BufferBindingHandle getBufferBinding(EffectHandle effectHandle, const StringView &name) override
Get a handle to a buffer binding.
virtual void annotateCS(EffectHandle, const StringView &) override
Associate a name with an object for use in graphics debugging.
virtual EffectHandle loadComputeEffect(const StringView &, EffectFlags::EEffectFlags) override
Load the compute shader with the given file name and create an effect.
ConstantBufferBindingHandle getConstantBufferBinding(EffectHandle effectHandle, const StringView &name) override
Get a handle to a constant buffer binding, mapping how to bind a constant buffer to the given effect.
virtual void releaseResources() override
Release all allocated effect resources.
SamplerStateBindingHandle getSamplerStateBinding(EffectHandle effectHandle, const StringView &, const unsigned int slot) override
Get a handle to a sampler state object binding, mapping how to bind the sampler state to the given ef...
virtual void annotatePS(EffectHandle, const StringView &) override
Associate a name with an object for use in graphics debugging.
Provides a weakly referenced view over the contents of a string.
Contains all Cogs related functionality.
std::vector< PreprocessorDefinition > PreprocessorDefinitions
A set of preprocessor definitions.
Contains an effect description used to load a single effect.
EEffectFlags
Effect source flags.
Provides buffer management functionality.