Oktatás
Modul
Az Azure Functions összekapcsolása bemeneti és kimeneti kötések használatával - Training
Ebben a modulban megtanuljuk, hogyan integrálhatja az Azure-függvényt különböző adatforrásokkal kötések használatával.
Ezt a böngészőt már nem támogatjuk.
Frissítsen a Microsoft Edge-re, hogy kihasználhassa a legújabb funkciókat, a biztonsági frissítéseket és a technikai támogatást.
The keys to understanding resource binding in DirectX 12 are the concepts of descriptors, descriptor tables, descriptor heaps, and root signatures.
Shader resources (such as textures, constant tables, images, buffers and so on) are not bound directly to the shader pipeline; instead, they are referenced through a descriptor. A descriptor is a small object that contains information about one resource.
Descriptors are grouped together to form descriptor tables. Each descriptor table stores information about one range of types of resource. There are many different types of resources. The most common resources are:
SRV, UAV, and CBVs descriptors can be combined into the same descriptor table.
The graphics and compute pipelines gain access to resources by referencing into descriptor tables by index.
Descriptor tables are stored in a descriptor heap. Descriptor heaps will ideally contain all the descriptors (in descriptor tables) for one or more frames to be rendered. All the resources will be stored in user mode heaps.
Another concept is that of a root signature. The root signature is a binding convention, defined by the application, that is used by shaders to locate the resources that they need access to. The root signature can store:
In other words, the root signature provides performance optimizations suitable for small amounts of data that change per draw.
The Direct3D 12 design for binding separates it from other tasks, such as memory management, object lifetime management, state tracking, and memory synchronization (refer to Differences in the Binding Model from Direct3D 11). Direct3D 12 binding is designed to be low overhead and optimized for the API calls that are made most frequently. It is also scalable across low end to high end hardware, and scalable from older (the more linear Direct3D 11 pipeline) to the newer (more parallel) approaches to graphics engine programming.
Resource types are the same as Direct3D 11, namely:
Resource views are similar but slightly different from Direct3D 11, vertex and index buffer views have been added.
Only the first four of these views are actually visible to shaders, refer to Shader Visible Descriptor Heaps and Non Shader Visible Descriptor Heaps.
Focusing just on root signatures, root descriptors, root constants, descriptor tables, and descriptor heaps, the flow of rendering logic for an app should be similar to the following:
Note that other descriptor types, render target views (RTVs), depth stencil views (DSV), index buffer views (IBVs), vertex buffer views (VBVs), and stream output views (SOV), are managed differently. The driver handles the versioning of the set of descriptors bound for each draw during recording of the command list (similar to how the root signature bindings are versioned by the hardware/driver). This is different from the contents of shader-visible descriptor heaps, for which the application must manually allocate through the heap as it references different descriptors between draws. Versioning of heap content that is shader-visible is left to the application because it allows applications to do things like reuse descriptors that don’t change, or use large static sets of descriptors and use shader indexing (such as by material ID) to select descriptors to use from the descriptor heap, or use combinations of techniques for different sets of descriptors. The hardware isn’t equipped to handle this type of flexibility for the other descriptor types (RTV, DSV, IBV, VBV, SOV).
In Direct3D 12, the app has low-level control over memory management. In earlier versions of Direct3D, including Direct3D 11, there would be one allocation per resource. In Direct3D 12, the app can use the API to allocate a large block of memory, larger than any single object would need. After this is done, the app can create descriptors to point to sections of that large memory block. This process of deciding what to put where (smaller blocks inside the large block) is known as suballocation. Enabling the app to do this can yield gains in efficient use of computation and memory. For example, resource renaming is rendered obsolete. In place of this, apps can use fences to determine when a particular resource is being used and when it's not by fencing on command list executions where the command list requires the use of that particular resource.
Before any memory that has been bound to the pipeline can be freed, the GPU must be finished with it.
Waiting for frame rendering is probably the coarsest way to be certain that the GPU has finished. At a finer grain, you can again use fences—when a command is recorded into a command list that you want to track the completion of, insert a fence immediately after it. Then, you can do various synchronization operations with the fence. You submit new work (command lists) that waits until a specified fence has passed on the GPU, which indicates that everything before it is complete, or you can request that a CPU event be raised when the fence has passed (which the app can be waiting on with a sleeping thread). In Direct3D 11, this was EnqueueSetEvent
().
Oktatás
Modul
Az Azure Functions összekapcsolása bemeneti és kimeneti kötések használatával - Training
Ebben a modulban megtanuljuk, hogyan integrálhatja az Azure-függvényt különböző adatforrásokkal kötések használatával.
Dokumentáció
Descriptors Overview - Win32 apps
Descriptors are created by API calls and identify resources.
Binding is the process of linking resource objects to the shaders of the graphics pipeline.
The root signature defines what types of resources are bound to the graphics pipeline.