Skip to content

Commit 4e62f98

Browse files
csyongheslangbot
andauthored
Fix documentation on DescriptorHandle. (shader-slang#6062)
* Fix documentation on DescriptorHandle. * Fix. * format code --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
1 parent cbdc7e1 commit 4e62f98

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

cmake/SlangTarget.cmake

+8-4
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,14 @@ function(slang_add_target dir type)
505505
endif()
506506
install(
507507
TARGETS ${target} ${export_args}
508-
ARCHIVE DESTINATION ${archive_subdir} ${ARGN}
509-
LIBRARY DESTINATION ${library_subdir} ${ARGN}
510-
RUNTIME DESTINATION ${runtime_subdir} ${ARGN}
511-
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${ARGN}
508+
ARCHIVE DESTINATION ${archive_subdir}
509+
${ARGN}
510+
LIBRARY DESTINATION ${library_subdir}
511+
${ARGN}
512+
RUNTIME DESTINATION ${runtime_subdir}
513+
${ARGN}
514+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
515+
${ARGN}
512516
)
513517
endmacro()
514518

source/slang/hlsl.meta.slang

+15-1
Original file line numberDiff line numberDiff line change
@@ -20932,6 +20932,8 @@ struct ConstBufferPointer
2093220932
// new aliased bindings for each distinct cast type.
2093320933
//
2093420934

20935+
//@public:
20936+
2093520937
/// Represent the kind of a descriptor type.
2093620938
enum DescriptorKind
2093720939
{
@@ -21048,8 +21050,18 @@ ${{{{
2104821050
}
2104921051
}}}}
2105021052

21051-
/// Represents a bindless resource handle. A bindless resource handle is always a concrete type and can be
21053+
/// Represents a bindless handle to a descriptor. A descriptor handle is always an ordinary data type and can be
2105221054
/// declared in any memory location.
21055+
/// @remarks Opaque descriptor types such as textures(`Texture2D` etc.), `SamplerState` and buffers (e.g. `StructuredBuffer`)
21056+
/// can have undefined size and data representation on many targets. On platforms such as Vulkan and D3D12, descriptors are
21057+
/// communicated to the shader code by calling the host side API to write the descriptor into a descriptor set or table, instead
21058+
/// of directly writing bytes into an ordinary GPU accessible buffer. As a result, oapque handle types cannot be used in places
21059+
/// that refer to a ordinary buffer location, such as as element types of a `StructuredBuffer`.
21060+
/// However, a `DescriptorHandle<T>` stores a handle (or address) to the actual descriptor, and is always an ordinary data type
21061+
/// that can be manipulated directly in the shader code. This gives the developer the flexibility to embed and pass around descriptor
21062+
/// parameters throughout the code, to enable cleaner modular designs.
21063+
/// See [User Guide](https://shader-slang.com/slang/user-guide/convenience-features.html#descriptorhandle-for-bindless-descriptor-access)
21064+
/// for more information on how to use `DescriptorHandle<T>` in your code.
2105321065
__magic_type(DescriptorHandleType)
2105421066
__intrinsic_type($(kIROp_DescriptorHandleType))
2105521067
struct DescriptorHandle<T:IOpaqueDescriptor> : IComparable
@@ -21140,6 +21152,8 @@ extern T getDescriptorFromHandle<T:IOpaqueDescriptor>(DescriptorHandle<T> handle
2114021152
__intrinsic_op($(kIROp_NonUniformResourceIndex))
2114121153
DescriptorHandle<T> nonuniform<T:IOpaqueDescriptor>(DescriptorHandle<T> ptr);
2114221154

21155+
//@hidden:
21156+
2114321157
__glsl_version(450)
2114421158
__glsl_extension(GL_ARB_shader_clock)
2114521159
[require(glsl_spirv, GL_ARB_shader_clock)]

0 commit comments

Comments
 (0)