Cogs.Core
ShaderBuilderHelpersWebGPU.h
1#pragma once
2
3#include "MaterialTypes.h"
4#include "Rendering/IEffects.h"
5#include "Rendering/IBindGroups.h"
6
7#include "Utilities/Strings.h"
8#include <string_view>
9#include <unordered_set>
10
11namespace Cogs::Core
12{
13 const Cogs::BindGroupSetDescription& getEngineBindGroupDescription();
14 void addEngineUniformsToSourceWebGPU(std::string& source, const std::unordered_set<Cogs::Core::StringRef>& identifiersSeen, std::vector<bool>& bindGroupUsed);
15
17 const Cogs::BindGroupEntryDescription* findEntryByName(const Cogs::BindGroupDescription& group, std::string_view name);
18
20 void addBufferToSource(std::string& source, const std::string& name, BindGroup group, const Cogs::BindGroupEntryDescription& entry);
21
23 void addSamplerToSource(std::string& source, const std::string& name, BindGroup group, const Cogs::BindGroupEntryDescription& entry);
24
26 void addTextureToSource(std::string& source, const std::string& name, BindGroup group, const Cogs::BindGroupEntryDescription& entry);
27}
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
void addBufferToSource(std::string &source, const std::string &name, BindGroup group, const Cogs::BindGroupEntryDescription &entry)
Emits a valid WGSL uniform buffer declaration ("#include" + "@group()@binding() var<uniform>") for an...
const Cogs::BindGroupEntryDescription * findEntryByName(const Cogs::BindGroupDescription &group, std::string_view name)
Finds an entry by name within a single bind group's already-populated entries (bound by numEntries).
void addSamplerToSource(std::string &source, const std::string &name, BindGroup group, const Cogs::BindGroupEntryDescription &entry)
Emits a valid WGSL sampler declaration ("@group()@binding() var") for an engine-provided sampler entr...
void addTextureToSource(std::string &source, const std::string &name, BindGroup group, const Cogs::BindGroupEntryDescription &entry)
Emits a valid WGSL texture declaration ("@group()@binding() var") for an engine-provided texture entr...