{"record":{"id":"c4a7b4b381f0a974","repo":"stride3d/stride","slug":"output-texture-format-0-is-not-matching-other-output-texture","errorCode":null,"errorMessage":"Output texture format [{0}] is not matching other output texture format [{1}]","messagePattern":"Output texture format \\[(.+?)\\] is not matching other output texture format \\[(.+?)\\]","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Images/ImageScaler/ImageMultiScaler.cs","lineNumber":125,"sourceCode":"            // Query all ouptut\n            outputTextures.Clear();\n\n            outputPixelFormat = PixelFormat.None;\n            scalingDirection = 0;\n\n            var maxSize = new Size3(1 << 15, 1 << 15, 1 << 15);\n            var minSize = Size3.One;\n\n            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))","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Images/ImageScaler/ImageMultiScaler.cs#L107-L143","documentation":"ImageMultiScaler.PrepareScaling (invoked from DrawCore) supports multiple output textures but requires all of them to share the same pixel format. When iterating outputs, if a texture's ViewFormat differs from the format established by a previous output, it throws InvalidOperationException. The scaler builds one shared scaling pipeline, so mixed formats would render incorrectly.","triggerScenarios":"Adding two or more outputs to an ImageMultiScaler whose ViewFormats differ (e.g. one output is Rgba8 and another is Bgra8 or R11G11B10Float), then rendering a frame that triggers DrawCore.","commonSituations":"Wiring multiple render targets/swap-chain backbuffers with different formats into one multi-scaler; an engine/asset format change (e.g. HDR pipeline switching to half-float) leaving one output on the old format.","solutions":["Make every output texture connected to the ImageMultiScaler use the same PixelFormat/ViewFormat.","Check the error text: the first formatted value is the offending texture's format, the second is the established format; change the mismatched one.","If outputs genuinely need different formats, use separate ImageScaler instances instead of one ImageMultiScaler."],"exampleFix":"// before\nscaler.SetOutput(0, rtRgba8);   // Rgba8\nscaler.SetOutput(1, rtBgra8);   // Bgra8 -> throws\n// after\nscaler.SetOutput(0, rtRgba8);\nscaler.SetOutput(1, rtRgba8b);  // same format","handlingStrategy":"validation","validationCode":"var formats = outputs.Select(o => o.ViewFormat).Distinct().ToList();\nif (formats.Count > 1) throw new InvalidOperationException($\"All ImageMultiScaler outputs must share one format, got: {string.Join(\", \", formats)}\");","typeGuard":null,"tryCatchPattern":"try { scaler.Draw(context); }\ncatch (InvalidOperationException) { Log.Warning(\"ImageMultiScaler output formats mismatch — skipping pass\"); }","preventionTips":["Allocate all multi-scaler output render targets from the same PixelFormat constant in one helper.","When changing global surface format (HDR/LDR switch), update every scaler output.","Write an editor/startup assertion that all wired outputs share one ViewFormat."],"tags":["format-mismatch","rendering","stride","texture"],"backgroundTag":"type-mismatch","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}