{"record":{"id":"a1e18b74c5db30fa","repo":"stride3d/stride","slug":"unsupported-execution-model-entrypoint-executionmodel","errorCode":null,"errorMessage":"Unsupported execution model: {entryPoint.ExecutionModel}","messagePattern":"Unsupported execution model: (.+?)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Compilers/EffectCompiler.cs","lineNumber":272,"sourceCode":"                        throw;\n                    }\n                    var translator = new SpirvTranslator(legalizedSpirv.AsMemory());\n                    var translatorEntryPoints = translator.GetEntryPoints();\n                    foreach (var entryPoint in translatorEntryPoints)\n                    {\n                        var code = translator.Translate(Backend.Hlsl, entryPoint);\n\n                        // Compile\n                        // TODO: We could compile stages in different threads to improve compiler throughput?\n                        var shaderStage = entryPoint.ExecutionModel switch\n                        {\n                            ExecutionModel.Vertex => ShaderStage.Vertex,\n                            ExecutionModel.TessellationControl => ShaderStage.Hull,\n                            ExecutionModel.TessellationEvaluation => ShaderStage.Domain,\n                            ExecutionModel.Geometry => ShaderStage.Geometry,\n                            ExecutionModel.Fragment => ShaderStage.Pixel,\n                            ExecutionModel.GLCompute => ShaderStage.Compute,\n                            _ => throw new NotSupportedException($\"Unsupported execution model: {entryPoint.ExecutionModel}\"),\n                        };\n\n#if STRIDE_PLATFORM_DESKTOP\n                        var stageSuffix = shaderStage switch\n                        {\n                            ShaderStage.Vertex => \"vs\",\n                            ShaderStage.Hull => \"hs\",\n                            ShaderStage.Domain => \"ds\",\n                            ShaderStage.Geometry => \"gs\",\n                            ShaderStage.Pixel => \"ps\",\n                            ShaderStage.Compute => \"cs\",\n                            _ => throw new NotSupportedException($\"Unsupported shader stage: {shaderStage}\"),\n                        };\n                        stageHlslSources.Add((stageSuffix, code));\n                        string? stageFilename = null;\n#else\n                        string? stageFilename = null;\n#endif","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Compilers/EffectCompiler.cs#L254-L290","documentation":"EffectCompiler translates SPIR-V entry-point execution models to Stride ShaderStage values via a switch. Models for vertex, tessellation control/evaluation, geometry, fragment and compute are mapped; any other execution model hits the default arm and throws NotSupportedException. Stride's effect pipeline simply does not support that SPIR-V stage.","triggerScenarios":"EffectCompiler.Compile processes a SPIR-V module whose OpEntryPoint uses an execution model outside {Vertex, TessellationControl, TessellationEvaluation, Geometry, Fragment, GLCompute} — e.g. RayGeneration, Intersection, AnyHit, ClosestHit, Miss, Callable, Mesh, Task — passed through ShaderSource/bytecode entry points.","commonSituations":"Feeding ray-tracing or mesh-shader SPIR-V into the classic effect compiler; a shader library exporting an auxiliary compute-like entry point with an exotic model; a newer Vulkan/GLSL toolchain emitting Mesh/Task shaders consumed by Stride's D3D-oriented pipeline.","solutions":["Restrict the shader to execution models Stride supports (vertex, tessellation, geometry, fragment, compute).","Split the SPIR-V module so only supported entry points are compiled, and handle ray/mesh stages through a dedicated pipeline outside EffectCompiler.","Remove unsupported entry points from the module (e.g. dead exports from glslang) before compilation.","Recompile the GLSL/HLSL source targeting only supported stages (no VK_KHR_ray_tracing / mesh shader extensions)."],"exampleFix":"// before\n#pragma shader_stage(raygeneration) // ExecutionModel.RayGeneration\nvoid main() { ... }\n\n// after: unsupported model removed; keep only e.g.\n#pragma shader_stage(compute)\n[numthreads(8,8,1)]\nvoid main() { ... }","handlingStrategy":"validation","validationCode":"// reject unsupported SPIR-V execution models before invoking EffectCompiler\nvar supportedModels = new HashSet<SpirvExecutionModel> { ExecutionModel.Vertex, ExecutionModel.TessellationControl, ExecutionModel.TessellationEvaluation, ExecutionModel.Geometry, ExecutionModel.Fragment, ExecutionModel.GLCompute };\nforeach (var ep in spirvModule.EntryPoints)\n    if (!supportedModels.Contains(ep.ExecutionModel))\n        throw new InvalidOperationException($\"Entry point '{ep.Name}' uses execution model {ep.ExecutionModel}, unsupported by Stride's effect compiler.\");","typeGuard":"static bool IsSupportedExecutionModel(ExecutionModel model) =>\n    model is ExecutionModel.Vertex or ExecutionModel.TessellationControl\n        or ExecutionModel.TessellationEvaluation or ExecutionModel.Geometry\n        or ExecutionModel.Fragment or ExecutionModel.GLCompute;","tryCatchPattern":"try\n{\n    var effect = effectCompiler.Compile(effectSource, parameters);\n}\ncatch (NotSupportedException ex) when (ex.Message.StartsWith(\"Unsupported execution model\"))\n{\n    log.Error($\"SPIR-V stage not supported: {ex.Message}. Use vertex/tessellation/geometry/fragment/compute stages only.\");\n    throw;\n}","preventionTips":["Compile only classic rasterization/compute stages; route ray-tracing and mesh shaders through dedicated pipelines.","Strip dead/auxiliary entry points from SPIR-V modules before feeding them to the effect compiler.","Avoid Vulkan-only extensions (ray tracing, mesh shading) in shaders compiled by Stride's pipeline.","Keep shader sources targeting GLSL/HLSL profiles Stride supports."],"tags":["shaders","spirv","compilation","unsupported-stage","graphics"],"backgroundTag":"unsupported-enum-value","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}