{"record":{"id":"dbaf5a4eed7e1377","repo":"stride3d/stride","slug":"expecting-texture-input-on-slot-0","errorCode":null,"errorMessage":"Expecting texture input on slot [{0}]","messagePattern":"Expecting texture input on slot \\[(.+?)\\]","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Images/ImageEffect.cs","lineNumber":352,"sourceCode":"            if (index < 0 || index > maxInputTextureIndex)\n            {\n                throw new ArgumentOutOfRangeException(\"index\", string.Format(\"Invald texture input index [{0}]. Max value is [{1}]\", index, maxInputTextureIndex));\n            }\n            return inputTextures[index];\n        }\n\n        /// <summary>\n        /// Gets a non-null input texture by the specified index.\n        /// </summary>\n        /// <param name=\"index\">The index.</param>\n        /// <returns>Texture.</returns>\n        /// <exception cref=\"System.InvalidOperationException\"></exception>\n        protected Texture GetSafeInput(int index)\n        {\n            var input = GetInput(index);\n            if (input == null)\n            {\n                throw new InvalidOperationException(string.Format(\"Expecting texture input on slot [{0}]\", index));\n            }\n\n            return input;\n        }\n\n        /// <summary>\n        /// Gets the output depth stencil texture.\n        /// </summary>\n        /// <value>\n        /// The depth stencil output.\n        /// </value>\n        protected Texture DepthStencil => outputDepthStencilView;\n\n        /// <summary>\n        /// Gets a value indicating whether this effect has depth stencil output texture binded.\n        /// </summary>\n        /// <value>\n        ///   <c>true</c> if this instance has depth stencil output; otherwise, <c>false</c>.","sourceCodeStart":334,"sourceCodeEnd":370,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Images/ImageEffect.cs#L334-L370","documentation":"GetSafeInput is the non-null variant of GetInput: after fetching the texture at the slot it throws InvalidOperationException when that slot was never assigned a texture. This catches logical errors where a draw pass assumes an input that upstream effects never produced.","triggerScenarios":"Calling effect.GetSafeInput(index) where the slot is in range but inputTextures[index] is null — e.g. an upstream image effect never ran or never called SetInput for that slot.","commonSituations":"Forgetting to call SetInput for one slot in a multi-input pipeline; disabling an upstream effect during debugging; order-of-draw mistakes where the source effect runs after the consumer.","solutions":["Call SetInput(index, texture) for every slot consumed before Draw","Reorder effects so producers run before consumers","Use GetInput (nullable) where a missing input is legitimate"],"exampleFix":"// before\nvar src = effect.GetSafeInput(1); // slot 1 never set\n// after\neffect.SetInput(1, previousEffectOutput);\nvar src = effect.GetSafeInput(1);","handlingStrategy":"validation","validationCode":"if (index >= 0 && index <= effect.MaxInputTextureIndex && effect.GetInput(index) == null) { /* slot missing; run producer or bind */ }","typeGuard":"bool HasInput(ImageEffect e, int i) => i >= 0 && i <= e.MaxInputTextureIndex && e.GetInput(i) != null;","tryCatchPattern":"try { var tex = effect.GetSafeInput(index); } catch (InvalidOperationException) { /* bind input or skip pass */ }","preventionTips":["Call SetInput for every consumed slot each frame","Keep an effect pipeline graph so producers are ordered before consumers","Check GetInput for null when a slot may be legitimately empty"],"tags":["invalid-state","null-check","rendering"],"backgroundTag":"invalid-state-transition","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"}