{"record":{"id":"57ab175fae032048","repo":"stride3d/stride","slug":"platform-platform-is-not-supported-by-texturetool","errorCode":null,"errorMessage":"Platform {platform} is not supported by TextureTool","messagePattern":"Platform (.+?) is not supported by TextureTool","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/Textures/TextureHelper.cs","lineNumber":311,"sourceCode":"                                            outputFormat = PixelFormat.BC4_UNorm;\n                                        }\n                                        else if (inputImageFormat.IsHDR)\n                                        {\n                                            // TODO BC6H for HDR (modern GPU/ISPC encoders make encode time tractable; profile ≥11.0, AlphaFormat.None).\n                                            outputFormat = inputImageFormat;\n                                        }\n                                        // TODO BC7 for Quality=High color / UI (modern GPU/ISPC encoders make encode time tractable).\n                                    }\n                                    break;\n                                default:\n                                    // Null platform\n                                    outputFormat = parameters.IsSRgb ? PixelFormat.R8G8B8A8_UNorm_SRgb : PixelFormat.R8G8B8A8_UNorm;\n                                    break;\n                            }\n                            break;\n\n                        default:\n                            throw new NotSupportedException(\"Platform \" + parameters.Platform + \" is not supported by TextureTool\");\n                    }\n                    break;\n                case false:\n                    outputFormat = inputImageFormat;\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException();\n            }\n\n            return outputFormat;\n        }\n\n        public static ResultStatus ImportTextureImageRaw(TextureTool textureTool, TexImage texImage, ImportParameters parameters, CancellationToken cancellationToken, Logger logger)\n        {\n            // Apply transformations\n            textureTool.Decompress(texImage, parameters.IsSRgb);\n\n            // Special case when the input texture is monochromatic but it is supposed to be a color and we are working in SRGB","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/Textures/TextureHelper.cs#L293-L329","documentation":"TextureHelper.DetermineOutputFormat switches on the target GraphicsPlatform to pick a compatible compressed/uncompressed pixel format; the switch has no case for the given platform, so the default arm throws NotSupportedException. The texture pipeline cannot produce an output format for an unknown platform.","triggerScenarios":"Importing/compiling a texture asset whose Parameters.Platform is a GraphicsPlatform value not handled by the switch (e.g. Null platform, or a platform added in a newer Stride than the tool).","commonSituations":"Building with a customized/patched build pipeline that sets an unexpected platform; running the texture toolchain headless where platform defaults to Null; platform enum extended without updating TextureHelper.","solutions":["Set the target platform on the texture import/compile parameters to a supported one (Windows/Linux/Android/iOS, etc.).","Check how the build pipeline derives Parameters.Platform; ensure it maps from the solution's target platform.","If targeting a new platform, add a case to the format switch in TextureHelper (or upgrade Stride to a version that supports it)."],"exampleFix":"// before\nparameters.Platform = GraphicsPlatform.Null;\n// after\nparameters.Platform = GraphicsPlatform.Direct3D11; // or Vulkan/Metal per target","handlingStrategy":"validation","validationCode":"var supported = new[] { GraphicsPlatform.Direct3D11, GraphicsPlatform.Vulkan, GraphicsPlatform.Metal, GraphicsPlatform.OpenGL };\nif (!supported.Contains(parameters.Platform))\n    throw new NotSupportedException($\"TextureTool cannot process platform {parameters.Platform}\");","typeGuard":"bool IsTextureToolPlatform(GraphicsPlatform p) =>\n    p is GraphicsPlatform.Direct3D11 or GraphicsPlatform.Vulkan or GraphicsPlatform.Metal or GraphicsPlatform.OpenGL;","tryCatchPattern":"try\n{\n    var fmt = TextureHelper.DetermineOutputFormat(parameters, logger, quality, ...);\n}\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"TextureTool\"))\n{\n    logger.Error($\"Fix Parameters.Platform: {ex.Message}\");\n}","preventionTips":["Set texture compile parameters' Platform from the actual build target, never leave it default","Map solution platforms to GraphicsPlatform explicitly in build scripts","Upgrade Stride together with any new platform targets"],"tags":["textures","platform","asset-pipeline"],"backgroundTag":"unsupported-platform","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"}