{"record":{"id":"8f04641050e3d280","repo":"BabylonJS/Babylon.js","slug":"computedispatchindirect-this-engine-does-not-supp","errorCode":null,"errorMessage":"computeDispatchIndirect: This engine does not support compute shaders!","messagePattern":"computeDispatchIndirect: This engine does not support compute shaders!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Engines/Extensions/engine.computeShader.pure.ts","lineNumber":111,"sourceCode":"        context: IComputeContext,\r\n        bindings: ComputeBindingList,\r\n        x: number,\r\n        y?: number,\r\n        z?: number,\r\n        bindingsMapping?: ComputeBindingMapping\r\n    ): void {\r\n        throw new Error(\"computeDispatch: This engine does not support compute shaders!\");\r\n    };\r\n\r\n    ThinEngine.prototype.computeDispatchIndirect = function (\r\n        effect: ComputeEffect,\r\n        context: IComputeContext,\r\n        bindings: ComputeBindingList,\r\n        buffer: DataBuffer,\r\n        offset?: number,\r\n        bindingsMapping?: ComputeBindingMapping\r\n    ): void {\r\n        throw new Error(\"computeDispatchIndirect: This engine does not support compute shaders!\");\r\n    };\r\n\r\n    ThinEngine.prototype.areAllComputeEffectsReady = function (): boolean {\r\n        return true;\r\n    };\r\n\r\n    ThinEngine.prototype.releaseComputeEffects = function (): void {};\r\n\r\n    ThinEngine.prototype._prepareComputePipelineContext = function (\r\n        pipelineContext: IComputePipelineContext,\r\n        computeSourceCode: string,\r\n        rawComputeSourceCode: string,\r\n        defines: Nullable<string>,\r\n        entryPoint: string\r\n    ): void {};\r\n\r\n    ThinEngine.prototype._rebuildComputeEffects = function (): void {};\r\n\r","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Engines/Extensions/engine.computeShader.pure.ts#L93-L129","documentation":"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.","triggerScenarios":"Calling engine.computeDispatchIndirect(effect, context, bindings, buffer, offset) — or ComputeShader.dispatchIndirect — on a WebGL-based engine lacking compute support.","commonSituations":"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.","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."],"exampleFix":"// before\ncomputeShader.dispatchIndirect(argsBuffer, 0);\n// after\nif (engine.isWebGPU) {\n    computeShader.dispatchIndirect(argsBuffer, 0);\n} else {\n    computeShader.dispatch(workgroupsX, 1, 1); // or CPU fallback\n}","handlingStrategy":"fallback","validationCode":"if (!('gpu' in navigator)) {\n    throw new Error('Indirect dispatch requires WebGPU');\n}","typeGuard":"function supportsIndirectDispatch(e: AbstractEngine): boolean {\n    return (e as any).isWebGPU === true;\n}","tryCatchPattern":"try {\n    computeShader.dispatchIndirect(argsBuffer, 0);\n} catch (e) {\n    if (String((e as Error).message).includes('computeDispatchIndirect')) {\n        computeShader.dispatch(cpuWorkgroupsX, 1, 1);\n    } else { throw e; }\n}","preventionTips":["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"],"tags":["webgpu","compute-shaders","indirect-dispatch","engine-capability"],"backgroundTag":"compute-shaders-not-supported","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}