{"record":{"id":"f45ab80d8f9e2cfe","repo":"stride3d/stride","slug":"unsupported-texture-size-0-out-of-limit-1-2","errorCode":null,"errorMessage":"Unsupported texture size [{0}] out of limit [{1} - {2}]","messagePattern":"Unsupported texture size \\[(.+?)\\] out of limit \\[(.+?) - (.+?)\\]","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Images/ImageScaler/ImageMultiScaler.cs","lineNumber":134,"sourceCode":"            var inputSize = inputTexture.Size;\n            for (int i = 0; i < OutputCount; i++)\n            {\n                var outputTexture = GetOutput(i);\n                if (outputTexture != null)\n                {\n                    // Verify pixel format\n                    if (outputPixelFormat != PixelFormat.None && outputPixelFormat != outputTexture.ViewFormat)\n                    {\n                        throw new InvalidOperationException(\"Output texture format [{0}] is not matching other output texture format [{1}]\".ToFormat(outputTexture.ViewFormat, outputPixelFormat));\n                    }\n                    outputPixelFormat = outputTexture.ViewFormat;\n\n                    var outputSize = outputTexture.Size;\n\n                    // Verify pixel format\n                    if (outputSize < minSize || outputSize > maxSize)\n                    {\n                        throw new InvalidOperationException(\"Unsupported texture size [{0}] out of limit [{1} - {2}]\".ToFormat(outputTexture.Size, minSize, maxSize));\n                    }\n\n                    if (inputSize == outputSize)\n                    {\n                        throw new InvalidOperationException(\"Input and output texture cannot have same size [{0}]\".ToFormat(inputSize));\n                    }\n\n                    int newScalingDirection = outputSize.CompareTo(inputSize);\n                    if (scalingDirection != 0 && Math.Sign(scalingDirection) != Math.Sign(newScalingDirection))\n                    {\n                        throw new InvalidOperationException(\"Support only output scaling to the same direction\");\n                    }\n                    scalingDirection = newScalingDirection;\n\n                    // Check that we are scaling to different texture sizes\n                    foreach (var existingOutput in outputTextures)\n                    {\n                        if (existingOutput.Size == outputTexture.Size)","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Images/ImageScaler/ImageMultiScaler.cs#L116-L152","documentation":"ImageMultiScaler.PrepareScaling validates each output texture's Size against configured min/max limits and throws InvalidOperationException when the output size falls outside that range. The scaler's internal passes only work correctly within these dimensions.","triggerScenarios":"Rendering with an ImageMultiScaler whose output texture dimensions are smaller than MinSize or larger than MaxSize (per the scaler's configured limits), e.g. a 1x1 or an oversized render target.","commonSituations":"Dynamically resizing a render target to 0/tiny dimensions on window minimize; allocating an output larger than the supported limit for the current graphics profile.","solutions":["Clamp output texture dimensions to within MinSize/MaxSize before assigning them as scaler outputs.","Guard window-resize code so render targets are never created with degenerate sizes (e.g. minimum 1x1 or a configured floor).","Inspect the message values: [0] is the offending size, [1]-[2] the allowed range, and adjust the render target allocation accordingly."],"exampleFix":"// before\nvar output = RenderTexture(size.Width, size.Height); // size may be 0\n// after\nvar w = Math.Max(minSize, Math.Min(maxSize, size.Width));\nvar h = Math.Max(minSize, Math.Min(maxSize, size.Height));\nvar output = RenderTexture(w, h);","handlingStrategy":"validation","validationCode":"if (outSize < scaler.MinSize || outSize > scaler.MaxSize)\n    outSize = Math.Clamp(outSize, scaler.MinSize, scaler.MaxSize);","typeGuard":null,"tryCatchPattern":"try { scaler.Draw(context); }\ncatch (InvalidOperationException e) { Log.Error($\"Scaler output size unsupported: {e.Message}\"); }","preventionTips":["Clamp render target sizes on every resize event (window minimize can yield 0x0).","Query min/max limits from the scaler instead of hardcoding sizes.","Test with extreme window sizes (1x1, 4K) during development."],"tags":["texture-size","limits","rendering","stride"],"backgroundTag":"value-out-of-range","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}