• Slang Standard Library Reference
    • Interfaces
    • Types
      • Buffer types
        • AppendStructuredBuffer
        • ByteAddressBuffer
        • ConsumeStructuredBuffer
        • RWByteAddressBuffer
        • RWStructuredBuffer
        • RasterizerOrderedByteAddressBuffer
        • RasterizerOrderedStructuredBuffer
        • StructuredBuffer
          • GetDimensions
          • Handle
          • Load
          • descriptorAccess
          • getCount
          • init
          • kind
          • subscript
      • Math types
      • Miscelaneous types
      • Ray-tracing
      • Sampler types
      • Scalar types
      • Stage IO types
      • Texture types
      • Array
      • Atomic
      • AtomicAdd
      • ConstantBuffer
      • CoopMat
      • CoopMatMatrixLayout
      • CoopMatMatrixOperands
      • CoopMatMatrixUse
      • CoopMatScope
      • CoopVec
      • CoopVecComponentType
      • CoopVecMatrixLayout
      • DescriptorAccess
      • DescriptorHandle
      • DescriptorKind
      • DiffTensorView
      • DifferentialPair
      • DifferentialPtrPair
      • DispatchNodeInputRecord
      • NodePayloadPtr
      • NullDifferential
      • Optional
      • ParameterBlock
      • Ptr
      • String
      • TensorView
      • TorchTensor
      • Tuple
      • _AttributeTargets
      • int8_t4_packed
      • uint8_t4_packed
    • Attributes
    • Global Declarations

struct StructuredBuffer<T, L>

Conditionally conforms to: __IDynamicResourceCastable<__DynamicResourceKind.General>, IArray<T>

Description

Represents an opaque handle to a read-only structured buffer allocated in global memory. A structured buffer can be viewed as an array of the specified element type.

Generic Parameters

T

The element type of the buffer.

L: IBufferDataLayout = DefaultDataLayout

The memory layout of the buffer.

Fields

descriptorAccess : DescriptorAccess = DescriptorAccess.Read

kind : DescriptorKind = DescriptorKind.Buffer

Methods

Conditional Conformances

Conformance to __IDynamicResourceCastable<__DynamicResourceKind.General>

StructuredBuffer<T, L> additionally conforms to \_\_IDynamicResourceCastable\<\_\_DynamicResourceKind\.General\> when the following conditions are met:

The L generic parameter is used to specify the memory layout of the buffer when generating SPIRV. L must be one of DefaultDataLayout, Std140DataLayout, Std430DataLayout or ScalarDataLayout. The default value is DefaultDataLayout. When generating code for other targets, this parameter is ignored and has no effect on the generated code.

See also

RWStructuredBuffer, AppendStructuredBuffer, ConsumeStructuredBuffer, RasterizerOrderedStructuredBuffer. *