11 HLSL Resources are runtime-bound data that is provided as input, output or both
12 to shader programs written in HLSL. Resource Types in HLSL provide key user
13 abstractions for reading and writing resource data.
15 Implementation Details
16 ======================
18 In Clang resource types are forward declared by the ``HLSLExternalSemaSource``
19 on initialization. They are then lazily completed when ``requiresCompleteType``
20 is called later in Sema.
22 Resource types are templated class declarations. The template parameter
23 specifies the expected return type of resource loads, and the expected parameter
26 In Clang's AST and code generation, resource types are classes that store a
27 pointer of the template parameter type. The pointer is populated from a call to
28 ``__builtin_hlsl_create_handle``, and treated as a pointer to an array of typed
29 data through until lowering in the backend.
31 Resource types are annotated with the ``HLSLResource`` attribute, which drives
32 code generation for resource binding metadata. The ``hlsl`` metadata nodes are
33 transformed in the backend to the binding information expected by the target