stride3d/stride · error · NotSupportedException
Only render targets are supported as output
Error message
Only render targets are supported as output
What it means
RadiancePrefilteringGGXNoCompute renders into PrefilteredRadiance using raster passes, so the output must have been created with TextureFlags.RenderTarget (IsRenderTarget). Otherwise DrawCore throws NotSupportedException.
Solutions
- Recreate the texture with TextureFlags.RenderTarget included.
- Or switch to the compute-based RadiancePrefilteringGGX effect which does not need a render target.
- Verify output.IsRenderTarget before drawing.
Example fix
// before var tex = Texture.New2D(device, 256, 256, PixelFormat.R16G16B16A16_Float, TextureFlags.ShaderResource, 6, 0); // after var tex = Texture.New2D(device, 256, 256, PixelFormat.R16G16B16A16_Float, TextureFlags.ShaderResource | TextureFlags.RenderTarget, 6, 0);
Defensive patterns
Strategy: validation
Validate before calling
if (output != null && !output.IsRenderTarget) throw new ArgumentException("PrefilteredRadiance must be created with TextureFlags.RenderTarget"); Type guard
bool IsRenderTarget(Texture t) => t != null && t.IsRenderTarget;
Try / catch
try { prefilter.Draw(context); } catch (NotSupportedException ex) { log.Error(ex, "Recreate PrefilteredRadiance with TextureFlags.RenderTarget"); } Prevention
- Include TextureFlags.RenderTarget in every texture used as a draw output.
- Centralize IBL texture creation in one helper with correct flags.
- Unit-test texture descriptors in headless mode before rendering.
When it happens
Trigger: Passing a texture created only with ShaderResource/unordered-access flags as PrefilteredRadiance, e.g. a staging or compute-only texture.
Common situations: Creating the prefiltered mip chain with TextureFlags.ShaderResource only for compute-based workflows, then feeding it to the NoCompute (raster) variant.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Only array of 2D textures are currently supported as output
- Only cubemaps are currently supported as input
- Input and output texture cannot have same size
- Support only output scaling to the same direction
- Changing the panel from a user library type is currently…
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/a65231db93c72572.
Report an issue: GitHub.
Appendix: source
Thrown at sources/engine/Stride.Rendering/Rendering/ComputeEffect/GGXPrefiltering/RadiancePrefilteringGGXNoCompute.cs:82
{
if (value > 1024)
throw new ArgumentOutOfRangeException(nameof(value));
if (!MathUtil.IsPow2(value))
throw new ArgumentException("The provided value should be a power of 2");
samplingsCount = Math.Max(1, value);
}
}
protected override void DrawCore(RenderDrawContext context)
{
var output = PrefilteredRadiance;
if (output == null || (output.ViewDimension != TextureDimension.Texture2D && output.ViewDimension != TextureDimension.TextureCube) || output.ArraySize != 6)
throw new NotSupportedException("Only array of 2D textures are currently supported as output");
if (!output.IsRenderTarget)
throw new NotSupportedException("Only render targets are supported as output");
var input = RadianceMap;
if (input == null || input.ViewDimension != TextureDimension.TextureCube)
throw new NotSupportedException("Only cubemaps are currently supported as input");
var roughness = 0f;
var faceCount = output.ArraySize;
var levelSize = new Int2(output.Width, output.Height);
var mipCount = MipmapGenerationCount == 0 ? output.MipLevelCount : MipmapGenerationCount;
for (int mipLevel = 0; mipLevel < mipCount; mipLevel++)
{
for (int faceIndex = 0; faceIndex < faceCount; faceIndex++)
{
using var outputView = output.ToTextureView(ViewType.Single, faceIndex, mipLevel);
var inputLevel = MathUtil.Log2(input.Width / output.Width);
if (mipLevel == 0 && DoNotFilterHighestLevel)
{View on GitHub (pinned to 96fad776d2)