Vixen
02b45cc4
csharp
public sealed class SampledTextureTypeSymbol

An integer-sampled texture: Texture2D<uint4> or Texture2D<int4> — a sampled image whose texels are integers rather than floats.

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

Remarks

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

This exists because the component type is part of the descriptor. A sampled image's OpTypeImage states what a read returns, and Vulkan checks it against the bound view's format: an R32_UINT view behind a float-sampled Texture2D is a validation error however the shader then bitcasts the value. The plain Texture2D stays the float-sampled texture every material reads; this is the one a shader declares when the host binds an integer view, such as a visibility buffer.

The element is a four-lane vector, not a scalar, for the reason a storage image's is: OpImageFetch and texelFetch hand back four components whatever the format stores, so an R32_UINT texel reads as (r, 0, 0, 1) and the caller takes .x. Float elements are refused rather than accepted as a second spelling of the plain Texture2D — see RVN2136.

Load and GetDimensions only. An integer texture has no filtering to do — Vulkan formats with a UINT component are not filterable — so a Sample here would be a member that cannot work on any view the type is for. No [Format] either: a sampled image's SPIR-V format is Unknown, and what the descriptor checks is the component type this symbol already states.

Fields and properties (7)

  • public const string Texture2DName

    The source name, shared with the float-sampled built-in.

  • public PrimitiveTypeSymbol ElementType

    What a load returns: a four-lane vector of int or uint.

  • public override SymbolKind Kind
  • public override TypeKind TypeKind
  • public override ResourceKind ResourceKind
  • public override string Name
  • public override Symbol? ContainingSymbol

Methods (6)

  • public SampledTextureTypeSymbol(PrimitiveTypeSymbol elementType)
  • public override IReadOnlyList<Symbol> GetMembers()

    Load and GetDimensions, with the plain Texture2D's signatures and this element's return type.

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

Used by (3)

  • BinderVixen.Raven
  • LowererVixen.Raven
  • SampledTextureTestsVixen.Raven.Tests