stride3d/stride · critical · InvalidOperationException
Unable to find compiled shaders
Error message
Unable to find compiled shaders [{0}] for mixin [{1}] with parameters [{2}] What it means
When compiling via the cache, if the compiler is NullEffectCompiler (runtime platforms where shader compilation is forbidden) and no bytecode was found, the cache logs and throws InvalidOperationException: the precompiled shader was not found for this mixin/parameter combination. It means the deployment is missing compiled effect bytecode for the requested effect permutation.
Solutions
- Re-run the shader/effect compilation step (Stride editor effect compile / build) so the new permutation is cached into the bundle.
- Ensure the compiled effects database (EffectDescriptors) is deployed with the application and mounted via the file provider.
- Avoid dynamic effect permutations at runtime on compilation-restricted platforms; pre-generate all needed ones.
- Check the logged compiledUrl/mixin/parameters and make sure that exact permutation is requested at build time too.
Example fix
// before (runtime on console/mobile with NullEffectCompiler) var bytecode = effectSystem.LoadEffect(mixinSource, parameters).WaitFor_result(); // after: precompile at build time in the editor (Game Studio effect compile), then load the same permutation var bytecode = effectSystem.LoadEffect(mixinSource, sameParametersAsBuild).WaitForResult();
Defensive patterns
Strategy: fallback
Validate before calling
if (!effectDatabase.ObjectDatabase.Exists(effectInputHash)) throw new InvalidOperationException($"Effect permutation {effectInputHash} was not precompiled; rerun the build-time effect compile"); Type guard
null
Try / catch
try { result = compiler.Compile(mixin, parameters, compilerParameters, hash); } catch (InvalidOperationException ex) when (ex.Message.Contains("Unable to find compiled shaders")) { /* fail fast with guidance to re-run build-time effect compilation */ } Prevention
- Run the effect-compilation build step after any shader/effect change
- Pre-declare all runtime effect permutations
- Verify the compiled-effects database is included in deployment
- Match runtime EffectCompilerParameters to build-time ones
When it happens
Trigger: Requesting an effect at runtime on a platform using NullEffectCompiler, where the effect's bytecode was never compiled at build time — e.g. a new/changed ShaderMixinSource+EffectCompilerParameters permutation absent from the precompiled bundle.
Common situations: Changing effect permutations or shader mixins after the last effect-compilation build step; deploying assets without running the EffectCompiler pipeline; calling effects from code that were never referenced at build time.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Shader Compilation is not allowed at run time on this…
- Bundle could not be resolved
- Could not locate native executable
- Could not locate native library
- Key [ ] must be a registered key
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/10a523deb3d3fcce.
Report an issue: GitHub.
Appendix: source
Thrown at sources/shaders/Stride.Shaders.Effects/Compiler/EffectCompilerCache.cs:105
var bytecode = new KeyValuePair<EffectBytecode, EffectBytecodeCacheLoadSource>(null, EffectBytecodeCacheLoadSource.JustCompiled);
lock (bytecodes)
{
// ------------------------------------------------------------------------------------------------------------
// 1) Try to load latest bytecode
// ------------------------------------------------------------------------------------------------------------
ObjectId bytecodeId;
if (database.ContentIndexMap.TryGetValue(compiledUrl, out bytecodeId))
{
bytecode = LoadEffectBytecode(database, bytecodeId);
}
// On non Windows platform, we are expecting to have the bytecode stored directly
if (Compiler is NullEffectCompiler && bytecode.Key == null)
{
var stringBuilder = new StringBuilder();
stringBuilder.AppendFormat("Unable to find compiled shaders [{0}] for mixin [{1}] with parameters [{2}]", compiledUrl, mixin, compilerParameters.ToStringPermutationsDetailed());
Log.Error(stringBuilder.ToString());
throw new InvalidOperationException(stringBuilder.ToString());
}
// ------------------------------------------------------------------------------------------------------------
// 2) Try to load from database cache
// ------------------------------------------------------------------------------------------------------------
if (bytecode.Key == null && database.ObjectDatabase.Exists(effectInputHash))
{
using (var stream = database.ObjectDatabase.OpenStream(effectInputHash))
{
// We have an existing stream, make sure the shader is compiled
var objectIdBuffer = new byte[ObjectId.HashSize];
if (stream.Read(objectIdBuffer, 0, ObjectId.HashSize) == ObjectId.HashSize)
{
var newBytecodeId = new ObjectId(objectIdBuffer);
bytecode = LoadEffectBytecode(database, newBytecodeId);
if (bytecode.Key != null)
{View on GitHub (pinned to 96fad776d2)