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

@@ -294,6 +294,14 @@ bool GPUDeviceWebGPU::Init()
{
MinUniformBufferOffsetAlignment = limits.minUniformBufferOffsetAlignment;
TimestampQuery = features.Contains(WGPUFeatureName_TimestampQuery);
Limits.HasCompute =
limits.maxStorageBuffersPerShaderStage >= GPU_MAX_UA_BINDED &&
limits.maxStorageTexturesPerShaderStage >= GPU_MAX_UA_BINDED &&
limits.maxComputeWorkgroupsPerDimension >= GPU_MAX_CS_DISPATCH_THREAD_GROUPS &&
limits.maxComputeWorkgroupSizeX >= 1024 &&
limits.maxComputeWorkgroupSizeY >= 256 &&
limits.maxComputeWorkgroupSizeZ >= 8 &&
limits.maxBufferSize >= 64 * 1024 * 1024; // 64MB
Limits.HasInstancing = true;
Limits.HasDrawIndirect = true;
Limits.HasDepthAsSRV = true;