Vixen
02b45cc4
csharp
public sealed class BufferTypeSymbol

A storage buffer: Buffer<T> read-only, RWBuffer<T> read-write.

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

Remarks

Written with angle brackets but not a generic type. It is a structural type the binder constructs directly, the same treatment ArrayTypeSymbol gets for T[4]. That is why it needs no monomorphisation even now that Raven has some: there is no declaration to instantiate and no body to substitute through.

One buffer concept, not HLSL's several. A typed (texel) buffer is a different descriptor with no advantage on either target Raven emits for, and ByteAddressBuffer trades the element type — the thing that makes an offset checkable — for manual byte arithmetic. So a buffer has an element type, and the element type is the contract.

Read-only versus read-write is one bit rather than two descriptor types, because in Vulkan both are VK_DESCRIPTOR_TYPE_STORAGE_BUFFER. The difference is an access decoration — NonWritable in SPIR-V, readonly in GLSL — which is worth declaring: a driver can hoist loads out of a loop from a read-only buffer and cannot from a writable one.

Fields and properties (10)

  • public const string ReadOnlyName

    The source name of the read-only form.

  • public const string ReadWriteName

    The source name of the read-write form.

  • public TypeSymbol ElementType
  • public bool IsWritable

    Whether an element may be assigned to.

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

Methods (6)

  • public BufferTypeSymbol(TypeSymbol elementType, bool isWritable)
  • public override IReadOnlyList<Symbol> GetMembers()

    A buffer exposes Length; indexing is handled by the binder.

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

Used by (6)

  • BinderVixen.Raven
  • BuilderVixen.Raven
  • LowererVixen.Raven
  • MetadataLoaderVixen.Raven
  • MonomorphiserVixen.Raven
  • WritableResourceTestsVixen.Raven.Tests