@@ -61,6 +61,24 @@ __intrinsic_op($(kIROp_StructuredBufferGetDimensions))
61
61
uint2 __structuredBufferGetDimensions<T,L:IBufferDataLayout>(RasterizerOrderedStructuredBuffer<T,L> buffer);
62
62
63
63
//@public:
64
+ /**
65
+ Represents an opaque handle to an append structured buffer allocated in global memory.
66
+ A structured buffer can be viewed as an array of the specified element type.
67
+ An append structure buffer internally maintains an atomic counter to keep track of the number of elements in the buffer,
68
+ and provide an atomic operation to append a new element to the buffer.
69
+ @param T The element type of the buffer.
70
+ @param L The memory layout of the buffer.
71
+ @remarks
72
+ This type is supported natively when targeting HLSL.
73
+ When generating code for other targets, this type is translated into a pair or an ordinary `RWStructuredBuffer` and
74
+ a separate `RWStructuredBuffer` that holds the atomic counter.
75
+ The `L` generic parameter is used to specify the memory layout of the buffer when
76
+ generating SPIRV.
77
+ `L` must be one of `DefaultDataLayout`, `Std140DataLayout`, `Std430DataLayout` or `ScalarDataLayout`.
78
+ The default value is `DefaultDataLayout`.
79
+ When generating code for other targets, this parameter is ignored and has no effect on the generated code.
80
+ @see `RWStructuredBuffer`, `ConsumeStructuredBuffer`, `RasterizerOrderedStructuredBuffer`.
81
+ **/
64
82
__generic<T, L:IBufferDataLayout=DefaultDataLayout>
65
83
__magic_type(HLSLAppendStructuredBufferType)
66
84
__intrinsic_type($(kIROp_HLSLAppendStructuredBufferType))
@@ -433,6 +451,10 @@ vector<T,N+1> __makeVector(vector<T,N> vec, T scalar);
433
451
/// |39 |`"r8ui"` | 1 channel 8-bit unsigned integer texture |
434
452
/// |40 |`"r64ui"` | 1 channel 64-bit unsigned integer texture |
435
453
/// |41 |`"r64i"` | 1 channel 64-bit signed integer texture |
454
+ ///
455
+ /// When targeting Vulkan, a combined-texture-sampler type (`isCombined==1`) translates to a `OpTypeSampledImage` type in SPIR-V.
456
+ /// For other targets, the combined-texture-sampler type is translated to a pair of a `Texture` and `SamplerState`.
457
+ /// `isShadow` is only applicable to combined-texture-sampler types and must be `0` for non-combined texture types.
436
458
/// @internal
437
459
__magic_type(TextureType)
438
460
__intrinsic_type($(kIROp_TextureType))
@@ -4404,6 +4426,19 @@ __intrinsic_op($(kIROp_ByteAddressBufferStore))
4404
4426
[require(cpp_cuda_glsl_hlsl_metal_spirv, byteaddressbuffer_rw)]
4405
4427
void __byteAddressBufferStore<T>(RasterizerOrderedByteAddressBuffer buffer, int offset, int alignment, T value);
4406
4428
4429
+ /**
4430
+ Represents an opaque handle to a read-only structured buffer allocated in global memory.
4431
+ A structured buffer can be viewed as an array of the specified element type.
4432
+ @param T The element type of the buffer.
4433
+ @param L The memory layout of the buffer.
4434
+ @remarks
4435
+ The `L` generic parameter is used to specify the memory layout of the buffer when
4436
+ generating SPIRV.
4437
+ `L` must be one of `DefaultDataLayout`, `Std140DataLayout`, `Std430DataLayout` or `ScalarDataLayout`.
4438
+ The default value is `DefaultDataLayout`.
4439
+ When generating code for other targets, this parameter is ignored and has no effect on the generated code.
4440
+ @see `RWStructuredBuffer`, `AppendStructuredBuffer`, `ConsumeStructuredBuffer`, `RasterizerOrderedStructuredBuffer`.
4441
+ **/
4407
4442
__generic<T, L:IBufferDataLayout=DefaultDataLayout>
4408
4443
__magic_type(HLSLStructuredBufferType)
4409
4444
__intrinsic_type($(kIROp_HLSLStructuredBufferType))
@@ -4439,6 +4474,24 @@ struct StructuredBuffer
4439
4474
};
4440
4475
};
4441
4476
4477
+ /**
4478
+ Represents an opaque handle to a consume structured buffer allocated in global memory.
4479
+ A structured buffer can be viewed as an array of the specified element type.
4480
+ An append structure buffer internally maintains an atomic counter to keep track of the number of elements in the buffer,
4481
+ and provide an atomic operation to append a new element to the buffer.
4482
+ @param T The element type of the buffer.
4483
+ @param L The memory layout of the buffer.
4484
+ @remarks
4485
+ This type is supported natively when targeting HLSL.
4486
+ When generating code for other targets, this type is translated into a pair or an ordinary `StructuredBuffer` and
4487
+ a separate `RWStructuredBuffer` that holds the atomic counter.
4488
+ The `L` generic parameter is used to specify the memory layout of the buffer when
4489
+ generating SPIRV.
4490
+ `L` must be one of `DefaultDataLayout`, `Std140DataLayout`, `Std430DataLayout` or `ScalarDataLayout`.
4491
+ The default value is `DefaultDataLayout`.
4492
+ When generating code for other targets, this parameter is ignored and has no effect on the generated code.
4493
+ @see `StructuredBuffer`, `AppendStructuredBuffer`, `RWStructuredBuffer`, `RasterizerOrderedStructuredBuffer`.
4494
+ **/
4442
4495
__generic<T, L:IBufferDataLayout=DefaultDataLayout>
4443
4496
__magic_type(HLSLConsumeStructuredBufferType)
4444
4497
__intrinsic_type($(kIROp_HLSLConsumeStructuredBufferType))
@@ -5851,6 +5904,19 @@ __generic<T, L:IBufferDataLayout=DefaultDataLayout>
5851
5904
__magic_type(HLSL$(item.name)Type)
5852
5905
__intrinsic_type($(item.op))
5853
5906
[require(cpp_cuda_glsl_hlsl_metal_spirv, structuredbuffer_rw)]
5907
+ /**
5908
+ Represents an opaque handle to a mutable structured buffer allocated in global memory.
5909
+ A structured buffer can be viewed as an array of the specified element type.
5910
+ @param T The element type of the buffer.
5911
+ @param L The memory layout of the buffer.
5912
+ @remarks
5913
+ The `L` generic parameter is used to specify the memory layout of the buffer when
5914
+ generating SPIRV.
5915
+ `L` must be one of `DefaultDataLayout`, `Std140DataLayout`, `Std430DataLayout` or `ScalarDataLayout`.
5916
+ The default value is `DefaultDataLayout`.
5917
+ When generating code for other targets, this parameter is ignored and has no effect on the generated code.
5918
+ @see `StructuredBuffer`, `AppendStructuredBuffer`, `ConsumeStructuredBuffer`
5919
+ **/
5854
5920
struct $(item.name)
5855
5921
{
5856
5922
uint DecrementCounter();
0 commit comments