{"record":{"id":"eed84be05de8cd28","repo":"BabylonJS/Babylon.js","slug":"createcomputeeffect-this-engine-does-not-support","errorCode":null,"errorMessage":"createComputeEffect: This engine does not support compute shaders!","messagePattern":"createComputeEffect: 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":80,"sourceCode":"    InternalTexture = 8,\r\n}\r\n\r\n/** @internal */\r\nexport type ComputeBindingList = { [key: string]: { type: ComputeBindingType; object: any; indexInGroupEntries?: number } };\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for enginesExtensionsEngineComputeShader.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterEnginesExtensionsEngineComputeShader(): void {\r\n    if (_Registered) {\r\n        return;\r\n    }\r\n    _Registered = true;\r\n\r\n    ThinEngine.prototype.createComputeEffect = function (baseName: IComputeShaderPath & { computeToken?: string }, options: IComputeEffectCreationOptions): ComputeEffect {\r\n        throw new Error(\"createComputeEffect: This engine does not support compute shaders!\");\r\n    };\r\n\r\n    ThinEngine.prototype.createComputePipelineContext = function (): IComputePipelineContext {\r\n        throw new Error(\"createComputePipelineContext: This engine does not support compute shaders!\");\r\n    };\r\n\r\n    ThinEngine.prototype.createComputeContext = function (): IComputeContext | undefined {\r\n        return undefined;\r\n    };\r\n\r\n    ThinEngine.prototype.computeDispatch = function (\r\n        effect: ComputeEffect,\r\n        context: IComputeContext,\r\n        bindings: ComputeBindingList,\r\n        x: number,\r\n        y?: number,\r\n        z?: number,\r\n        bindingsMapping?: ComputeBindingMapping\r","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Engines/Extensions/engine.computeShader.pure.ts#L62-L98","documentation":"BabylonJS registers stub compute-shader methods on ThinEngine for engines that lack compute support (WebGL1/WebGL2 without WebGPU). Calling engine.createComputeEffect() on such an engine hits this stub, which throws immediately. Compute effects are only really implemented on WebGPU (and Native) engines.","triggerScenarios":"Calling engine.createComputeEffect() (directly or via ComputeShader / GPU particle helpers) on a ThinEngine/Engine derived from WebGL rather than a WebGPU engine, i.e. when the full WebGPU compute extension was not registered on this engine.","commonSituations":"Running a compute-based feature (ComputeShader, compute GPU particles) while the page falls back to WebGL because WebGPU is unavailable; forcing engineType to WebGL in EngineFactory; calling compute APIs on a raw ThinEngine in tests or headless environments.","solutions":["Run the app with a WebGPU-capable engine (navigator.gpu available) or force WebGPU via EngineFactory.CreateAsync(engineType: 'webgpu').","Check engine.isWebGPU / engine._features.supportComputeShaders before creating compute effects and branch to a non-compute path.","Wrap compute initialization in try/catch and fall back to a fragment-shader or CPU implementation.","Update BabylonJS packages so the WebGPU compute extension registration is included in the bundle."],"exampleFix":"// before\nconst effect = engine.createComputeEffect({ computeSource: '...' }, {});\n// after\nif (engine.isWebGPU) {\n    const effect = engine.createComputeEffect({ computeSource: '...' }, {});\n} else {\n    // fallback path without compute shaders\n}","handlingStrategy":"fallback","validationCode":"if (!('gpu' in navigator) || !engine.isWebGPU) {\n    throw new Error('Compute shaders require a WebGPU engine');\n}","typeGuard":"function supportsCompute(engine: AbstractEngine): boolean {\n    return (engine as any).isWebGPU === true;\n}","tryCatchPattern":"try {\n    const effect = engine.createComputeEffect({ computeSource }, options);\n} catch (e) {\n    if (e instanceof Error && e.message.includes('does not support compute shaders')) {\n        useNonComputeFallback();\n    } else {\n        throw e;\n    }\n}","preventionTips":["Feature-detect navigator.gpu and engine.isWebGPU before any compute API usage","Prefer EngineFactory.CreateAsync so the best available engine is chosen deliberately","Expose a non-compute fallback code path in your rendering pipeline","Check engine._features.supportComputeShaders if available","Test your app in a WebGL-only environment to exercise the fallback"],"tags":["webgpu","compute-shaders","engine-capability","babylonjs"],"backgroundTag":"compute-shaders-not-supported","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}