Vixen
02b45cc4
csharp
public sealed class StorageImageTypeSymbol

A storage image: RWTexture2D<float4>, RWTexture3D<float4> — a texture a shader stores into.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Written with angle brackets and, like BufferTypeSymbol, not a generic type: the binder constructs it structurally, so there is no declaration to instantiate and no body to substitute through.

The element is always a four-lane vector, because that is what both targets do: imageLoad and OpImageRead hand back four components whatever the format stores, so an r32f image reads as (r, 0, 0, 1). Narrowing the declared type to the format's channel count would be a shape neither target has.

Only the read-write form exists. A texture a shader merely reads is a Texture2D — a sampled image, which filters and mips and is what a read almost always wants. A storage image that is never written buys nothing over that, so there is no Texture2DStorage to choose wrongly between.

Not sampled, and that is the part that surprises: a storage image has no sampler, no filtering and no mip chain. Reads are by integer texel, exactly like Load on a texture, which is why the members below are Load/Store rather than Sample.

Fields and properties (12)

  • public const string Texture2DName

    The source name of the two-dimensional form.

  • public const string Texture3DName

    The source name of the three-dimensional form.

  • public PrimitiveTypeSymbol ElementType

    What a load returns and a store takes: always a four-lane vector.

  • public bool IsVolume

    Whether the image is addressed by two coordinates or three.

  • public string? Format

    How the texels are stored, from the declaration's [Format("…")]. Null until a declaration supplies one, which RVN2123 requires it to.

  • public PrimitiveTypeSymbol CoordinateType

    The integer vector one texel is addressed by.

  • public override SymbolKind Kind
  • public override TypeKind TypeKind
  • public override ResourceKind ResourceKind
  • public override bool IsWritableResource

    Always true, but stored into through Store rather than by assignment.

  • public override string Name
  • public override Symbol? ContainingSymbol

Methods (7)

  • public StorageImageTypeSymbol(PrimitiveTypeSymbol elementType, bool isVolume)
  • public override IReadOnlyList<Symbol> GetMembers()

    Load, Store and GetDimensions, typed for this image's element and coordinate.

  • public StorageImageTypeSymbol WithFormat(string? format)

    The same image with its declared texel format attached.

  • public override string ToDisplayString()
  • public bool Equals(StorageImageTypeSymbol? other)
  • public override bool Equals(object? obj)
  • public override int GetHashCode()

Used by (6)

  • BinderVixen.Raven
  • LowererVixen.Raven
  • SourceFieldSymbolVixen.Raven
  • SourceNamedTypeSymbolVixen.Raven
  • SourceParameterSymbolVixen.Raven
  • StorageImageTestsVixen.Raven.Tests