Add Compute shaders support to WebGPU

This commit is contained in:
Wojtek Figat
2026-03-04 21:27:42 +01:00
parent 5fb9cf3be1
commit 377d5c00aa
20 changed files with 657 additions and 449 deletions

View File

@@ -93,11 +93,14 @@ private:
bool FindClear(const GPUTextureViewWebGPU* view, PendingClear& clear);
void ManualClear(const PendingClear& clear);
void OnDrawCall();
void OnDispatch(GPUShaderProgramCS* shader);
WGPUComputePassEncoder OnDispatch(GPUShaderProgramCS* shader);
void EndRenderPass();
void EndComputePass(WGPUComputePassEncoder computePass);
void FlushRenderPass();
void FlushBindGroup();
void FlushTimestamps(int32 skipLast = 0);
constexpr static int32 DynamicOffsetsMax = 4;
void BuildBindGroup(uint32 groupIndex, const SpirvShaderDescriptorInfo& descriptors, GPUPipelineStateWebGPU::BindGroupKey& key, uint32 dynamicOffsets[DynamicOffsetsMax], uint32& dynamicOffsetsCount);
public:
// [GPUContext]