@@ -463,16 +463,16 @@ struct ByteAddressBuffer
463463
464464 /// Load a value with type `T` from the buffer at the specified location with a known alignment.
465465 ///@param T The type of the value to load from the buffer.
466- ///@param location The input address in bytes, which must be a multiple of 4 .
467- ///@param alignment The known alignment of `location`, which must be a multiple of 4 and compatible with `T` .
466+ ///@param location The input address in bytes, which must be a multiple of `alignment` .
467+ ///@param alignment The known alignment of `location` in bytes; a compile-time constant .
468468 ///@return The value loaded from the buffer.
469469 ///@remarks
470470 /// On HLSL, `alignment` is informational only and does not affect the emitted intrinsic.
471471 /// On other targets, `alignment` is forwarded to the lowered load instruction.
472472 [__readNone]
473473 [ForceInline]
474474 [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl_llvm, byteaddressbuffer)]
475- T LoadAligned<T>(uint location, uint alignment)
475+ T LoadAligned<T>(uint location, constexpr uint alignment)
476476 {
477477 return __byteAddressBufferLoad<T>(this, location, alignment);
478478 }
@@ -5894,23 +5894,23 @@ uint64_t __asuint64(uint2 i)
58945894
58955895__intrinsic_op($(kIROp_ByteAddressBufferLoad))
58965896[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl_llvm, byteaddressbuffer)]
5897- T __byteAddressBufferLoad<T>(ByteAddressBuffer buffer, uint offset, uint alignment);
5897+ T __byteAddressBufferLoad<T>(ByteAddressBuffer buffer, uint offset, constexpr uint alignment);
58985898
58995899__intrinsic_op($(kIROp_ByteAddressBufferLoad))
59005900[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl_llvm, byteaddressbuffer_rw)]
5901- T __byteAddressBufferLoad<T>(RWByteAddressBuffer buffer, uint offset, uint alignment);
5901+ T __byteAddressBufferLoad<T>(RWByteAddressBuffer buffer, uint offset, constexpr uint alignment);
59025902
59035903__intrinsic_op($(kIROp_ByteAddressBufferLoad))
59045904[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl_llvm, byteaddressbuffer_rw)]
5905- T __byteAddressBufferLoad<T>(RasterizerOrderedByteAddressBuffer buffer, uint offset, uint alignment);
5905+ T __byteAddressBufferLoad<T>(RasterizerOrderedByteAddressBuffer buffer, uint offset, constexpr uint alignment);
59065906
59075907__intrinsic_op($(kIROp_ByteAddressBufferStore))
59085908[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl_llvm, byteaddressbuffer_rw)]
5909- void __byteAddressBufferStore<T>(RWByteAddressBuffer buffer, uint offset, uint alignment, T value);
5909+ void __byteAddressBufferStore<T>(RWByteAddressBuffer buffer, uint offset, constexpr uint alignment, T value);
59105910
59115911__intrinsic_op($(kIROp_ByteAddressBufferStore))
59125912[require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl_llvm, byteaddressbuffer_rw)]
5913- void __byteAddressBufferStore<T>(RasterizerOrderedByteAddressBuffer buffer, uint offset, uint alignment, T value);
5913+ void __byteAddressBufferStore<T>(RasterizerOrderedByteAddressBuffer buffer, uint offset, constexpr uint alignment, T value);
59145914
59155915__intrinsic_op($(kIROp_GetUntypedBufferPtr))
59165916[require(cpp_cuda, byteaddressbuffer)]
@@ -6442,16 +6442,16 @@ struct $(item.name)
64426442
64436443 /// Load a value with type `T` from the buffer at the specified location with a known alignment.
64446444 ///@param T The type of the value to load from the buffer.
6445- ///@param location The input address in bytes, which must be a multiple of 4 .
6446- ///@param alignment The known alignment of `location`, which must be a multiple of 4 and compatible with `T` .
6445+ ///@param location The input address in bytes, which must be a multiple of `alignment` .
6446+ ///@param alignment The known alignment of `location` in bytes; a compile-time constant .
64476447 ///@return The value loaded from the buffer.
64486448 ///@remarks
64496449 /// On HLSL, `alignment` is informational only and does not affect the emitted intrinsic.
64506450 /// On other targets, `alignment` is forwarded to the lowered load instruction.
64516451 [__NoSideEffect]
64526452 [ForceInline]
64536453 [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl_llvm, byteaddressbuffer_rw)]
6454- T LoadAligned<T>(uint location, uint alignment)
6454+ T LoadAligned<T>(uint location, constexpr uint alignment)
64556455 {
64566456 return __byteAddressBufferLoad<T>(this, location, alignment);
64576457 }
71427142
71437143 [__unsafeForceInlineEarly]
71447144 [require(cpp_cuda_glsl_hlsl_metal_spirv_wgsl_llvm)]
7145- void Store<T>(uint address, T value, uint alignment)
7145+ void Store<T>(uint address, T value, constexpr uint alignment)
71467146 {
71477147 __byteAddressBufferStore(this, address, alignment, value);
71487148 }
0 commit comments