BabylonJS/Babylon.js · error
computeDispatchIndirect: This engine does not support comput
Error message
computeDispatchIndirect: This engine does not support compute shaders!
What it means
ThinEngine.prototype.computeDispatchIndirect is another always-throwing stub installed on engines without compute shader support. Indirect dispatch (reading dispatch dimensions from a GPU buffer) is a WebGPU-only capability, so calling it on a WebGL engine throws this error. Note areAllComputeEffectsReady still returns true on such engines, so readiness checks will not stop you.
Source
Thrown at packages/dev/core/src/Engines/Extensions/engine.computeShader.pure.ts:111
context: IComputeContext,
bindings: ComputeBindingList,
x: number,
y?: number,
z?: number,
bindingsMapping?: ComputeBindingMapping
): void {
throw new Error("computeDispatch: This engine does not support compute shaders!");
};
ThinEngine.prototype.computeDispatchIndirect = function (
effect: ComputeEffect,
context: IComputeContext,
bindings: ComputeBindingList,
buffer: DataBuffer,
offset?: number,
bindingsMapping?: ComputeBindingMapping
): void {
throw new Error("computeDispatchIndirect: This engine does not support compute shaders!");
};
ThinEngine.prototype.areAllComputeEffectsReady = function (): boolean {
return true;
};
ThinEngine.prototype.releaseComputeEffects = function (): void {};
ThinEngine.prototype._prepareComputePipelineContext = function (
pipelineContext: IComputePipelineContext,
computeSourceCode: string,
rawComputeSourceCode: string,
defines: Nullable<string>,
entryPoint: string
): void {};
ThinEngine.prototype._rebuildComputeEffects = function (): void {};
View on GitHub (pinned to 0592b347b8)
Solutions
- Run on a WebGPU engine; feature-detect navigator.gpu before initializing compute code paths.
- Gate indirect dispatch behind engine.isWebGPU (or engine._features.supportComputeShaders) and provide a standard computeDispatch or CPU fallback otherwise.
- Try/catch around the dispatch call to degrade gracefully.
- Document the WebGPU requirement so users do not load the compute path in WebGL-only environments.
Example fix
// before
computeShader.dispatchIndirect(argsBuffer, 0);
// after
if (engine.isWebGPU) {
computeShader.dispatchIndirect(argsBuffer, 0);
} else {
computeShader.dispatch(workgroupsX, 1, 1); // or CPU fallback
} Defensive patterns
Strategy: fallback
Validate before calling
if (!('gpu' in navigator)) {
throw new Error('Indirect dispatch requires WebGPU');
} Type guard
function supportsIndirectDispatch(e: AbstractEngine): boolean {
return (e as any).isWebGPU === true;
} Try / catch
try {
computeShader.dispatchIndirect(argsBuffer, 0);
} catch (e) {
if (String((e as Error).message).includes('computeDispatchIndirect')) {
computeShader.dispatch(cpuWorkgroupsX, 1, 1);
} else { throw e; }
} Prevention
- Treat indirect dispatch as WebGPU-only; gate it behind navigator.gpu detection
- Maintain a direct-dispatch fallback path using CPU-computed workgroup counts
- Capture WebGPU capability at engine init and configure the code path once
- Test on browsers/devices without WebGPU to validate degradation
When it happens
Trigger: Calling engine.computeDispatchIndirect(effect, context, bindings, buffer, offset) — or ComputeShader.dispatchIndirect — on a WebGL-based engine lacking compute support.
Common situations: GPUs-driven simulations or culling code using indirect dispatch running under WebGL fallback; porting a WebGPU-only sample to a machine/browser without WebGPU; headless CI without --enable-unsafe-webgpu.
Related errors
- createComputeEffect: This engine does not support compute sh
- createComputePipelineContext: This engine does not support c
- computeDispatch: This engine does not support compute shader
- Atmosphere is not supported on WebGL ${engine.version}.
- Instanced arrays are required for MSDF text rendering.
AI-assisted analysis of BabylonJS/Babylon.js@0592b347b8 (2026-08-30).
Data as JSON: /api/errors/8f04641050e3d280.
Report an issue: GitHub.