brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 4309435 Raw
34 lines · plain
1===================2HLSL Resource Types3===================4 5.. contents::6   :local:7 8Introduction9============10 11HLSL Resources are runtime-bound data that is provided as input, output or both12to shader programs written in HLSL. Resource Types in HLSL provide key user13abstractions for reading and writing resource data.14 15Implementation Details16======================17 18In Clang resource types are forward declared by the ``HLSLExternalSemaSource``19on initialization. They are then lazily completed when ``requiresCompleteType``20is called later in Sema.21 22Resource types are classes that have the "intangible" resource handle type,23`__hlsl_resource_t`, as a member. These are generally templated class24declarations that specify the type of data that can be loaded from or stored25into the resource. The handle is annotated with hlsl-specific attributes26describing properties of the resource. Member functions of a resource type are27generally fairly simple wrappers around builtins that operate on the handle28member.29 30During code generation resource types are lowered to target extension types in31IR. These types are target specific and differ between DXIL and SPIR-V32generation, providing the necessary information for the targets to generate33binding metadata for their respective target runtimes.34