{"record":{"id":"5e415a3bb0284b71","repo":"stride3d/stride","slug":"only-non-rendertarget-unordered-access-textures-are","errorCode":null,"errorMessage":"Only non-rendertarget unordered access textures are supported as output","messagePattern":"Only non-rendertarget unordered access textures are supported as output","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Rendering/Rendering/ComputeEffect/GGXPrefiltering/RadiancePrefilteringGGX.cs","lineNumber":79,"sourceCode":"            {\n                if (value > 1024)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                if (!MathUtil.IsPow2(value))\n                    throw new ArgumentException(\"The provided value should be a power of 2\");\n\n                samplingsCount = Math.Max(1, value);\n            }\n        }\n\n        protected override void DrawCore(RenderDrawContext context)\n        {\n            var output = PrefilteredRadiance;\n            if (output == null || (output.ViewDimension != TextureDimension.Texture2D && output.ViewDimension != TextureDimension.TextureCube) || output.ArraySize != 6)\n                throw new NotSupportedException(\"Only array of 2D textures are currently supported as output\");\n\n            if (!output.IsUnorderedAccess || output.IsRenderTarget)\n                throw new NotSupportedException(\"Only non-rendertarget unordered access textures are supported as output\");\n\n            var input = RadianceMap;\n            if (input == null || input.Dimension != TextureDimension.TextureCube)\n                throw new NotSupportedException(\"Only cubemaps are currently supported as input\");\n\n            var roughness = 0f;\n            var faceCount = output.ArraySize;\n            var levelSize = new Int2(output.Width, output.Height);\n            var mipCount = MipmapGenerationCount == 0 ? output.MipLevelCount : MipmapGenerationCount;\n\n            for (int l = 0; l < mipCount; l++)\n            {\n                if (l == 0 && DoNotFilterHighestLevel && input.Width >= output.Width)\n                {\n                    var inputLevel = MathUtil.Log2(input.Width / output.Width);\n                    for (int f = 0; f < 6; f++)\n                    {\n                        var inputSubresource = inputLevel + f * input.MipLevelCount;","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Rendering/Rendering/ComputeEffect/GGXPrefiltering/RadiancePrefilteringGGX.cs#L61-L97","documentation":"RadiancePrefilteringGGX.DrawCore throws NotSupportedException when the PrefilteredRadiance texture is not bindable as an unordered access view (IsUnorderedAccess false) or is a render target (IsRenderTarget true). The prefilter runs a compute shader that writes directly into the output mips, which requires UAV binding; render-target textures are rejected.","triggerScenarios":"Creating the output texture with only TextureFlags.ShaderResource (no UnorderedAccess), or with flags that make it a render target, then running the prefilter.","commonSituations":"Reusing a backbuffer/render-target texture as the prefiltered output; forgetting the UnorderedAccess flag when creating the target; graphics device/feature level that restricts simultaneous UAV use.","solutions":["Create the output texture with TextureFlags.UnorderedAccess and without RenderTarget.","Recreate the texture: flags = TextureFlags.ShaderResource | TextureFlags.UnorderedAccess.","Verify no code path enables RenderTarget on the prefiltered radiance texture."],"exampleFix":"// before\nvar output = Texture.New2D(device, 256, 256, fmt, TextureFlags.RenderTarget | TextureFlags.ShaderResource);\n// after\nvar output = Texture.New2D(device, 256, 256, fmt, TextureFlags.UnorderedAccess | TextureFlags.ShaderResource, arraySize: 6);","handlingStrategy":"validation","validationCode":"if (!output.IsUnorderedAccess || output.IsRenderTarget)\n    throw new InvalidOperationException(\"PrefilteredRadiance must be a non-rendertarget UAV texture\");","typeGuard":"bool IsUsableUav(Texture t) => t != null && t.IsUnorderedAccess && !t.IsRenderTarget;","tryCatchPattern":"try { prefilter.Render(context); }\ncatch (NotSupportedException ex) { Log.Error(\"Prefilter output must be a UAV texture and not a render target.\", ex); }","preventionTips":["Always pass TextureFlags.UnorderedAccess (never RenderTarget) when creating the prefilter output.","Don't reuse backbuffer or render-target textures as compute outputs.","Check texture flags in the IBL setup step rather than at render time."],"tags":["rendering","compute-shader","uav","unsupported","stride"],"backgroundTag":"unsupported-operation","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"}