RWByteAddressBuffer.LoadAligned

Description

Load a value with type T from the buffer at the specified location with a known alignment.

Signature

T RWByteAddressBuffer.LoadAligned<T>(
    uint location,
    uint alignment);

T RWByteAddressBuffer.LoadAligned<T>(uint location);

Generic Parameters

T

The type of the value to load from the buffer.

Parameters

location : uint

The input address in bytes, which must be a multiple of 4.

alignment : uint

The known alignment of location, which must be a multiple of 4 and compatible with T.

Return value

The value loaded from the buffer.

Remarks

On HLSL, alignment is informational only and does not affect the emitted intrinsic. On other targets, alignment is forwarded to the lowered load instruction.

Availability and Requirements

Defined for the following targets:

hlsl

Available in all stages.

glsl

Available in all stages.

cpp

Available in all stages.

cuda

Available in all stages.

metal

Available in all stages.

wgsl

Available in all stages.

spirv

Available in all stages.

llvm

Available in all stages.