Skip to content

Commit 758c68d

Browse files
committed
Fix comment.
1 parent f7df17a commit 758c68d

File tree

3 files changed

+329
-134
lines changed

3 files changed

+329
-134
lines changed

source/slang/hlsl.meta.slang

+66
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,24 @@ __intrinsic_op($(kIROp_StructuredBufferGetDimensions))
6161
uint2 __structuredBufferGetDimensions<T,L:IBufferDataLayout>(RasterizerOrderedStructuredBuffer<T,L> buffer);
6262

6363
//@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+
**/
6482
__generic<T, L:IBufferDataLayout=DefaultDataLayout>
6583
__magic_type(HLSLAppendStructuredBufferType)
6684
__intrinsic_type($(kIROp_HLSLAppendStructuredBufferType))
@@ -433,6 +451,10 @@ vector<T,N+1> __makeVector(vector<T,N> vec, T scalar);
433451
/// |39 |`"r8ui"` | 1 channel 8-bit unsigned integer texture |
434452
/// |40 |`"r64ui"` | 1 channel 64-bit unsigned integer texture |
435453
/// |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.
436458
/// @internal
437459
__magic_type(TextureType)
438460
__intrinsic_type($(kIROp_TextureType))
@@ -4404,6 +4426,19 @@ __intrinsic_op($(kIROp_ByteAddressBufferStore))
44044426
[require(cpp_cuda_glsl_hlsl_metal_spirv, byteaddressbuffer_rw)]
44054427
void __byteAddressBufferStore<T>(RasterizerOrderedByteAddressBuffer buffer, int offset, int alignment, T value);
44064428

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+
**/
44074442
__generic<T, L:IBufferDataLayout=DefaultDataLayout>
44084443
__magic_type(HLSLStructuredBufferType)
44094444
__intrinsic_type($(kIROp_HLSLStructuredBufferType))
@@ -4439,6 +4474,24 @@ struct StructuredBuffer
44394474
};
44404475
};
44414476

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+
**/
44424495
__generic<T, L:IBufferDataLayout=DefaultDataLayout>
44434496
__magic_type(HLSLConsumeStructuredBufferType)
44444497
__intrinsic_type($(kIROp_HLSLConsumeStructuredBufferType))
@@ -5851,6 +5904,19 @@ __generic<T, L:IBufferDataLayout=DefaultDataLayout>
58515904
__magic_type(HLSL$(item.name)Type)
58525905
__intrinsic_type($(item.op))
58535906
[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+
**/
58545920
struct $(item.name)
58555921
{
58565922
uint DecrementCounter();

0 commit comments

Comments
 (0)