{"record":{"id":"565eb11451343308","repo":"stride3d/stride","slug":"unsupported-format-0-must-be-not-none-compressed-packed-or","errorCode":null,"errorMessage":"Unsupported format [{0}] (must be not none, compressed, packed or typeless)","messagePattern":"Unsupported format \\[(.+?)\\] \\(must be not none, compressed, packed or typeless\\)","errorType":"validation","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/Images/LuminanceEffect/LuminanceEffect.cs","lineNumber":68,"sourceCode":"            // Readback is always going to be done on the 1x1 texture\n            readback = ToLoadAndUnload(readback);\n\n            // Blur used before upscaling\n            blur = ToLoadAndUnload(new GaussianBlur());\n            blur.Radius = 4;\n        }\n\n        /// <summary>\n        /// Luminance texture format.\n        /// </summary>\n        public PixelFormat LuminanceFormat\n        {\n            get => luminanceFormat;\n            set\n            {\n                if (value.IsCompressed || value.IsPacked || value.IsTypeless || value == PixelFormat.None)\n                {\n                    throw new ArgumentOutOfRangeException(nameof(value), \"Unsupported format [{0}] (must be not none, compressed, packed or typeless)\".ToFormat(value));\n                }\n                luminanceFormat = value;\n            }\n        }\n\n        /// <summary>\n        /// Luminance log effect.\n        /// </summary>\n        public ImageEffectShader LuminanceLogEffect { get; set; }\n\n        /// <summary>\n        /// Gets or sets down scale count used to downscale the input intermediate texture used for local luminance (if no\n        /// output is given). By default 1/64 of the input texture size.\n        /// </summary>\n        /// <value>Down scale count.</value>\n        public int DownscaleCount { get; set; }\n\n        /// <summary>","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/Images/LuminanceEffect/LuminanceEffect.cs#L50-L86","documentation":"The LuminanceFormat property of LuminanceEffect rejects pixel formats that are compressed, packed, typeless, or PixelFormat.None, because the effect renders to and samples this format directly on the GPU. Any such value throws ArgumentOutOfRangeException with the formatted message.","triggerScenarios":"Assigning e.g. PixelFormat.None, a block-compressed format like BC1/BC7, a packed format like R11G11B10 or typeless variants to LuminanceEffect.LuminanceFormat.","commonSituations":"Reusing a render-target format constant from elsewhere in the pipeline that happens to be compressed, or leaving the format as None when wiring up a custom tone-mapping chain.","solutions":["Assign a plain color format such as PixelFormat.R16_Float or R32_Float","Guard the assignment with checks on IsCompressed/IsPacked/IsTypeless/None","Keep the default LuminanceFormat unless a specific HDR format is required"],"exampleFix":"// before\nluminanceEffect.LuminanceFormat = PixelFormat.None;\n// after\nluminanceEffect.LuminanceFormat = PixelFormat.R16_Float;","handlingStrategy":"validation","validationCode":"bool IsValidLuminanceFormat(PixelFormat f) =>\n    f != PixelFormat.None && !f.IsCompressed() && !f.IsPacked() && !f.IsTypeless();","typeGuard":null,"tryCatchPattern":"try { effect.LuminanceFormat = format; }\ncatch (ArgumentOutOfRangeException) { effect.LuminanceFormat = PixelFormat.R16_Float; }","preventionTips":["Use known-good HDR formats (R16_Float, R32_Float, R11G11B10)","Never assign formats taken from compressed texture assets","Validate formats in pipeline configuration code"],"tags":["csharp","rendering","argument-out-of-range"],"backgroundTag":"invalid-argument-value","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"}