Describes the blend state that you use in a call to
Here are the default values for blend state.
| State | Default Value |
|---|---|
| AlphaToCoverageEnable | |
| IndependentBlendEnable | |
| RenderTarget[0].BlendEnable | |
| RenderTarget[0].SrcBlend | |
| RenderTarget[0].DestBlend | |
| RenderTarget[0].BlendOp | |
| RenderTarget[0].SrcBlendAlpha | |
| RenderTarget[0].DestBlendAlpha | |
| RenderTarget[0].BlendOpAlpha | |
| RenderTarget[0].RenderTargetWriteMask |
?
Note?? If the driver type is set to
Submits a command list for execution.
The number of command lists to be executed.
The array of
The driver is free to patch the submitted command lists. It is the calling application?s responsibility to ensure that the graphics processing unit (GPU) is not currently reading the any of the submitted command lists from a previous execution.
Applications are encouraged to batch together command list executions to reduce fixed costs associated with submitted commands to the GPU.
This method is used to determine the rate at which the GPU timestamp counter increments.
For more information, refer to Timing.
Describes a command queue.
This structure is passed into CreateCommandQueue.
This structure is returned by
Updates mappings of tile locations in reserved resources to memory locations in a resource heap.
A reference to the reserved resource.
The number of reserved resource regions.
An array of
An array of
A reference to the resource heap.
The number of tile ranges.
A reference to an array of
An array of offsets into the resource heap. These are 0-based tile offsets, counting in tiles (not bytes).
An array of tiles. An array of values that specify the number of tiles in each tile range. The NumRanges parameter specifies the number of values in the array.
A combination of
Use UpdateTileMappings to map the virtual pages of a reserved resource to the physical pages of a heap. The mapping does not have to be in order. The operation is similar to
In a single call to UpdateTileMappings, you can map one or more ranges of resource tiles to one or more ranges of heap tiles.
You can organize the parameters of UpdateTileMappings in these ways to perform an update:
If pResourceRegionStartCoordinates isn't
The updates are applied from first region to last; so, if regions overlap in a single call, the updates later in the list overwrite the areas that overlap with previous updates.
NumRanges specifies the number of tile ranges, where the total tiles identified across all ranges must match the total number of tiles in the tile regions from the previously described reserved resource. Mappings are defined by iterating through the tiles in the tile regions in sequential order - x then y then z order for box regions - while walking through the set of tile ranges in sequential order. The breakdown of tile regions doesn't have to line up with the breakdown of tile ranges, but the total number of tiles on both sides must be equal so that each reserved resource tile specified has a mapping specified.
pRangeFlags, pHeapRangeStartOffsets, and pRangeTileCounts are all arrays, of size NumRanges, that describe the tile ranges. If pRangeFlags is
If tile mappings have changed on a reserved resource that the app will render, the app must clear, by using the fixed function Clear APIs, the tiles that have changed within the area being rendered (mapped or not). If an app doesn't clear in these situations, the app receives undefined values when it reads from the reserved resource.
If an app needs to preserve existing memory contents of areas in a reserved resource where mappings have changed, the app can first save the contents where tile mappings have changed, by copying them using CopyTileMappings, issuing the required Clear, and then copying the contents back.
Suppose a tile is mapped into multiple reserved resources at the same time and tile contents are manipulated by any means (render, copy, and so on) via one of the reserved resources. Then, if the same tile is to be rendered via any other reserved resource, the tile must be cleared first as previously described.
Here are some examples of common UpdateTileMappings cases:
Copies mappings from a source reserved resource to a destination reserved resource.
A reference to the destination reserved resource.
A reference to a
A reference to the source reserved resource.
A reference to a
A reference to a
One member of
Use CopyTileMappings to copy the tile mappings from one reserved resource to another, either to duplicate a resource mapping, or to initialize a new mapping before modifying it using UpdateTileMappings.
CopyTileMappings helps with tasks such as shifting mappings around within and across reserved resources, for example, scrolling tiles. The source and destination regions can overlap; the result of the copy in this situation is as if the source was saved to a temporary location and from there written to the destination.
The destination and the source regions must each entirely fit in their resource or behavior is undefined and the debug layer will emit an error.
For more info on tiled resources, refer to the "DirectX tiled resources" section within DirectX programming.
Submits an array of command lists for execution.
The number of command lists to be executed.
The array of
The driver is free to patch the submitted command lists. It is the calling application?s responsibility to ensure that the graphics processing unit (GPU) is not currently reading the any of the submitted command lists from a previous execution.
Applications are encouraged to batch together command list executions to reduce fixed costs associated with submitted commands to the GPU.
Submits an array of command lists for execution.
The number of command lists to be executed.
The array of
The driver is free to patch the submitted command lists. It is the calling application?s responsibility to ensure that the graphics processing unit (GPU) is not currently reading the any of the submitted command lists from a previous execution.
Applications are encouraged to batch together command list executions to reduce fixed costs associated with submitted commands to the GPU.
Submits an array of command lists for execution.
The number of command lists to be executed.
The array of
The driver is free to patch the submitted command lists. It is the calling application?s responsibility to ensure that the graphics processing unit (GPU) is not currently reading the any of the submitted command lists from a previous execution.
Applications are encouraged to batch together command list executions to reduce fixed costs associated with submitted commands to the GPU.
For internal use only.
Internal.
Internal.
Internal.
For internal use only.
Internal.
Internal.
Internal.
For internal use only.
Waits until the specified fence reaches or exceeds the specified value.
A reference to the
The value that the command queue is waiting for the fence to reach or exceed. So when
This method returns one of the Direct3D 12 Return Codes.
This method is used to determine the rate at which the GPU timestamp counter increments.
The GPU timestamp counter frequency (in ticks/second).
This method returns one of the Direct3D 12 Return Codes.
For more information, refer to Timing.
This method samples the CPU and GPU timestamp counters at the same moment in time.
The value of the GPU timestamp counter.
The value of the CPU timestamp counter.
This method returns one of the Direct3D 12 Return Codes.
For more information, refer to Timing.
Describes a command queue.
This structure is passed into CreateCommandQueue.
This structure is returned by
Describes a command queue.
This structure is passed into CreateCommandQueue.
This structure is returned by
Specifies one member of
The priority for the command queue, as a
Specifies any flags from the
For single GPU operation, set this to zero. If there are multiple GPU nodes, set a bit to identify the node (the device's physical adapter) to which the command queue applies. Each bit in the mask corresponds to a single node. Only 1 bit must be set. Refer to Multi-Adapter.
Describes the arguments (parameters) of a command signature.
Use this structure by CreateCommandSignature.
An array of
Specifies the size of each argument of a command signature, in bytes.
Specifies the number of arguments in the command signature.
An array of
For single GPU operation, set this to zero. If there are multiple GPU nodes, set bits to identify the nodes (the device's physical adapters) for which the command signature is to apply. Each bit in the mask corresponds to a single node. Refer to Multi-Adapter.
Describes a CPU descriptor handle.
This structure is returned by the following methods:
This structure is passed into the following methods:
The address of the descriptor.
A debug interface controls debug settings and validates pipeline state. It can only be used if the debug layer is turned on.
This interface is obtained by querying it from the IUnknown::QueryInterface.
Enables the debug layer.
Specifies a range so that, for example, if part of a descriptor table has 100 shader-resource views (SRVs) that range can be declared in one entry rather than 100.
This enum is used by the
Specifies a range of SRVs.
Specifies a range of unordered-access views (UAVs).
Specifies a range of constant-buffer views (CBVs).
Specifies a range of samplers.
Describes a GPU descriptor handle.
This structure is returned by
This structure is passed into the following methods:
The address of the descriptor.
Clears the depth-stencil resource.
Describes the CPU descriptor handle that represents the start of the heap for the depth stencil to be cleared.
A combination of
A value to clear the depth buffer with. This value will be clamped between 0 and 1.
A value to clear the stencil buffer with.
The number of rectangles in the array that the pRects parameter specifies.
An array of D3D12_RECT structures for the rectangles in the resource view to clear. If
Sets all the elements in a render target to one value.
Specifies a
A 4-component array that represents the color to fill the render target with.
The number of rectangles in the array that the pRects parameter specifies.
An array of D3D12_RECT structures for the rectangles in the resource view to clear. If
Notifies the driver that it needs to synchronize multiple accesses to resources.
The number of submitted barrier descriptions.
Pointer to an array of barrier descriptions.
There are three types of barrier descriptions:
When
For descriptions of the usage states a subresource can be in, see the
A subresource can be in any state when
When a back buffer is presented, it must be in the
The resource usage bits are group into two categories, read-only and read/write.
The following usage bits are read-only:
The following usage bits are read/write:
At most one write bit can be set. If any write bit is set, then no read bit may be set. If no write bit is set, then any number of read bits may be set.
At any given time, a subresource is in exactly one state (determined by a set of flags). The application must ensure that the states are matched when making a sequence of ResourceBarrier calls. In other words, the before and after states in consecutive calls to ResourceBarrier must agree.
To transition all subresources within a resource, the application can set the subresource index to D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, which implies that all subresources are changed.
For improved performance, applications should use split barriers (refer to Synchronization and Multi-Engine). Applications should also batch multiple transitions into a single call whenever possible.
Notifies the driver that it needs to synchronize multiple accesses to resources.
The number of submitted barrier descriptions.
Pointer to an array of barrier descriptions.
There are three types of barrier descriptions:
When
For descriptions of the usage states a subresource can be in, see the
A subresource can be in any state when
When a back buffer is presented, it must be in the
The resource usage bits are group into two categories, read-only and read/write.
The following usage bits are read-only:
The following usage bits are read/write:
At most one write bit can be set. If any write bit is set, then no read bit may be set. If no write bit is set, then any number of read bits may be set.
At any given time, a subresource is in exactly one state (determined by a set of flags). The application must ensure that the states are matched when making a sequence of ResourceBarrier calls. In other words, the before and after states in consecutive calls to ResourceBarrier must agree.
To transition all subresources within a resource, the application can set the subresource index to D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, which implies that all subresources are changed.
For improved performance, applications should use split barriers (refer to Synchronization and Multi-Engine). Applications should also batch multiple transitions into a single call whenever possible.
Notifies the driver that it needs to synchronize multiple accesses to resources.
The number of submitted barrier descriptions.
Pointer to an array of barrier descriptions.
There are three types of barrier descriptions:
When
For descriptions of the usage states a subresource can be in, see the
A subresource can be in any state when
When a back buffer is presented, it must be in the
The resource usage bits are group into two categories, read-only and read/write.
The following usage bits are read-only:
The following usage bits are read/write:
At most one write bit can be set. If any write bit is set, then no read bit may be set. If no write bit is set, then any number of read bits may be set.
At any given time, a subresource is in exactly one state (determined by a set of flags). The application must ensure that the states are matched when making a sequence of ResourceBarrier calls. In other words, the before and after states in consecutive calls to ResourceBarrier must agree.
To transition all subresources within a resource, the application can set the subresource index to D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, which implies that all subresources are changed.
For improved performance, applications should use split barriers (refer to Synchronization and Multi-Engine). Applications should also batch multiple transitions into a single call whenever possible.
Notifies the driver that it needs to synchronize multiple accesses to resources.
The number of submitted barrier descriptions.
Pointer to an array of barrier descriptions.
There are three types of barrier descriptions:
When
For descriptions of the usage states a subresource can be in, see the
A subresource can be in any state when
When a back buffer is presented, it must be in the
The resource usage bits are group into two categories, read-only and read/write.
The following usage bits are read-only:
The following usage bits are read/write:
At most one write bit can be set. If any write bit is set, then no read bit may be set. If no write bit is set, then any number of read bits may be set.
At any given time, a subresource is in exactly one state (determined by a set of flags). The application must ensure that the states are matched when making a sequence of ResourceBarrier calls. In other words, the before and after states in consecutive calls to ResourceBarrier must agree.
To transition all subresources within a resource, the application can set the subresource index to D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, which implies that all subresources are changed.
For improved performance, applications should use split barriers (refer to Synchronization and Multi-Engine). Applications should also batch multiple transitions into a single call whenever possible.
Notifies the driver that it needs to synchronize multiple accesses to resources.
The number of submitted barrier descriptions.
Pointer to an array of barrier descriptions.
There are three types of barrier descriptions:
When
For descriptions of the usage states a subresource can be in, see the
A subresource can be in any state when
When a back buffer is presented, it must be in the
The resource usage bits are group into two categories, read-only and read/write.
The following usage bits are read-only:
The following usage bits are read/write:
At most one write bit can be set. If any write bit is set, then no read bit may be set. If no write bit is set, then any number of read bits may be set.
At any given time, a subresource is in exactly one state (determined by a set of flags). The application must ensure that the states are matched when making a sequence of ResourceBarrier calls. In other words, the before and after states in consecutive calls to ResourceBarrier must agree.
To transition all subresources within a resource, the application can set the subresource index to D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, which implies that all subresources are changed.
For improved performance, applications should use split barriers (refer to Synchronization and Multi-Engine). Applications should also batch multiple transitions into a single call whenever possible.
Sets CPU descriptor handles for the render targets and depth stencil.
The number of entries in the pRenderTargetDescriptors array.
Specifies an array of
True means the handle passed in is the reference to a contiguous range of NumRenderTargetDescriptors descriptors. This case is useful if the set of descriptors to bind already happens to be contiguous in memory (so all that?s needed is a handle to the first one). For example, if NumRenderTargetDescriptors is 3 then the memory layout is taken as follows:
In this case the driver dereferences the handle and then increments the memory being pointed to.
False means that the handle is the first of an array of NumRenderTargetDescriptors handles. The false case allows an application to bind a set of descriptors from different locations at once. Again assuming that NumRenderTargetDescriptors is 3, the memory layout is taken as follows:
In this case the driver dereferences three handles that are expected to be adjacent to each other in memory.
A reference to a
Sets CPU descriptor handles for the render targets and depth stencil.
The number of entries in the pRenderTargetDescriptors array.
Specifies an array of
True means the handle passed in is the reference to a contiguous range of NumRenderTargetDescriptors descriptors. This case is useful if the set of descriptors to bind already happens to be contiguous in memory (so all that?s needed is a handle to the first one). For example, if NumRenderTargetDescriptors is 3 then the memory layout is taken as follows:
In this case the driver dereferences the handle and then increments the memory being pointed to.
False means that the handle is the first of an array of NumRenderTargetDescriptors handles. The false case allows an application to bind a set of descriptors from different locations at once. Again assuming that NumRenderTargetDescriptors is 3, the memory layout is taken as follows:
In this case the driver dereferences three handles that are expected to be adjacent to each other in memory.
A reference to a
Sets CPU descriptor handles for the render targets and depth stencil.
The number of entries in the pRenderTargetDescriptors array.
Specifies an array of
True means the handle passed in is the reference to a contiguous range of NumRenderTargetDescriptors descriptors. This case is useful if the set of descriptors to bind already happens to be contiguous in memory (so all that?s needed is a handle to the first one). For example, if NumRenderTargetDescriptors is 3 then the memory layout is taken as follows:
In this case the driver dereferences the handle and then increments the memory being pointed to.
False means that the handle is the first of an array of NumRenderTargetDescriptors handles. The false case allows an application to bind a set of descriptors from different locations at once. Again assuming that NumRenderTargetDescriptors is 3, the memory layout is taken as follows:
In this case the driver dereferences three handles that are expected to be adjacent to each other in memory.
A reference to a
Sets a CPU descriptor handle for the vertex buffers.
Index into the device's zero-based array to begin setting vertex buffers.
Specifies the vertex buffer views in an array of
The number of views in the pViews array.
Sets a CPU descriptor handle for the vertex buffers.
Index into the device's zero-based array to begin setting vertex buffers.
Specifies the vertex buffer view of
Bind an array of viewports to the rasterizer stage of the pipeline.
Number of viewports to bind. The range of valid values is (0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE).
All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.
Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.
Note Even though you specify float values to the members of theBind an array of viewports to the rasterizer stage of the pipeline.
Number of viewports to bind. The range of valid values is (0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE).
All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.
Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.
Note Even though you specify float values to the members of theFor internal use only.
Internal.
For internal use only.
Internal.
Bind information about the primitive type, and data order that describes input data for the input assembler stage.
Sets the blend factor that modulate values for a pixel shader, render target, or both.
If you created the blend-state object with
If you didn't create the blend-state object with
If you pass
Sets the reference value for depth stencil tests.
Sets all shaders and programs most of the fixed-function state of the graphics processing unit (GPU) pipeline.
Indicates that recording to the command list has finished.
Returns
See Direct3D 12 Return Codes for other possible return values.
The runtime will validate that the command list has not previously been closed. If an error was encountered during recording, the error code is returned here. The runtime won't call the close device driver interface (DDI) in this case.
Resets a command list back to its initial state as if a new command list was just created.
A reference to the
A reference to the
For bundles on the other hand, it might make more sense to try to set the initial state parameter since bundles are likely smaller overall and can be reused frequently.
Returns
See Direct3D 12 Return Codes for other possible return values.
By using Reset, you can re-use command list tracking structures without any allocations. Unlike
You can use Reset for both direct command lists and bundles.
The command allocator that Reset takes as input can be associated with no more than one recording command list at a time. The allocator type, direct command list or bundle, must match the type of command list that is being created.
If a bundle doesn't specify a resource heap, it can't make changes to which descriptor tables are bound. Either way, bundles can't change the resource heap within the bundle. If a heap is specified for a bundle, the heap must match the calling 'parent' command list?s heap.
Resets the state of a direct command list back to the state it was in when the command list was created.
A reference to the
It is invalid to call ClearState on a bundle. If an app calls ClearState on a bundle, the call to Close will return E_FAIL.
When ClearState is called, all currently bound resources are unbound. The primitive topology is set to
The app-provided pipeline state object becomes bound as the currently set pipeline state object.
Draws non-indexed, instanced primitives.
Number of vertices to draw.
Number of instances to draw.
Index of the first vertex.
A value added to each index before reading per-instance data from a vertex buffer.
A draw API submits work to the rendering pipeline.
Instancing might extend performance by reusing the same geometry to draw multiple objects in a scene. One example of instancing could be to draw the same object with different positions and colors.
The vertex data for an instanced draw call typically comes from a vertex buffer that is bound to the pipeline. But, you could also provide the vertex data from a shader that has instanced data identified with a system-value semantic (SV_InstanceID).
Draws indexed, instanced primitives.
Number of indices read from the index buffer for each instance.
Number of instances to draw.
The location of the first index read by the GPU from the index buffer.
A value added to each index before reading a vertex from the vertex buffer.
A value added to each index before reading per-instance data from a vertex buffer.
A draw API submits work to the rendering pipeline.
Instancing might extend performance by reusing the same geometry to draw multiple objects in a scene. One example of instancing could be to draw the same object with different positions and colors. Instancing requires multiple vertex buffers: at least one for per-vertex data and a second buffer for per-instance data.
Executes a command list from a thread group.
The number of groups dispatched in the x direction. ThreadGroupCountX must be less than or equal to
The number of groups dispatched in the y direction. ThreadGroupCountY must be less than or equal to
The number of groups dispatched in the z direction. ThreadGroupCountZ must be less than or equal to
You call the Dispatch method to execute commands in a compute shader. A compute shader can be run on many threads in parallel, within a thread group. Index a particular thread, within a thread group using a 3D vector given by (x,y,z).
Copies a region of a buffer from one resource to another.
Specifies the destination
Specifies a UINT64 offset (in bytes) into the destination resource.
Specifies the source
Specifies a UINT64 offset (in bytes) into the source resource, to start the copy from.
Specifies the number of bytes to copy.
Consider using the CopyResource method when copying an entire resource, and use this method for copying regions of a resource.
This method uses the GPU to copy texture data between two locations. Both the source and the destination may reference texture data located within either a buffer resource or a texture resource.
Specifies the destination
The x-coordinate of the upper left corner of the destination region.
The y-coordinate of the upper left corner of the destination region. For a 1D subresource, this must be zero.
The z-coordinate of the upper left corner of the destination region. For a 1D or 2D subresource, this must be zero.
Specifies the source
Specifies an optional
The source box must be within the size of the source resource. The destination offsets, (x, y, and z), allow the source box to be offset when writing into the destination resource; however, the dimensions of the source box and the offsets must be within the size of the resource. If you try and copy outside the destination resource or specify a source box that is larger than the source resource, the behavior of CopyTextureRegion is undefined. If you created a device that supports the debug layer, the debug output reports an error on this invalid CopyTextureRegion call. Invalid parameters to CopyTextureRegion cause undefined behavior and might result in incorrect rendering, clipping, no copy, or even the removal of the rendering device.
If the resources are buffers, all coordinates are in bytes; if the resources are textures, all coordinates are in texels.
CopyTextureRegion performs the copy on the GPU (similar to a memcpy by the CPU). As a consequence, the source and destination resources:
CopyTextureRegion only supports copy; it does not support any stretch, color key, or blend. CopyTextureRegion can reinterpret the resource data between a few format types. For more info, see Format Conversion using Direct3D 10.1.
If your app needs to copy an entire resource, we recommend to use CopyResource instead.
Note?? If you use CopyTextureRegion with a depth-stencil buffer or a multisampled resource, you must copy the whole subresource. In this situation, you must pass 0 to the DstX, DstY, and DstZ parameters andCopies the entire contents of the source resource to the destination resource.
A reference to the
A reference to the
CopyResource operations are performed on the GPU and do not incur a significant CPU workload linearly dependent on the size of the data to copy.
Copies tiles from buffer to tiled resource or vice versa.
A reference to a tiled resource.
A reference to a
A reference to a
A reference to an
The offset in bytes into the buffer at pBuffer to start the operation.
A combination of
CopyTiles drops write operations to unmapped areas and handles read operations from unmapped areas (except on Tier_1 tiled resources, where reading and writing unmapped areas is invalid).
If a copy operation involves writing to the same memory location multiple times because multiple locations in the destination resource are mapped to the same tile memory, the resulting write operations to multi-mapped tiles are non-deterministic and non-repeatable; that is, accesses to the tile memory happen in whatever order the hardware happens to execute the copy operation.
The tiles involved in the copy operation can't include tiles that contain packed mipmaps or results of the copy operation are undefined. To transfer data to and from mipmaps that the hardware packs into one tile, you must use the standard (that is, non-tile specific) copy and update APIs (like
The memory layout of the tiles in the non-tiled buffer resource side of the copy operation is linear in memory within 64 KB tiles, which the hardware and driver swizzle and deswizzle per tile as appropriate when they transfer to and from a tiled resource. For multisample antialiasing (MSAA) surfaces, the hardware and driver traverse each pixel's samples in sample-index order before they move to the next pixel. For tiles that are partially filled on the right side (for a surface that has a width not a multiple of tile width in pixels), the pitch and stride to move down a row is the full size in bytes of the number pixels that would fit across the tile if the tile was full. So, there can be a gap between each row of pixels in memory. Mipmaps that are smaller than a tile are not packed together in the linear layout, which might seem to be a waste of memory space, but as mentioned you can't use CopyTiles or
For more info about tiled resources, see Tiled resources.
Copy a multi-sampled resource into a non-multi-sampled resource.
Destination resource. Must be a created with the
A zero-based index, that identifies the destination subresource. Use D3D11CalcSubresource to calculate the index.
Source resource. Must be multisampled.
The source subresource of the source resource.
A
Bind information about the primitive type, and data order that describes input data for the input assembler stage.
The type of primitive and ordering of the primitive data (see
Bind an array of viewports to the rasterizer stage of the pipeline.
Number of viewports to bind. The range of valid values is (0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE).
An array of
All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.
Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.
Note?? Even though you specify float values to the members of theBind an array of viewports to the rasterizer stage of the pipeline.
Number of viewports to bind. The range of valid values is (0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE).
An array of
All viewports must be set atomically as one operation. Any viewports not defined by the call are disabled.
Which viewport to use is determined by the SV_ViewportArrayIndex semantic output by a geometry shader; if a geometry shader does not specify the semantic, Direct3D will use the first viewport in the array.
Note?? Even though you specify float values to the members of theSets the blend factor that modulate values for a pixel shader, render target, or both.
Array of blend factors, one for each RGBA component.
If you created the blend-state object with
If you didn't create the blend-state object with
If you pass
Sets the reference value for depth stencil tests.
Reference value to perform against when doing a depth-stencil test.
Sets all shaders and programs most of the fixed-function state of the graphics processing unit (GPU) pipeline.
Pointer to the
Notifies the driver that it needs to synchronize multiple accesses to resources.
The number of submitted barrier descriptions.
Pointer to an array of barrier descriptions.
There are three types of barrier descriptions:
When
For descriptions of the usage states a subresource can be in, see the
A subresource can be in any state when
When a back buffer is presented, it must be in the
The resource usage bits are group into two categories, read-only and read/write.
The following usage bits are read-only:
The following usage bits are read/write:
At most one write bit can be set. If any write bit is set, then no read bit may be set. If no write bit is set, then any number of read bits may be set.
At any given time, a subresource is in exactly one state (determined by a set of flags). The application must ensure that the states are matched when making a sequence of ResourceBarrier calls. In other words, the before and after states in consecutive calls to ResourceBarrier must agree.
To transition all subresources within a resource, the application can set the subresource index to D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, which implies that all subresources are changed.
For improved performance, applications should use split barriers (refer to Synchronization and Multi-Engine). Applications should also batch multiple transitions into a single call whenever possible.
Executes a bundle.
Specifies the
Bundles inherit all state from the parent command list on which ExecuteBundle is called, except the pipeline state object and primitive topology. All of the state that is set in a bundle will affect the state of the parent command list. Note that ExecuteBundle is not a predicated operation.
Changes the currently bound descriptor heaps that are associated with a command list.
Number of descriptor heaps to bind.
A reference to an array of
SetDescriptorHeaps can be called on a bundle, but the bundle descriptor heaps must match the calling command list descriptor heap. For more information on bundle restrictions, refer to Creating and Recording Command Lists and Bundles.
Changes the currently bound descriptor heaps that are associated with a command list.
Number of descriptor heaps to bind.
A reference to an array of
SetDescriptorHeaps can be called on a bundle, but the bundle descriptor heaps must match the calling command list descriptor heap. For more information on bundle restrictions, refer to Creating and Recording Command Lists and Bundles.
Changes the currently bound descriptor heaps that are associated with a command list.
Number of descriptor heaps to bind.
A reference to an array of
SetDescriptorHeaps can be called on a bundle, but the bundle descriptor heaps must match the calling command list descriptor heap. For more information on bundle restrictions, refer to Creating and Recording Command Lists and Bundles.
Sets the layout of the compute root signature.
A reference to the
Sets the layout of the graphics root signature.
A reference to the
Sets the compute descriptor table.
The slot number for binding.
A GPU_descriptor_handle object for the base descriptor to set.
Sets the graphics descriptor table.
The slot number for binding.
A GPU_descriptor_handle object for the base descriptor to set.
Sets a constant in the compute root signature.
The slot number for binding.
The source data for the constant to set.
The offset, in 32-bit values, to set the constant in the root signature.
Sets a constant in the graphics root signature.
The slot number for binding.
The source data for the constant to set.
The offset, in 32-bit values, to set the constant in the root signature.
Sets a group of constants in the compute root signature.
The slot number for binding.
The number of constants to set in the root signature.
The source data for the group of constants to set.
The offset, in 32-bit values, to set the first constant of the group in the root signature.
Sets a group of constants in the graphics root signature.
The slot number for binding.
The number of constants to set in the root signature.
The source data for the group of constants to set.
The offset, in 32-bit values, to set the first constant of the group in the root signature.
Sets a CPU descriptor handle for the constant buffer in the compute root signature.
The slot number for binding.
Specifies the D3D12_GPU_VIRTUAL_ADDRESS of the constant buffer.
Sets a CPU descriptor handle for the constant buffer in the graphics root signature.
The slot number for binding.
The GPU virtual address of the constant buffer. D3D12_GPU_VIRTUAL_ADDRESS is a typedef'd alias of UINT64.
Sets a CPU descriptor handle for the shader resource in the compute root signature.
The slot number for binding.
The GPU virtual address of the buffer. D3D12_GPU_VIRTUAL_ADDRESS is a typedef'd alias of UINT64.
Sets a CPU descriptor handle for the shader resource in the graphics root signature.
The slot number for binding.
The GPU virtual address of the constant buffer. D3D12_GPU_VIRTUAL_ADDRESS is a typedef'd alias of UINT64.
Sets a CPU descriptor handle for the unordered-access-view resource in the compute root signature.
The slot number for binding.
The GPU virtual address of the buffer. D3D12_GPU_VIRTUAL_ADDRESS is a typedef'd alias of UINT64.
Sets a CPU descriptor handle for the unordered-access-view resource in the graphics root signature.
The slot number for binding.
The GPU virtual address of the buffer. D3D12_GPU_VIRTUAL_ADDRESS is a typedef'd alias of UINT64.
Sets the view for the index buffer.
The view specifies the index buffer's address, size, and
Only one index buffer can be bound to the graphics pipeline at any one time.
Sets a CPU descriptor handle for the vertex buffers.
Index into the device's zero-based array to begin setting vertex buffers.
The number of views in the pViews array.
Specifies the vertex buffer views in an array of
Sets the stream output buffer views.
Index into the device's zero-based array to begin setting stream output buffers.
The number of entries in the pViews array.
Specifies an array of
Sets CPU descriptor handles for the render targets and depth stencil.
The number of entries in the pRenderTargetDescriptors array.
Specifies an array of
True means the handle passed in is the reference to a contiguous range of NumRenderTargetDescriptors descriptors. This case is useful if the set of descriptors to bind already happens to be contiguous in memory (so all that?s needed is a handle to the first one). For example, if NumRenderTargetDescriptors is 3 then the memory layout is taken as follows:
In this case the driver dereferences the handle and then increments the memory being pointed to.
False means that the handle is the first of an array of NumRenderTargetDescriptors handles. The false case allows an application to bind a set of descriptors from different locations at once. Again assuming that NumRenderTargetDescriptors is 3, the memory layout is taken as follows:
In this case the driver dereferences three handles that are expected to be adjacent to each other in memory.
A reference to a
Clears the depth-stencil resource.
Describes the CPU descriptor handle that represents the start of the heap for the depth stencil to be cleared.
A combination of
A value to clear the depth buffer with. This value will be clamped between 0 and 1.
A value to clear the stencil buffer with.
The number of rectangles in the array that the pRects parameter specifies.
An array of D3D12_RECT structures for the rectangles in the resource view to clear. If
Sets all the elements in a render target to one value.
Specifies a
A 4-component array that represents the color to fill the render target with.
The number of rectangles in the array that the pRects parameter specifies.
An array of D3D12_RECT structures for the rectangles in the resource view to clear. If
Sets all the elements in a unordered-access view to the specified integer values.
A
A
A reference to the
A 4-component array that containing the values to fill the unordered-access-view resource with.
The number of rectangles in the array that the pRects parameter specifies.
An array of D3D12_RECT structures for the rectangles in the resource view to clear. If
Sets all the elements in a unordered access view to the specified float values.
Describes the GPU descriptor handle that represents the start of the heap for the unordered-access view to clear.
Describes the CPU descriptor handle that represents the start of the heap for the render target to clear.
A reference to the
A 4-component array that containing the values to fill the unordered-access-view resource with.
The number of rectangles in the array that the pRects parameter specifies.
An array of D3D12_RECT structures for the rectangles in the resource view to clear. If
Discards a resource.
A reference to the
A reference to a
Starts a query running.
Specifies the
Specifies one member of
Specifies the index of the query within the query heap.
In Direct3D 12, the usage of queries is more restricted than Direct3D 11. The following scenarios are no longer supported:
Given these restrictions, there are 3 states that a query can be in:
BeginQuery transitions a query from the inactive state to the querying state. EndQuery transitions a query from the querying state to the inactive state. SetPredication transitions the previous set query from the predicating state to the inactive state and transitions the newly set query from the inactive state to the predicating state.
Ends a running query.
Specifies the
Specifies one member of
Specifies the index of the query in the query heap.
Refer to the remarks for BeginQuery, and to Queries.
Extracts data from a query. ResolveQueryData works with all heap types (default, upload, and readback).?
Specifies the
Specifies the type of query, one member of
Specifies an index of the first query to resolve.
Specifies the number of queries to resolve.
Specifies an
Specifies an alignment offset into the destination buffer. Must be a multiple of 8 bytes.
ResolveQueryData performs a batched operation which writes query data into a destination buffer. Query data is written contiguously to the destination buffer, and the parameter.
Binary occlusion queries write 64-bits per query. The least significant bit is either 0 or 1. The rest of the bits are 0.
The core runtime will validate the following:
The debug layer will issue a warning if the destination buffer is not in the
For internal use only.
Internal.
Internal.
Internal.
For internal use only.
Internal.
Internal.
Internal.
For internal use only.
Apps perform indirect draws/dispatches using the ExecuteIndirect method.
Specifies a
There are two ways that command counts can be specified:
Specifies one or more
Specifies an offset into pArgumentBuffer to identify the first command argument.
Specifies a reference to a
Specifies a UINT64 that is the offset into pCountBuffer, identifying the argument count.
The semantics of this API are defined with the following pseudo-code:
Non-
// Read draw count out of count buffer
UINT CommandCount = pCountBuffer->ReadUINT32(CountBufferOffset); CommandCount = min(CommandCount, MaxCommandCount) // Get reference to first Commanding argument
BYTE* Arguments = pArgumentBuffer->GetBase() + ArgumentBufferOffset; for(UINT CommandIndex = 0; CommandIndex < CommandCount; CommandIndex++)
{ // Interpret the data contained in *Arguments // according to the command signature pCommandSignature->Interpret(Arguments); Arguments += pCommandSignature ->GetByteStride();
}
// Get reference to first Commanding argument
BYTE* Arguments = pArgumentBuffer->GetBase() + ArgumentBufferOffset; for(UINT CommandIndex = 0; CommandIndex < MaxCommandCount; CommandIndex++)
{ // Interpret the data contained in *Arguments // according to the command signature pCommandSignature->Interpret(Arguments); Arguments += pCommandSignature ->GetByteStride();
}
The debug layer will issue an error if either the count buffer or the argument buffer are not in the
The functionality of two APIs from earlier versions of Direct3D, DrawInstancedIndirect and DrawIndexedInstancedIndirect, are encompassed by ExecuteIndirect.
Describes a compute pipeline state object.
This structure is used by CreateComputePipelineState.
A reference to the
A reference to the
A
For single GPU operation, set this to zero. If there are multiple GPU nodes, set bits to identify the nodes (the device's physical adapters) for which the compute pipeline state is to apply. Each bit in the mask corresponds to a single node. Refer to Multi-Adapter.
A cached pipeline state object, as a
A
Describes depth-stencil state.
A
This table shows the default values of depth-stencil states.
| State | Default Value |
|---|---|
| DepthEnable | TRUE |
| DepthWriteMask | |
| DepthFunc | D3D12_COMPARISON_LESS |
| StencilEnable | |
| StencilReadMask | D3D12_DEFAULT_STENCIL_READ_MASK |
| StencilWriteMask | D3D12_DEFAULT_STENCIL_WRITE_MASK |
| FrontFace.StencilFunc and BackFace.StencilFunc | D3D12_COMPARISON_ALWAYS |
| FrontFace.StencilDepthFailOp and BackFace.StencilDepthFailOp | |
| FrontFace.StencilPassOp and BackFace.StencilPassOp | |
| FrontFace.StencilFailOp and BackFace.StencilFailOp |
?
The formats that support stenciling are
Specifies whether to enable depth testing. Set this member to TRUE to enable depth testing.
A
A
Specifies whether to enable stencil testing. Set this member to TRUE to enable stencil testing.
Identify a portion of the depth-stencil buffer for reading stencil data.
Identify a portion of the depth-stencil buffer for writing stencil data.
A
A
Represents a virtual adapter; it is used to create command allocators, command lists, command queues, fences, resources, pipeline state objects, heaps, root signatures, samplers, and many resource views.
Use
Gets information about the features that are supported by the current graphics driver.
A
The passed structure is filled with data that describes the feature support. To see the structure types, see the Remarks section in
The size of the structure passed to the pFeatureSupportData parameter.
Returns
Refer to Capability Querying.
Creates a command queue.
Specifies a
The globally unique identifier (
A reference to a memory block that receives a reference to the
The REFIID, or
Creates a command allocator object.
A
The globally unique identifier (
A reference to a memory block that receives a reference to the
The device creates command lists from the command allocator.
This method creates a command signature.
Describes the command signature to be created with the
Specifies the
The globally unique identifier (
Specifies a reference, that on successful completion of the method will point to the created command signature (
Creates both a resource and an implicit heap, such that the heap is big enough to contain the entire resource and the resource is mapped to the heap.
A reference to a
Heap options, as a bitwise-OR'd combination of
A reference to a
The initial state of the resource, as a bitwise-OR'd combination of
When a resource is created together with a
Specifies a
pOptimizedClearValue specifies a value for which clear operations are most optimal. When the created resource is a texture with either the D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET or
The globally unique identifier (
While riidResource is, most commonly, the
A reference to memory that receives the requested interface reference to the created resource object. ppvResource can be
This method creates both a resource and a heap, such that the heap is big enough to contain the entire resource and the resource is mapped to the heap. The created heap is known as an implicit heap, because the heap object cannot be obtained by the application. The application must ensure the GPU will no longer read or write to this resource before releasing the final reference on the resource.
The implicit heap is made resident for GPU access before the method returns to the application. See Residency.
The resource GPU VA mapping cannot be changed. See
This method may be called by multiple threads concurrently.
Creates a compute pipeline state object.
A reference to a
The globally unique identifier (
A reference to a memory block that receives a reference to the
Creates a heap that can be used with placed resources and reserved resources.
A reference to a
The globally unique identifier (
A reference to a memory block that receives a reference to the heap. ppvHeap can be
CreateHeap creates a heap that can be used with placed resources and reserved resources. Before releasing the final reference on the heap, the application must ensure that the GPU will no longer read or write to this heap. Placed resource objects will hold a reference on the heap they are created on, but reserved resources will not hold a reference for each mapping made to a heap.
Creates a query heap. A query heap contains an array of queries.
Specifies the query heap in a
Specifies a REFIID that uniquely identifies the heap.
Specifies a reference to the heap, that will be returned on successful completion of the method. ppvHeap can be
Refer to Queries for more information.
Creates a resource that is placed in a specific heap. Placed resources are the lightest weight resource objects available, and are the fastest to create and destroy.
A reference to the
The offset, in bytes, to the resource. The HeapOffset must be a multiple of the resource's alignment, and HeapOffset plus the resource size must be smaller than or equal to the heap size. GetResourceAllocationInfo must be used to understand the sizes of texture resources.
A reference to a
The initial state of the resource, as a bitwise-OR'd combination of
When a resource is created together with a
Specifies a
pOptimizedClearValue specifies a value for which clear operations are most optimal. When the created resource is a texture with either the
The globally unique identifier (
The REFIID, or
A reference to a memory block that receives a reference to the resource. ppvResource can be
CreatePlacedResource is similar to fully mapping a reserved resource to an offset within a heap; but the virtual address space associated with a heap may be reused as well.
Placed resources are lighter weight than committed resources to create and destroy, because no heap is created or destroyed during this operation. However, placed resources enable an even lighter weight technique to reuse memory than resource creation and destruction: reuse through aliasing and aliasing barriers. Multiple placed resources may simultaneously overlap each other on the same heap, but only a single overlapping resource can be used at a time.
There are two placed resource usage semantics, a simple model and an advanced model. The simple model is recommended, and is the most likely model for tool support, until the advanced model is proven to be required by the app.
Gets the size and alignment of memory required for a collection of resources on this adapter.
For single GPU operation, set this to zero. If there are multiple GPU nodes, set bits to identify the nodes (the device's physical adapters). Each bit in the mask corresponds to a single node. Refer to Multi-Adapter.
The number of resource descriptors in the pResourceDescs array.
An array of
Returns a
When using CreatePlacedResource, the application must use this method to understand the size and alignment characteristics of texture resources. The results of this method vary depending on the particular adapter, and must be treated as unique to this adapter and driver version.
Applications cannot use the output of GetResourceAllocationInfo to understand packed mip properties of textures. To understand packed mip properties of textures, applications must use GetResourceTiling. Texture resource sizes significantly differ from the information returned by GetResourceTiling, because some adapter architectures allocate extra memory for textures to reduce the effective bandwidth during common rendering scenarios. This even includes textures that have constraints on their texture layouts or have standardized texture layouts. That extra memory cannot be sparsely mapped or remapped by an application using CreateReservedResource and UpdateTileMappings, so it isn't reported in GetResourceTiling.
Applications can forgo using GetResourceAllocationInfo for buffer resources (
When multiple resource descriptions are passed in, the C++ algorithm for calculating a structure size and alignment are used. For example, a three-element array with two tiny 64KB-aligned resources and a tiny 4MB-aligned resource reports differing sizes based on the order of the array. If the 4MB aligned resource is in the middle, the resulting Size is 12MB. Otherwise, the resulting Size is 8MB. The Alignment returned would always be 4MB, as it is the superset of all alignments in the resource array.
Gets information about the features that are supported by the current graphics driver.
A
The passed structure is filled with data that describes the feature support. To see the structure types, see the Remarks section in
The size of the structure passed to the pFeatureSupportData parameter.
Returns
Refer to Capability Querying.
Gets information about the features that are supported by the current graphics driver.
A
The passed structure is filled with data that describes the feature support. To see the structure types, see the Remarks section in
The size of the structure passed to the pFeatureSupportData parameter.
Returns
Refer to Capability Querying.
Reports the number of physical adapters (nodes) that are associated with this device.
Gets the reason that the device was removed.
This method ensures the GPU timestamp counter does not stop ticking during idle periods.
For more information on high definition performance measurement, refer to Timing.
Gets a locally unique identifier for the current device (adapter).
This method returns a unique identifier for the adapter that is specific to the adapter hardware. Applications can use this identifier to define robust mappings across various APIs (Direct3D 12, DXGI).
A locally unique identifier (
Reports the number of physical adapters (nodes) that are associated with this device.
The number of physical adapters (nodes) that this device has.
Creates a command queue.
Specifies a
The globally unique identifier (
A reference to a memory block that receives a reference to the
The REFIID, or
Creates a command allocator object.
A
The globally unique identifier (
A reference to a memory block that receives a reference to the
The device creates command lists from the command allocator.
Creates a compute pipeline state object.
A reference to a
The globally unique identifier (
A reference to a memory block that receives a reference to the
Gets information about the features that are supported by the current graphics driver.
A
The passed structure is filled with data that describes the feature support. To see the structure types, see the Remarks section in
The size of the structure passed to the pFeatureSupportData parameter.
Returns
Refer to Capability Querying.
Gets the size of the handle increment for the given type of descriptor heap. This value is typically used to increment a handle into a descriptor array by the correct amount.
The
Returns the size of the handle increment for the given type of descriptor heap, including any necessary padding.
The descriptor size returned by this method is used as one input to the helper structures CD3DX12_CPU_DESCRIPTOR_HANDLE and CD3DX12_GPU_DESCRIPTOR_HANDLE.
Creates a shader-resource view for accessing data in a resource.
A reference to the
A reference to a
Describes the CPU descriptor handle that represents the shader-resource view. This handle can be created in a shader-visible or non-shader-visible descriptor heap.
Creates a view for unordered accessing.
A reference to the
The
If pCounterResource is not specified, the CounterOffsetInBytes member of the
If pCounterResource is specified, then there is a counter associated with the UAV, and the runtime performs validation of the following requirements:
A reference to a
Describes the CPU descriptor handle that represents the start of the heap that holds the unordered-access view.
Creates a render-target view for accessing resource data.
A reference to the
A reference to a
Describes the CPU descriptor handle that represents the start of the heap that holds the render-target view.
Create a sampler object that encapsulates sampling information for a texture.
A reference to a
Describes the CPU descriptor handle that represents the start of the heap that holds the sampler.
Copies descriptors from a source to a destination.
The number of destination descriptor ranges to copy to.
An array of CPU_descriptor_handle objects to copy to.
An array of destination descriptor range sizes to copy to.
The number of source descriptor ranges to copy from.
An array of CPU_descriptor_handle objects to copy from.
An array of source descriptor range sizes to copy from.
The
Copies descriptors from a source to a destination.
The number of descriptors to copy.
A CPU_descriptor_handle that describes the destination descriptors to start to copy to.
A CPU_descriptor_handle that describes the source descriptors to start to copy from.
The
Gets the size and alignment of memory required for a collection of resources on this adapter.
For single GPU operation, set this to zero. If there are multiple GPU nodes, set bits to identify the nodes (the device's physical adapters). Each bit in the mask corresponds to a single node. Refer to Multi-Adapter.
The number of resource descriptors in the pResourceDescs array.
An array of
Returns a
When using CreatePlacedResource, the application must use this method to understand the size and alignment characteristics of texture resources. The results of this method vary depending on the particular adapter, and must be treated as unique to this adapter and driver version.
Applications cannot use the output of GetResourceAllocationInfo to understand packed mip properties of textures. To understand packed mip properties of textures, applications must use GetResourceTiling. Texture resource sizes significantly differ from the information returned by GetResourceTiling, because some adapter architectures allocate extra memory for textures to reduce the effective bandwidth during common rendering scenarios. This even includes textures that have constraints on their texture layouts or have standardized texture layouts. That extra memory cannot be sparsely mapped or remapped by an application using CreateReservedResource and UpdateTileMappings, so it isn't reported in GetResourceTiling.
Applications can forgo using GetResourceAllocationInfo for buffer resources (
When multiple resource descriptions are passed in, the C++ algorithm for calculating a structure size and alignment are used. For example, a three-element array with two tiny 64KB-aligned resources and a tiny 4MB-aligned resource reports differing sizes based on the order of the array. If the 4MB aligned resource is in the middle, the resulting Size is 12MB. Otherwise, the resulting Size is 8MB. The Alignment returned would always be 4MB, as it is the superset of all alignments in the resource array.
Divulges the equivalent custom heap properties that are used for non-custom heap types, based on the adapter's architectural properties.
For single-GPU operation, set this to zero. If there are multiple GPU nodes, set a bit to identify the node (the device's physical adapter). Each bit in the mask corresponds to a single node. Only 1 bit must be set. See Multi-Adapter.
A
Returns a
When
| Heap Type | How the returned |
|---|---|
| CPUPageProperty = WRITE_COMBINE, MemoryPoolPreference = L0. | |
| CPUPageProperty = NOT_AVAILABLE, MemoryPoolPreference = L1. | |
| CPUPageProperty = WRITE_BACK, MemoryPoolPreference = L0. |
?
When D3D12_FEATURE_DATA_ARCHITECTURE::UMA is TRUE and D3D12_FEATURE_DATA_ARCHITECTURE::CacheCoherentUMA is
| Heap Type | How the returned |
|---|---|
| CPUPageProperty = WRITE_COMBINE, MemoryPoolPreference = L0. | |
| CPUPageProperty = NOT_AVAILABLE, MemoryPoolPreference = L0. | |
| CPUPageProperty = WRITE_BACK, MemoryPoolPreference = L0. |
?
When D3D12_FEATURE_DATA_ARCHITECTURE::UMA is TRUE and D3D12_FEATURE_DATA_ARCHITECTURE::CacheCoherentUMA is TRUE, the returned
| Heap Type | How the returned |
|---|---|
| CPUPageProperty = WRITE_BACK, MemoryPoolPreference = L0. | |
| CPUPageProperty = NOT_AVAILABLE, MemoryPoolPreference = L0. | |
| CPUPageProperty = WRITE_BACK, MemoryPoolPreference = L0. |
?
Creates both a resource and an implicit heap, such that the heap is big enough to contain the entire resource and the resource is mapped to the heap.
A reference to a
Heap options, as a bitwise-OR'd combination of
A reference to a
The initial state of the resource, as a bitwise-OR'd combination of
When a resource is created together with a
Specifies a
pOptimizedClearValue specifies a value for which clear operations are most optimal. When the created resource is a texture with either the D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET or
The globally unique identifier (
While riidResource is, most commonly, the
A reference to memory that receives the requested interface reference to the created resource object. ppvResource can be
This method creates both a resource and a heap, such that the heap is big enough to contain the entire resource and the resource is mapped to the heap. The created heap is known as an implicit heap, because the heap object cannot be obtained by the application. The application must ensure the GPU will no longer read or write to this resource before releasing the final reference on the resource.
The implicit heap is made resident for GPU access before the method returns to the application. See Residency.
The resource GPU VA mapping cannot be changed. See
This method may be called by multiple threads concurrently.
Creates a heap that can be used with placed resources and reserved resources.
A reference to a
The globally unique identifier (
A reference to a memory block that receives a reference to the heap. ppvHeap can be
CreateHeap creates a heap that can be used with placed resources and reserved resources. Before releasing the final reference on the heap, the application must ensure that the GPU will no longer read or write to this heap. Placed resource objects will hold a reference on the heap they are created on, but reserved resources will not hold a reference for each mapping made to a heap.
Creates a resource that is placed in a specific heap. Placed resources are the lightest weight resource objects available, and are the fastest to create and destroy.
A reference to the
The offset, in bytes, to the resource. The HeapOffset must be a multiple of the resource's alignment, and HeapOffset plus the resource size must be smaller than or equal to the heap size. GetResourceAllocationInfo must be used to understand the sizes of texture resources.
A reference to a
The initial state of the resource, as a bitwise-OR'd combination of
When a resource is created together with a
Specifies a
pOptimizedClearValue specifies a value for which clear operations are most optimal. When the created resource is a texture with either the
The globally unique identifier (
The REFIID, or
A reference to a memory block that receives a reference to the resource. ppvResource can be
CreatePlacedResource is similar to fully mapping a reserved resource to an offset within a heap; but the virtual address space associated with a heap may be reused as well.
Placed resources are lighter weight than committed resources to create and destroy, because no heap is created or destroyed during this operation. However, placed resources enable an even lighter weight technique to reuse memory than resource creation and destruction: reuse through aliasing and aliasing barriers. Multiple placed resources may simultaneously overlap each other on the same heap, but only a single overlapping resource can be used at a time.
There are two placed resource usage semantics, a simple model and an advanced model. The simple model is recommended, and is the most likely model for tool support, until the advanced model is proven to be required by the app.
Creates a shared handle to an heap, resource, or fence object.
A reference to the
A reference to a
Set this parameter to
The lpSecurityDescriptor member of the structure specifies a SECURITY_DESCRIPTOR for the resource. Set this member to
Currently the only value this parameter accepts is GENERIC_ALL.
A
If Name matches the name of an existing resource, CreateSharedHandle fails with
The name can have a "Global\" or "Local\" prefix to explicitly create the object in the global or session namespace. The remainder of the name can contain any character except the backslash character (\). For more information, see Kernel Object Namespaces. Fast user switching is implemented using Terminal Services sessions. Kernel object names must follow the guidelines outlined for Terminal Services so that applications can support multiple users.
The object can be created in a private namespace. For more information, see Object Namespaces.
A reference to a variable that receives the NT HANDLE value to the resource to share. You can use this handle in calls to access the resource.
Returns
Both heaps and committed resources can be shared. Sharing a committed resource shares the implicit heap along with the committed resource description, such that a compatible resource description can be mapped to the heap from another device.
Opens a handle for shared resources, shared heaps, and shared fences, by using HANDLE and REFIID.
The handle that was output by the call to
The globally unique identifier (
The REFIID, or
A reference to a memory block that receives a reference to one of the following interfaces:
This method returns one of the Direct3D 12 Return Codes.
Opens a handle for shared resources, shared heaps, and shared fences, by using Name and Access.
The name that was optionally passed as the Name parameter in the call to
The access level that was specified in the Access parameter in the call to
Pointer to the shared handle.
This method returns one of the Direct3D 12 Return Codes.
Makes objects resident for the device.
The number of objects in the ppObjects array to make resident for the device.
A reference to a memory block that contains an array of
Even though most D3D12 objects inherit from
This method returns one of the Direct3D 12 Return Codes.
MakeResident loads the data associated with a resource from disk, and re-allocates the memory from the resource's appropriate memory pool. This method should be called on the object which owns the physical memory.
Use this method, and Evict, to manage GPU video memory, noting that this was done automatically in D3D11, but now has to be done by the app in D3D12.
MakeResident and Evict can help applications manage the residency budget on many adapters. MakeResident explicitly pages-in data and, then, precludes page-out so the GPU can access the data. Evict enables page-out.
Some GPU architectures do not benefit from residency manipulation, due to the lack of sufficient GPU virtual address space. Use
Applications must handle MakeResident failures, even if there appears to be enough residency budget available. Physical memory fragmentation and adapter architecture quirks can preclude the utilization of large contiguous ranges. Applications should free up more residency budget before trying again.
MakeResident is ref-counted, such that Evict must be called the same amount of times as MakeResident before Evict takes effect. Objects that support residency are made resident during creation, so a single Evict call will actually evict the object.
Applications must use fences to ensure the GPU doesn't use non-resident objects. MakeResident must return before the GPU executes a command list that references the object. Evict must be called after the GPU finishes executing a command list that references the object.
Evicted objects still consume the same GPU virtual address and same amount of GPU virtual address space. Therefore, resource descriptors and other GPU virtual address references are not invalidated after Evict.
Makes objects resident for the device.
The number of objects in the ppObjects array to make resident for the device.
A reference to a memory block that contains an array of
Even though most D3D12 objects inherit from
This method returns one of the Direct3D 12 Return Codes.
MakeResident loads the data associated with a resource from disk, and re-allocates the memory from the resource's appropriate memory pool. This method should be called on the object which owns the physical memory.
Use this method, and Evict, to manage GPU video memory, noting that this was done automatically in D3D11, but now has to be done by the app in D3D12.
MakeResident and Evict can help applications manage the residency budget on many adapters. MakeResident explicitly pages-in data and, then, precludes page-out so the GPU can access the data. Evict enables page-out.
Some GPU architectures do not benefit from residency manipulation, due to the lack of sufficient GPU virtual address space. Use
Applications must handle MakeResident failures, even if there appears to be enough residency budget available. Physical memory fragmentation and adapter architecture quirks can preclude the utilization of large contiguous ranges. Applications should free up more residency budget before trying again.
MakeResident is ref-counted, such that Evict must be called the same amount of times as MakeResident before Evict takes effect. Objects that support residency are made resident during creation, so a single Evict call will actually evict the object.
Applications must use fences to ensure the GPU doesn't use non-resident objects. MakeResident must return before the GPU executes a command list that references the object. Evict must be called after the GPU finishes executing a command list that references the object.
Evicted objects still consume the same GPU virtual address and same amount of GPU virtual address space. Therefore, resource descriptors and other GPU virtual address references are not invalidated after Evict.
Makes objects resident for the device.
The number of objects in the ppObjects array to make resident for the device.
A reference to a memory block that contains an array of
Even though most D3D12 objects inherit from
This method returns one of the Direct3D 12 Return Codes.
MakeResident loads the data associated with a resource from disk, and re-allocates the memory from the resource's appropriate memory pool. This method should be called on the object which owns the physical memory.
Use this method, and Evict, to manage GPU video memory, noting that this was done automatically in D3D11, but now has to be done by the app in D3D12.
MakeResident and Evict can help applications manage the residency budget on many adapters. MakeResident explicitly pages-in data and, then, precludes page-out so the GPU can access the data. Evict enables page-out.
Some GPU architectures do not benefit from residency manipulation, due to the lack of sufficient GPU virtual address space. Use
Applications must handle MakeResident failures, even if there appears to be enough residency budget available. Physical memory fragmentation and adapter architecture quirks can preclude the utilization of large contiguous ranges. Applications should free up more residency budget before trying again.
MakeResident is ref-counted, such that Evict must be called the same amount of times as MakeResident before Evict takes effect. Objects that support residency are made resident during creation, so a single Evict call will actually evict the object.
Applications must use fences to ensure the GPU doesn't use non-resident objects. MakeResident must return before the GPU executes a command list that references the object. Evict must be called after the GPU finishes executing a command list that references the object.
Evicted objects still consume the same GPU virtual address and same amount of GPU virtual address space. Therefore, resource descriptors and other GPU virtual address references are not invalidated after Evict.
Evict enables the page-out of data, which precludes GPU access of that data.
The number of objects in the ppObjects array to evict from the device.
A reference to a memory block that contains an array of
Even though most D3D12 objects inherit from
This method returns one of the Direct3D 12 Return Codes.
Evict persists the data associated with a resource to disk, and then removes the resource from the memory pool where it was located. This method should be called on the object which owns the physical memory: either a committed resource (which owns both virtual and physical memory assignments) or a heap - noting that reserved resources do not have physical memory, and placed resources are borrowing memory from a heap.
Refer to the remarks for MakeResident.
Evict enables the page-out of data, which precludes GPU access of that data.
The number of objects in the ppObjects array to evict from the device.
A reference to a memory block that contains an array of
Even though most D3D12 objects inherit from
This method returns one of the Direct3D 12 Return Codes.
Evict persists the data associated with a resource to disk, and then removes the resource from the memory pool where it was located. This method should be called on the object which owns the physical memory: either a committed resource (which owns both virtual and physical memory assignments) or a heap - noting that reserved resources do not have physical memory, and placed resources are borrowing memory from a heap.
Refer to the remarks for MakeResident.
Evict enables the page-out of data, which precludes GPU access of that data.
The number of objects in the ppObjects array to evict from the device.
A reference to a memory block that contains an array of
Even though most D3D12 objects inherit from
This method returns one of the Direct3D 12 Return Codes.
Evict persists the data associated with a resource to disk, and then removes the resource from the memory pool where it was located. This method should be called on the object which owns the physical memory: either a committed resource (which owns both virtual and physical memory assignments) or a heap - noting that reserved resources do not have physical memory, and placed resources are borrowing memory from a heap.
Refer to the remarks for MakeResident.
Gets the reason that the device was removed.
This method returns the reason that the device was removed.
Gets a resource layout that can be copied. Helps the app fill-in
This routine assists the application in filling out
Creates a query heap. A query heap contains an array of queries.
Specifies the query heap in a
Specifies a REFIID that uniquely identifies the heap.
Specifies a reference to the heap, that will be returned on successful completion of the method. ppvHeap can be
Refer to Queries for more information.
This method ensures the GPU timestamp counter does not stop ticking during idle periods.
Specifies a
This method returns one of the Direct3D 12 Return Codes.
For more information on high definition performance measurement, refer to Timing.
This method creates a command signature.
Describes the command signature to be created with the
Specifies the
The globally unique identifier (
Specifies a reference, that on successful completion of the method will point to the created command signature (
Gets info about how a tiled resource is broken into tiles.
Specifies a tiled
A reference to a variable that receives the number of tiles needed to store the entire tiled resource.
A reference to a
Specifies a
A reference to a variable that contains the number of tiles in the subresource. On input, this is the number of subresources to query tilings for; on output, this is the number that was actually retrieved at pSubresourceTilingsForNonPackedMips (clamped to what's available).
The number of the first subresource tile to get. GetResourceTiling ignores this parameter if the number that pNumSubresourceTilings points to is 0.
Specifies a
To estimate the total resource size of textures needed when calculating heap sizes and calling CreatePlacedResource, use GetResourceAllocationInfo instead of GetResourceTiling. GetResourceTiling cannot be used for this.
For more information on tiled resources, refer to Volume Tiled Resources.
Gets a locally unique identifier for the current device (adapter).
The locally unique identifier for the adapter.
This method returns a unique identifier for the adapter that is specific to the adapter hardware. Applications can use this identifier to define robust mappings across various APIs (Direct3D 12, DXGI).
A locally unique identifier (
Specifies RGB or alpha blending operations.
The runtime implements RGB blending and alpha blending separately. Therefore, blend state requires separate blend operations for RGB data and alpha data. These blend operations are specified in a
Blend state is used by the output-merger stage to determine how to blend together two RGB pixel values and two alpha values. The two RGB pixel values and two alpha values are the RGB pixel value and alpha value that the pixel shader outputs and the RGB pixel value and alpha value already in the output render target. The
Add source 1 and source 2.
Subtract source 1 from source 2.
Subtract source 2 from source 1.
Find the minimum of source 1 and source 2.
Find the maximum of source 1 and source 2.
Specifies blend factors, which modulate values for the pixel shader and render target.
Source and destination blend operations are specified in a
The blend factor is (0, 0, 0, 0). No pre-blend operation.
The blend factor is (1, 1, 1, 1). No pre-blend operation.
The blend factor is (R?, G?, B?, A?), that is color data (RGB) from a pixel shader. No pre-blend operation.
The blend factor is (1 - R?, 1 - G?, 1 - B?, 1 - A?), that is color data (RGB) from a pixel shader. The pre-blend operation inverts the data, generating 1 - RGB.
The blend factor is (A?, A?, A?, A?), that is alpha data (A) from a pixel shader. No pre-blend operation.
The blend factor is ( 1 - A?, 1 - A?, 1 - A?, 1 - A?), that is alpha data (A) from a pixel shader. The pre-blend operation inverts the data, generating 1 - A.
The blend factor is (Ad Ad Ad Ad), that is alpha data from a render target. No pre-blend operation.
The blend factor is (1 - Ad 1 - Ad 1 - Ad 1 - Ad), that is alpha data from a render target. The pre-blend operation inverts the data, generating 1 - A.
The blend factor is (Rd, Gd, Bd, Ad), that is color data from a render target. No pre-blend operation.
The blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad), that is color data from a render target. The pre-blend operation inverts the data, generating 1 - RGB.
The blend factor is (f, f, f, 1); where f = min(A?, 1 - Ad). The pre-blend operation clamps the data to 1 or less.
The blend factor is the blend factor set with
The blend factor is the blend factor set with
The blend factor is data sources both as color data output by a pixel shader. There is no pre-blend operation. This blend factor supports dual-source color blending.
The blend factor is data sources both as color data output by a pixel shader. The pre-blend operation inverts the data, generating 1 - RGB. This blend factor supports dual-source color blending.
The blend factor is data sources as alpha data output by a pixel shader. There is no pre-blend operation. This blend factor supports dual-source color blending.
The blend factor is data sources as alpha data output by a pixel shader. The pre-blend operation inverts the data, generating 1 - A. This blend factor supports dual-source color blending.
Identifies how to view a buffer resource.
This enumeration is used by
Indicates a default view.
View the buffer as raw. For more info about raw viewing of buffers, see Raw Views of Buffers.
Identifies unordered-access view options for a buffer resource.
This enum is used in the
Indicates a default view.
Resource contains raw, unstructured data. Requires the UAV format to be
Specifies what to clear from the depth stencil view.
This enum is used by
Indicates the depth buffer should be cleared.
Indicates the stencil buffer should be cleared.
Identifies which components of each pixel of a render target are writable during blending.
This enum is used by the
Allow data to be stored in the red component.
Allow data to be stored in the green component.
Allow data to be stored in the blue component.
Allow data to be stored in the alpha component.
Allow data to be stored in all components.
Specifies the type of a command list.
This enum is used by the following methods:
Specifies a command buffer that the GPU can execute. A direct command list doesn't inherit any GPU state.
Specifies a command buffer that can be executed only directly via a direct command list. A bundle command list inherits all GPU state (except for the currently set pipeline state object and primitive topology).
Specifies a command buffer for computing.
Specifies a command buffer for copying (drawing).
Specifies flags to be used when creating a command queue.
This enum is used by the
Indicates a default command queue.
Indicates that the GPU timeout should be disabled for this command queue.
Defines priority levels for a command queue.
This enumeration is used by the Priority member of the
Normal priority.
High priority.
Specifies comparison options.
A comparison option determines how the runtime compares source (new) data against destination (existing) data before storing the new data. The comparison option is declared in a description before an object is created. The API allows you to set a comparison option for
Never pass the comparison.
If the source data is less than the destination data, the comparison passes.
If the source data is equal to the destination data, the comparison passes.
If the source data is less than or equal to the destination data, the comparison passes.
If the source data is greater than the destination data, the comparison passes.
If the source data is not equal to the destination data, the comparison passes.
If the source data is greater than or equal to the destination data, the comparison passes.
Always pass the comparison.
Identifies whether conservative rasterization is on or off.
This enum is used by the
Conservative rasterization is off.
Conservative rasterization is on.
Identifies the tier level of conservative rasterization.
This enum is used by the
Conservative rasterization is not supported.
Tier 1 enforces a maximum 1/2 pixel uncertainty region and does not support post-snap degenerates. This is good for tiled rendering, a texture atlas, light map generation and sub-pixel shadow maps.
Tier 2 reduces the maximum uncertainty region to 1/256 and requires post-snap degenerates not be culled. This tier is helpful for CPU-based algorithm acceleration (such as voxelization).
Tier 3 maintains a maximum 1/256 uncertainty region and adds support for inner input coverage. Inner input coverage adds the new value SV_InnerCoverage to High Level Shading Language (HLSL). This is a 32-bit scalar integer that can be specified on input to a pixel shader, and represents the underestimated conservative rasterization information (that is, whether a pixel is guaranteed-to-be-fully covered). This tier is helpful for occlusion culling.
Specifies the CPU-page properties for the heap.
This enum is used by the
The CPU-page property is unknown.
The CPU cannot access the heap, therefore no page properties are available.
The CPU-page property is write-combined.
The CPU-page property is write-back.
Specifies the level of sharing across nodes of an adapter, such as Tier 1 Emulated, Tier 1, or Tier 2.
This enum is used by the CrossNodeSharingTier member of the
If an adapter only has 1 node, then cross-node sharing doesn't apply, so the CrossNodeSharingTier member of the
Tier 1 Emulated. Devices that set the CrossNodeSharingTier member of the
Tier 1. Devices that set the CrossNodeSharingTier member of the
Additionally, the cross-node resource must be the destination of the copy operation.
Tier 2. Devices that set the CrossNodeSharingTier member of the
Applications can retrieve the node where a resource/heap exists from the
Specifies triangles facing a particular direction are not drawn.
Cull mode is specified in a
Always draw all triangles.
Do not draw triangles that are front-facing.
Do not draw triangles that are back-facing.
Specifies flags to turn debug features on or off, such as treating a bundle as a draw or a dispatch.
This enum is used by
Indicates that no flags are specified.
Treat the bundle as a draw.
Treat the bundle as a dispatch.
Specifies how to access a resource used in a depth-stencil view.
This enumeration is used in
The resource will be accessed as a 1D texture.
The resource will be accessed as an array of 1D textures.
The resource will be accessed as a 2D texture.
The resource will be accessed as an array of 2D textures.
The resource will be accessed as a 2D texture with multisampling.
The resource will be accessed as an array of 2D textures with multisampling.
Specifies depth-stencil view options.
Specify a combination of the values in this enumeration in the Flags member of a
Limiting a depth-stencil buffer to read-only access allows more than one depth-stencil view to be bound to the pipeline simultaneously, since it is not possible to have read/write conflicts between separate views.
Indicates a default view.
Indicates that depth values are read only.
Indicates that stencil values are read only.
Identifies the portion of a depth-stencil buffer for writing depth data.
This enum is used by the
Turn off writes to the depth-stencil buffer.
Turn on writes to the depth-stencil buffer.
Specifies options for a heap.
This enum is used by the
Indicates default usage of a heap.
Specifies the heap is bound on a command list for reference by shaders. This flag doesn?t apply to other descriptor heap types because shaders don?t directly reference the other types.
Specifies a type of descriptor heap.
This enum is used by the
The descriptor heap for the combination of constant-buffer, shader-resource, and unordered-access views.
The descriptor heap for the sampler.
The descriptor heap for the render-target view.
The descriptor heap for the depth-stencil view.
The number of types of descriptor heaps.
Specifies a range so that, for example, if part of a descriptor table has 100 shader-resource views (SRVs) that range can be declared in one entry rather than 100.
This enum is used by the
Specifies a range of SRVs.
Specifies a range of unordered-access views (UAVs).
Specifies a range of constant-buffer views (CBVs).
Specifies a range of samplers.
Specifies fence options.
This enum is used by the
No options are specified.
The fence is shared.
The fence is shared with another GPU adapter.
Specifies the fill mode to use when rendering triangles.
Fill mode is specified in a
Draw lines connecting the vertices. Adjacent vertices are not drawn.
Fill the triangles formed by the vertices. Adjacent vertices are not drawn.
Specifies filtering options during texture sampling.
This enum is used by the
During texture sampling, one or more texels are read and combined (this is calling filtering) to produce a single value. Point sampling reads a single texel while linear sampling reads two texels (endpoints) and linearly interpolates a third value between the endpoints.
Microsoft High Level Shader Language (HLSL) texture-sampling functions also support comparison filtering during texture sampling. Comparison filtering compares each sampled texel against a comparison value. The boolean result is blended the same way that normal texture filtering is blended.
You can use HLSL intrinsic texture-sampling functions that implement texture filtering only or companion functions that use texture filtering with comparison filtering.
Also note the following defines:
#define D3D12_FILTER_REDUCTION_TYPE_MASK ( 0x3 ) #define D3D12_FILTER_REDUCTION_TYPE_SHIFT ( 7 ) #define D3D12_FILTER_TYPE_MASK ( 0x3 ) #define D3D12_MIN_FILTER_SHIFT ( 4 ) #define D3D12_MAG_FILTER_SHIFT ( 2 ) #define D3D12_MIP_FILTER_SHIFT ( 0 ) #define D3D12_ANISOTROPIC_FILTERING_BIT ( 0x40 ) #define D3D12_ENCODE_BASIC_FILTER( min, mag, mip, reduction ) \ ( ( ) ( \ ( ( ( min ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MIN_FILTER_SHIFT ) | \ ( ( ( mag ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MAG_FILTER_SHIFT ) | \ ( ( ( mip ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MIP_FILTER_SHIFT ) | \ ( ( ( reduction ) & D3D12_FILTER_REDUCTION_TYPE_MASK ) << D3D12_FILTER_REDUCTION_TYPE_SHIFT ) ) )
#define D3D12_ENCODE_ANISOTROPIC_FILTER( reduction ) \ ( ( ) ( \ D3D12_ANISOTROPIC_FILTERING_BIT | \ D3D12_ENCODE_BASIC_FILTER( , \ , \ , \ reduction ) ) )
#define D3D12_DECODE_MIN_FILTER( D3D12Filter ) \ ( ( ) \ ( ( ( D3D12Filter ) >> D3D12_MIN_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) )
#define D3D12_DECODE_MAG_FILTER( D3D12Filter ) \ ( ( ) \ ( ( ( D3D12Filter ) >> D3D12_MAG_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) )
#define D3D12_DECODE_MIP_FILTER( D3D12Filter ) \ ( ( ) \ ( ( ( D3D12Filter ) >> D3D12_MIP_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) )
#define D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) \ ( ( ) \ ( ( ( D3D12Filter ) >> D3D12_FILTER_REDUCTION_TYPE_SHIFT ) & D3D12_FILTER_REDUCTION_TYPE_MASK ) )
#define D3D12_DECODE_IS_COMPARISON_FILTER( D3D12Filter ) \ ( D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) == )
#define D3D12_DECODE_IS_ANISOTROPIC_FILTER( D3D12Filter ) \ ( ( ( D3D12Filter ) & D3D12_ANISOTROPIC_FILTERING_BIT ) && \ ( == D3D12_DECODE_MIN_FILTER( D3D12Filter ) ) && \ ( == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) && \ ( == D3D12_DECODE_MIP_FILTER( D3D12Filter ) ) ) | Texture Sampling Function | Texture Sampling Function with Comparison Filtering |
|---|---|
| Sample | SampleCmp or SampleCmpLevelZero |
?
Comparison filters only work with textures that have the following formats:
Use point sampling for minification, magnification, and mip-level sampling.
Use point sampling for minification and magnification; use linear interpolation for mip-level sampling.
Use point sampling for minification; use linear interpolation for magnification; use point sampling for mip-level sampling.
Use point sampling for minification; use linear interpolation for magnification and mip-level sampling.
Use linear interpolation for minification; use point sampling for magnification and mip-level sampling.
Use linear interpolation for minification; use point sampling for magnification; use linear interpolation for mip-level sampling.
Use linear interpolation for minification and magnification; use point sampling for mip-level sampling.
Use linear interpolation for minification, magnification, and mip-level sampling.
Use anisotropic interpolation for minification, magnification, and mip-level sampling.
Use point sampling for minification, magnification, and mip-level sampling. Compare the result to the comparison value.
Use point sampling for minification and magnification; use linear interpolation for mip-level sampling. Compare the result to the comparison value.
Use point sampling for minification; use linear interpolation for magnification; use point sampling for mip-level sampling. Compare the result to the comparison value.
Use point sampling for minification; use linear interpolation for magnification and mip-level sampling. Compare the result to the comparison value.
Use linear interpolation for minification; use point sampling for magnification and mip-level sampling. Compare the result to the comparison value.
Use linear interpolation for minification; use point sampling for magnification; use linear interpolation for mip-level sampling. Compare the result to the comparison value.
Use linear interpolation for minification and magnification; use point sampling for mip-level sampling. Compare the result to the comparison value.
Use linear interpolation for minification, magnification, and mip-level sampling. Compare the result to the comparison value.
Use anisotropic interpolation for minification, magnification, and mip-level sampling. Compare the result to the comparison value.
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Fetch the same set of texels as
Specifies the type of filter reduction.
This enum is used by the
The filter type is standard.
The filter type is comparison.
The filter type is minimum.
The filter type is maximum.
Specifies the type of magnification or minification sampler filters.
This enum is used by the
Point filtering is used as a texture magnification or minification filter. The texel with coordinates nearest to the desired pixel value is used. The texture filter to be used between mipmap levels is nearest-point mipmap filtering. The rasterizer uses the color from the texel of the nearest mipmap texture.
Bilinear interpolation filtering is used as a texture magnification or minification filter. A weighted average of a 2 x 2 area of texels surrounding the desired pixel is used. The texture filter to use between mipmap levels is trilinear mipmap interpolation. The rasterizer linearly interpolates pixel color, using the texels of the two nearest mipmap textures.
Specifies resources that are supported for a provided format.
This enum is used by the
No resources are supported.
Buffer resources supported.
Vertex buffers supported.
Index buffers supported.
Streaming output buffers supported.
1D texture resources supported.
2D texture resources supported.
3D texture resources supported.
Cube texture resources supported.
The HLSL Load function for texture objects is supported.
The HLSL Sample function for texture objects is supported.
Note??If the device supports the format as a resource (1D, 2D, 3D, or cube map) but doesn't support this option, the resource can still use the Sample method but must use only the point filtering sampler state to perform the sample. ?The HLSL SampleCmp and SampleCmpLevelZero functions for texture objects are supported.
Note??Windows?8 and later might provide limited support for these functions on Direct3D feature levels 9_1, 9_2, and 9_3. For more info, see Implementing shadow buffers for Direct3D feature level 9. ?Reserved.
Mipmaps are supported.
Render targets are supported.
Blend operations supported.
Depth stencils supported.
Multisample antialiasing (MSAA) resolve operations are supported. For more info, see
Format can be displayed on screen.
Format can't be cast to another format.
Format can be used as a multi-sampled render target.
Format can be used as a multi-sampled texture and read into a shader with the HLSL Load function.
Format can be used with the HLSL gather function. This value is available in DirectX 10.1 or higher.
Format supports casting when the resource is a back buffer.
Format can be used for an unordered access view.
Format can be used with the HLSL gather with comparison function.
Format can be used with the decoder output.
Format can be used with the video processor output.
Format can be used with the video processor input.
Format can be used with the video encoder.
Specifies which unordered resource options are supported for a provided format.
This enum is used by the
No unordered resource options are supported.
Format supports atomic add.
Format supports atomic bitwise operations.
Format supports atomic compare with store or exchange.
Format supports atomic exchange.
Format supports atomic min and max.
Format supports atomic unsigned min and max.
Format supports a typed load.
Format supports a typed store.
Format supports logic operations in blend state.
Format supports tiled resources. Refer to Volume Tiled Resources.
Format supports multi-plane overlays.
Specifies heap options, such as whether the heap can contain textures, and whether resources are shared across adapters.
This enum is used by the following API items:
The following heap flags must be used with
Adapters that only support heap tier 1 must set two out of the three following flags.
| Value | Description |
|---|---|
| The heap isn't allowed to contain resources with | |
| The heap isn't allowed to contain resources with | |
| The heap isn't allowed to contain resources with |
?
Adapters that support heap tier 2 or greater are additionally allowed to set none of the above flags. Aliases for these flags are available for applications that prefer thinking only of which resources are supported.
The following aliases exist, so be careful when doing bit-manipulations:
No options are specified.
The heap is shared. Refer to Shared Heaps.
The heap isn't allowed to contain buffers.
The heap is allowed to contain swap-chain surfaces.
The heap is allowed to share resources across adapters. Refer to Shared Heaps.
The heap is not allowed to store Render Target (RT) and/or Depth-Stencil (DS) textures.
The heap is not allowed to store non-RT, non-DS textures.
The heap is allowed to store all types of buffers and/or textures. This is an alias; for more details, see "aliases" in the Remarks section.
The heap is only allowed to store buffers. This is an alias; for more details, see "aliases" in the Remarks section.
The heap is only allowed to store non-RT, non-DS textures. This is an alias; for more details, see "aliases" in the Remarks section.
The heap is only allowed to store RT and/or DS textures. This is an alias; for more details, see "aliases" in the Remarks section.
Specifies the type of heap. When resident, heaps reside in a particular physical memory pool with certain CPU cache properties.
This enum is used by the following API items:
The heap types fall into two categories: abstracted heap types, and custom heap types.
The following are abstracted heap types:
The following is a custom heap type:
The abstracted heap types (_DEFAULT, _UPLOAD, and _READBACK) are useful to simplify writing adapter-neutral applications, because such applications don't need to be aware of the adapter memory architecture. To use an abstracted heap type to simplify writing adapter-neutral applications, the application essentially treats the adapter as if it were a discrete or NUMA adapter. But, using the heap types enables efficient translation for UMA adapters. Adapter architecture neutral applications should assume there are two memory pools available, where the pool with the most GPU bandwidth cannot provide CPU access. The pool with the least GPU bandwidth can have CPU access; but must be either optimized for upload to GPU or readback from GPU.
Specifies the default heap. This heap type experiences the most bandwidth for the GPU, but cannot provide CPU access. The GPU can read and write to the memory from this pool, and resource transition barriers may be changed. The majority of heaps and resources are expected to be located here, and are typically populated through resources in upload heaps.
Specifies a heap used for uploading. This heap type has CPU access optimized for uploading to the GPU, but does not experience the maximum amount of bandwidth for the GPU. This heap type is best for CPU-write-once, GPU-read-once data; but GPU-read-once is stricter than necessary. GPU-read-once-or-from-cache is an acceptable use-case for the data; but such usages are hard to judge due to differing GPU cache designs and sizes. If in doubt, stick to the GPU-read-once definition or profile the difference on many GPUs between copying the data to a _DEFAULT heap vs. reading the data from an _UPLOAD heap.
Resources in this heap must be created with D3D12_RESOURCE_STATE_GENERIC_READ and cannot be changed away from this. The CPU address for such heaps is commonly not efficient for CPU reads.
The following are typical usages for _UPLOAD heaps:
The following are likely not good usages for _UPLOAD heaps:
Specifies a heap used for reading back. This heap type has CPU access optimized for reading data back from the GPU, but does not experience the maximum amount of bandwidth for the GPU. This heap type is best for GPU-write-once, CPU-readable data. The CPU cache behavior is write-back, which is conducive for multiple sub-cache-line CPU reads.
Resources in this heap must be created with D3D12_RESOURCE_STATE_COPY_DEST, and cannot be changed away from this.
Specifies a custom heap. The application may specify the memory pool and CPU cache properties directly, which can be useful for UMA optimizations, multi-engine, multi-adapter, or other special cases. To do so, the application is expected to understand the adapter architecture to make the right choice. For more details, see
When using triangle strip primitive topology, vertex positions are interpreted as vertices of a continuous triangle ?strip?. There is a special index value that represents the desire to have a discontinuity in the strip, the cut index value. This enum lists the supported cut values.
This enum is used by the
Indicates that there is no cut value.
Indicates that 0xFFFF should be used as the cut value.
Indicates that 0xFFFFFFFF should be used as the cut value.
Specifies the type of the indirect parameter.
This enum is used by the
Indicates the type is a Draw call.
Indicates the type is a DrawIndexed call.
Indicates the type is a Dispatch call.
Indicates the type is a vertex buffer view.
Indicates the type is an index buffer view.
Indicates the type is a constant.
Indicates the type is a constant buffer view (CBV).
Indicates the type is a shader resource view (SRV).
Indicates the type is an unordered access view (UAV).
Identifies the type of data contained in an input slot.
Specify one of these values in the member of a
Input data is per-vertex data.
Input data is per-instance data.
Specifies logical operations to configure for a render target.
This enum is used by the
Clears the render target.
Sets the render target.
Copys the render target.
Performs an inverted-copy of the render target.
No operation is performed on the render target.
Inverts the render target.
Performs a logical AND operation on the render target.
Performs a logical NAND operation on the render target.
Performs a logical OR operation on the render target.
Performs a logical NOR operation on the render target.
Performs a logical XOR operation on the render target.
Performs a logical equal operation on the render target.
Performs a logical AND and reverse operation on the render target.
Performs a logical AND and invert operation on the render target.
Performs a logical OR and reverse operation on the render target.
Performs a logical OR and invert operation on the render target.
Specifies the memory pool for the heap.
This enum is used by the
When the adapter is UMA,
the adapter is not UMA:
The memory pool is unknown.
The memory pool is L0. L0 is the physical system memory pool. When the adapter is discrete/NUMA, this pool has greater bandwidth for the CPU and less bandwidth for the GPU. When the adapter is UMA, this pool is the only one which is valid.
The memory pool is L1. L1 is typically known as the physical video memory pool. L1 is only available when the adapter is discrete/NUMA, and has greater bandwidth for the GPU and cannot even be accessed by the CPU. When the adapter is UMA, this pool is not available.
Specifies categories of debug messages. This will identify the category of a message when retrieving a message with
This is part of the Information Queue feature, refer to the
Specifies debug message IDs for setting up an info-queue filter (see
This enum is used by AddMessage.
Debug message severity levels for an information queue.
Use these values to allow or deny message categories to pass through the storage and retrieval filters for an information queue (see
Indicates a corruption error.
Indicates an error.
Indicates a warning.
Indicates an information message.
Indicates a message other than corruption, error, warning or information.
Specifies options for determining quality levels.
This enum is used by the
No options are supported.
The number of quality levels can be determined for tiled resources.
Flags to control pipeline state.
This enum is used by the Flags member of the
Indicates no flags.
Indicates that the pipeline state should be compiled with additional information to assist debugging.
Specifies the predication operation to apply.
This enum is used by SetPredication.
Predication is decoupled from queries. Predication can be set based on the value of 64-bits within a buffer.
Enables predication if all 64-bits are zero.
Enables predication if at least one of the 64-bits are not zero.
Specifies how the pipeline interprets geometry or hull shader input primitives.
This enum is used by the
The shader has not been initialized with an input primitive type.
Interpret the input primitive as a point.
Interpret the input primitive as a line.
Interpret the input primitive as a triangle.
Interpret the input primitive as a control point patch.
Specifies the type of query heap to create.
This enum is used by the
This returns a binary 0/1 result: 0 indicates that no samples passed depth and stencil testing, 1 indicates that at least one sample passed depth and stencil testing. This enables occlusion queries to not interfere with any GPU performance optimization associated with depth/stencil testing.
Indicates that the heap is for high-performance timing data.
Indicates the heap is to contain pipeline data. Refer to
Indicates the heap is to contain stream output data. Refer to
Specifies the type of query.
This enum is used by BeginQuery, EndQuery and ResolveQueryData.
Indicates the query is for depth/stencil occlusion counts.
Indicates the query is for a binary depth/stencil occlusion statistics.
This new query type acts like
Indicates the query is for high definition GPU and CPU timestamps.
Indicates the query type is for graphics pipeline statistics, refer to
Stream 0 output statistics. In Direct3D 12 there is no single stream output (SO) overflow query for all the output streams. Apps need to issue multiple single-stream queries, and then correlate the results. Stream output is the ability of the GPU to write vertices to a buffer. The stream output counters monitor progress.
Stream 1 output statistics.
Stream 2 output statistics.
Stream 3 output statistics.
Identifies the type of resource to view as a render target.
Specify one of the values in this enumeration in the ViewDimension member of a
Do not use this value, as it will cause
The resource will be accessed as a buffer.
The resource will be accessed as a 1D texture.
The resource will be accessed as an array of 1D textures.
The resource will be accessed as a 2D texture.
The resource will be accessed as an array of 2D textures.
The resource will be accessed as a 2D texture with multisampling.
The resource will be accessed as an array of 2D textures with multisampling.
The resource will be accessed as a 3D texture.
Flags for setting split resource barriers.
Split barriers allow a single transition to be split into begin and end halves (refer to Synchronization and Multi-Engine).
This enum is used by the Flags member of the
No flags.
This starts a barrier transition in a new state, putting a resource in a temporary no-access condition.
This barrier completes a transition, setting a new state and restoring active access to a resource.
Specifies a type of resource barrier (transition in resource use) description.
This enum is used in the
A transition barrier that indicates a transition of a set of subresources between different usages. The caller must specify the before and after usages of the subresources.
An aliasing barrier that indicates a transition between usages of 2 different resources that have mappings into the same tile pool. The caller can specify both the before and the after resource. Note that one or both resources can be
An unordered access view (UAV) barrier that indicates all UAV accesses (reads or writes) to a particular resource must complete before any future UAV accesses (read or write) can begin.
Identifies the type of resource being used.
This enum is used by the
Resource is of unknown type.
Resource is a buffer.
Resource is a 1D texture.
Resource is a 2D texture.
Resource is a 3D texture.
Specifies options for working with resources.
This enum is used by the Flags member of the
No options are specified.
Allows a render target view to be created for the resource, as well as enables the resource to transition into the state of
The following restrictions and interactions apply:
Allows a depth stencil view to be created for the resource, as well as enables the resource to transition into the state of
The following restrictions and interactions apply:
Allows an unordered access view to be created for the resource, as well as enables the resource to transition into the state of
The following restrictions and interactions apply:
Disallows a shader resource view to be created for the resource, as well as disables the resource to transition into the state of
The following restrictions and interactions apply:
Allows the resource to be used for cross-adapter data, as well as the same features enabled by ALLOW_SIMULTANEOUS_ACCESS. Cross adapter resources commonly preclude techniques that reduce effective texture bandwidth during usage, and some adapter architectures may require different caching behavior. Applications should avoid setting this flag when the resource data will never be used with another adapter.
The following restrictions and interactions apply:
Allows a resource to be simultaneously accessed by multiple different queues, devices or processes (for example, allows a resource to be used with ResourceBarrier transitions performed in more than one command list executing at the same time).
Simultaneous access allows multiple readers and one writer, as long as the writer doesn't concurrently modify the texels that other readers are accessing. Some adapter architectures cannot leverage techniques to reduce effective texture bandwidth during usage.
However, applications should avoid setting this flag when multiple readers are not required during frequent, non-overlapping writes to textures. Use of this flag can compromise resource fences to perform waits, and prevents any compression being used with a resource.
The following restrictions and interactions apply:
Specifies which resource heap tier the hardware and driver support.
This enum is used by the ResourceHeapTier member of the
This enum specifies which resource heap tier the hardware and driver support. Lower tiers require more heap attribution than greater tiers.
Resources can be categorized into the following types:
Indicates that heaps can only support resources from a single resource category. For the list of resource categories, see Remarks. In tier 1, these resource categories are mutually exclusive and cannot be used with the same heap. The resource category must be declared when creating a heap, using the correct
Indicates that heaps can support resources from all three categories. For the list of resource categories, see Remarks. In tier 2, these resource categories can be mixed within the same heap. Applications may create heaps with flags that allow all three categories; but are not required to do so. Applications may be written to support tier 1 and seamlessly run on tier 2.
Specifies the state of a resource regarding how the resource is being used.
This enum is used by the following methods:
A common, general state.
This is the recommended initial state for resources that do not have a more specific known or planned initial state (though note that command lists must be aware of initial states).
Textures must be in this COMMON state for CPU access to be legal; but buffers do not. CPU access to a resource is typically done through Map/Unmap.
To use a resource initially on a Copy queue, the resource should start in this COMMON state. The COMMON state can be used for all usages on a Copy queue using the implicit state transitions. For more information, in Synchronization and Multi-Engine, find "common".
A subresource must be in this state when it is accessed by the 3D pipeline as a vertex buffer or constant buffer. This is a read/write state.
A subresource must be in this state when it is accessed by the 3D pipeline as an index buffer. This is a read/write state.
The resource is used as a render target. A subresource must be in this state when it is rendered to or when it is cleared with
The resource is used for unordered access. A subresource must be in this state when it is accessed by the 3D pipeline via an unordered access view. A subresource must also be in this state when it is cleared with ID3D12GraphicsCommandList::ClearUnorderedAccessViewInt or
DEPTH_WRITE is a state which is mutually exclusive with other states. It should be used for
DEPTH_READ is a state which can be combined with other states. It should be used when the subresource is in a read-only depth stencil view, or when the DepthEnable parameter of
The resource is used with a shader other than the pixel shader. A subresource must be in this state before being read by any stage (except for the pixel shader stage) via a shader resource view. You can still use the resource in a pixel shader with this flag as long as it also has the flag
The resource is used with a pixel shader. A subresource must be in this state before being read by the pixel shader via a shader resource view. This is a read-only state.
The resource is used with stream output. A subresource must be in this state when it is accessed by the 3D pipeline as a stream-out target. This is a read/write state.
The resource is used as an indirect argument. Subresources must be in this state when they are used as the argument buffer passed to the indirect drawing method
The resource is used as the destination in a copy operation. Subresources must be in this state when they are used as the destination of copy operation, or a blt operation. This is a read/write state.
The resource is used as the source in a copy operation. Subresources must be in this state when they are used as the source of copy operation, or a blt operation. This is a read-only state.
The resource is used as the destination in a resolve operation.
The resource is used as the source in a resolve operation.
The resource is used in a read operation.
Synonymous with
The resource is used for Predication.
Specifies options for the amount of information to report about a device object's lifetime.
This enumeration is used by
Obtain a summary about a device object's lifetime.
Obtain detailed information about a device object's lifetime.
Internal use only.
Specifies the type of root signature slot.
This enum is used by the
The slot is for a descriptor table.
The slot is for root constants.
The slot is for a constant-buffer view (CBV).
The slot is for a shader-resource view (SRV).
The slot is for a unordered-access view (UAV).
Specifies options for root signature layout.
This enum is used in the
The value in denying access to shader stages is a minor optimization on some hardware. If, for example, the
Indicates default behavior.
The app is opting in to using the Input Assembler (requiring an input layout that defines a set of vertex buffer bindings). Omitting this flag can result in one root argument space being saved on some hardware. Omit this flag if the Input Assembler is not required, though the optimization is minor.
Denies the vertex shader access to the root signature.
Denies the hull shader access to the root signature.
Denies the domain shader access to the root signature.
Denies the geometry shader access to the root signature.
Denies the pixel shader access to the root signature.
The root signature allows stream output. This flag can be specified for root signatures authored in HLSL, similar to how the other flags are specified.
Specifies the version of root signature layout.
This enum is used by the
Version one of root signature layout.
Specifies how memory gets routed by a shader resource view (SRV).
This enum allows the SRV to select how memory gets routed to the four return components in a shader after a memory fetch. The options for each shader component [0..3] (corresponding to RGBA) are: component 0..3 from the SRV fetch result or force 0 or force 1.
The default 1:1 mapping can be indicated by specifying D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING, otherwise an arbitrary mapping can be specified using the macro D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING. See below.
Note the following defines:
#define D3D12_SHADER_COMPONENT_MAPPING_MASK 0x7
#define D3D12_SHADER_COMPONENT_MAPPING_SHIFT 3
#define D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES (1<<(D3D12_SHADER_COMPONENT_MAPPING_SHIFT*4))
#define D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(Src0,Src1,Src2,Src3) ((((Src0)&D3D12_SHADER_COMPONENT_MAPPING_MASK)| \ (((Src1)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<<D3D12_SHADER_COMPONENT_MAPPING_SHIFT)| \ (((Src2)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<<(D3D12_SHADER_COMPONENT_MAPPING_SHIFT*2))| \ (((Src3)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<<(D3D12_SHADER_COMPONENT_MAPPING_SHIFT*3))| \ D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES))
#define D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(ComponentToExtract,Mapping) (( )(Mapping >> (D3D12_SHADER_COMPONENT_MAPPING_SHIFT*ComponentToExtract) & D3D12_SHADER_COMPONENT_MAPPING_MASK))
#define D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0,1,2,3)
Indicates return component 0 (red).
Indicates return component 1 (green).
Indicates return component 2 (blue).
Indicates return component 3 (alpha).
Indicates forcing the resulting value to 0.
Indicates forcing the resulting value 1. The value of forcing 1 is either 0x1 or 1.0f depending on the format type for that component in the source format.
Describes minimum precision support options for shaders in the current graphics driver.
This enum is used by the
The returned info just indicates that the graphics hardware can perform HLSL operations at a lower precision than the standard 32-bit float precision, but doesn?t guarantee that the graphics hardware will actually run at a lower precision.
The driver supports only full 32-bit precision for all shader stages.
The driver supports 10-bit precision.
The driver supports 16-bit precision.
These flags identify the type of resource that will be viewed as a shader resource.
These flags are used by a shader-resource-view description (see
The D3D11_SRV_DIMENSION enumeration is type defined in the D3D11.h header file as a
typedefD3D11_SRV_DIMENSION;
The type is unknown.
The resource is a buffer.
The resource is a 1D texture.
The resource is an array of 1D textures.
The resource is a 2D texture.
The resource is an array of 2D textures.
The resource is a multisampling 2D texture.
The resource is an array of multisampling 2D textures.
The resource is a 3D texture.
The resource is a cube texture.
The resource is an array of cube textures.
Specifies the shaders that can access the contents of a given root signature slot.
This enum is used by the
The compute queue always uses
Specifies that all shader stages can access whatever is bound at the root signature slot.
Specifies that the vertex shader stage can access whatever is bound at the root signature slot.
Specifies that the hull shader stage can access whatever is bound at the root signature slot.
Specifies that the domain shader stage can access whatever is bound at the root signature slot.
Specifies that the geometry shader stage can access whatever is bound at the root signature slot.
Specifies that the pixel shader stage can access whatever is bound at the root signature slot.
Specifies the border color for a static sampler.
This enum is used by the
Indicates black, with the alpha component as fully transparent.
Indicates black, with the alpha component as fully opaque.
Indicates white, with the alpha component as fully opaque.
Identifies the stencil operations that can be performed during depth-stencil testing.
This enum is used by the
Keep the existing stencil data.
Set the stencil data to 0.
Set the stencil data to the reference value set by calling
Increment the stencil value by 1, and clamp the result.
Decrement the stencil value by 1, and clamp the result.
Invert the stencil data.
Increment the stencil value by 1, and wrap the result if necessary.
Decrement the stencil value by 1, and wrap the result if necessary.
Identifies a technique for resolving texture coordinates that are outside of the boundaries of a texture.
This enum is used by the
Tile the texture at every (u,v) integer junction. For example, for u values between 0 and 3, the texture is repeated three times.
Flip the texture at every (u,v) integer junction. For u values between 0 and 1, for example, the texture is addressed normally; between 1 and 2, the texture is flipped (mirrored); between 2 and 3, the texture is normal again; and so on.
Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively.
Texture coordinates outside the range [0.0, 1.0] are set to the border color specified in
Similar to
Specifies what type of texture copy is to take place.
This enum is used by the
Indicates a subresource, identified by an index, is to be copied.
Indicates a place footprint, identified by a
Specifies texture layout options.
This enum is used by the
This enumeration controls the swizzle pattern of default textures and enable map support on default textures. Callers must query
The standard swizzle formats applies within each page-sized chunk, and pages are laid out in linear order with respect to one another. A 16-bit interleave pattern defines the conversion from pre-swizzled intra-page location to the post-swizzled location.
To demonstrate, consider the 32bpp swizzle format above. This is represented by the following interleave masks, where bits on the left are most-significant:
UINT xBytesMask = 1010 1010 1000 1111
UINT yMask = 0101 0101 0111 0000To compute the swizzled address, the following code could be used (where the _pdep_u32 instruction is supported):
UINT swizzledOffset = resourceBaseOffset + _pdep_u32(xOffset, xBytesMask) + _pdep_u32(yOffset, yBytesMask);
Indicates that the layout is unknown, and is likely adapter-dependent. During creation, the driver chooses the most efficient layout based on other resource properties, especially resource size and flags. Prefer this choice unless certain functionality is required from another texture layout.
Zero-copy texture upload optimizations exist for UMA architectures; see
Indicates that data for the texture is stored in row-major order (sometimes called "pitch-linear order").
This texture layout locates consecutive texels of a row contiguously in memory, before the texels of the next row. Similarly, consecutive texels of a particular depth or array slice are contiguous in memory before the texels of the next depth or array slice. Padding may exist between rows and between depth or array slices to align collections of data. A stride is the distance in memory between rows, depth, or array slices; and it includes any padding.
This texture layout enables sharing of the texture data between multiple adapters, when other layouts aren't available.
Many restrictions apply, because this layout is generally not efficient for extensive usage:
Buffers are created with
Indicates that the layout within 64KB tiles and tail mip packing is up to the driver. No standard swizzle pattern.
This texture layout is arranged into contiguous 64KB regions, also known as tiles, containing near equilateral amount of consecutive number of texels along each dimension. Tiles are arranged in row-major order. While there is no padding between tiles, there are typically unused texels within the last tile in each dimension. The layout of texels within the tile is undefined. Each subresource immediately follows where the previous subresource end, and the subresource order follows the same sequence as subresource ordinals. However, tail mip packing is adapter-specific. For more details, see tiled resource tier and
This texture layout enables partially resident or sparse texture scenarios when used together with virtual memory page mapping functionality. This texture layout must be used together with
Some restrictions apply to textures with this layout:
Indicates that a default texture uses the standardized swizzle pattern.
This texture layout is arranged the same way that
This texture layout enables optimizations when marshalling data between multiple adapters or between the CPU and GPU. The amount of copying can be reduced when multiple components understand the texture memory layout. This layout is generally more efficient for extensive usage than row-major layout, due to the rotationally invariant locality of neighboring texels. This layout can typically only be used with adapters that support standard swizzle, but exceptions exist for cross-adapter shared heaps.
The restrictions for this layout are that the following aren't supported:
Specifies how to copy a tile.
This enum is used by the CopyTiles method.
No tile-copy flags are specified.
Indicates that the GPU isn't currently referencing any of the portions of destination memory being written.
Indicates that the
Indicates that the
Identifies the tier level at which tiled resources are supported.
This enum is used by the
There are three discrete pieces of functionality bundled together for tiled resource functionality:
Three significant changes over D3D11 are:
Indicates that textures cannot be created with the
Indicates that 2D textures can be created with the
GPU reads or writes to
When the size of a texture mipmap level is an integer multiple of the standard tile shape for its format, it is guaranteed to be nonpacked.
Indicates that a superset of Tier_1 functionality is supported, including this additional support:
Adapters that support feature level 12_0 all support TIER_2 or greater.
Indicates that a superset of Tier 2 is supported, with the addition that 3D textures (Volume Tiled Resources) are supported.
Specifies how to perform a tile-mapping operation.
This enum is used by the following methods:
No tile-mapping flags are specified.
Means the caller promises that previously submitted commands to the device that may still be executing do not reference any of the tile region being updated. This allows the device to avoid having to flush previously submitted work in order to do the tile mapping update. If the app violates this promise by updating tile mappings for locations in tiled resources still being referenced by outstanding commands, undefined rendering behavior results, which includes the potential for significant slowdowns on some architectures. This is like the "no overwrite" concept that exists elsewhere in the Direct3D API (for example,
Specifies a range of tile mappings.
Use these flags with
No tile-mapping flags are specified.
The tile range is
Skip the tile range.
Reuse a single tile in the tile range.
Identifies unordered-access view options.
Specify one of the values in this enumeration in the ViewDimension member of a
The view type is unknown.
View the resource as a buffer.
View the resource as a 1D texture.
View the resource as a 1D texture array.
View the resource as a 2D texture.
View the resource as a 2D texture array.
View the resource as a 3D texture array.
Deserializes a root signature so you can determine the layout definition (
Returns
If an application has a serialized root signature already or has a compiled shader that contains a root signature and wants to determine the layout definition, it can call
The REFIID, or
The function signature PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER is provided as a typedef, so that you can use dynamic linking techniques (GetProcAddress) instead of statically linking.
Creates a device that represents the display adapter.
A reference to the video adapter to use when creating a device. Pass
The
A handle to a DLL that implements a software rasterizer. If DriverType is
Returns the address of a reference to an
This method can return one of the Direct3D 11 Return Codes.
This method returns E_INVALIDARG if you set the pAdapter parameter to a non-
This method returns
This entry-point is supported by the Direct3D 11 runtime, which is available on Windows 7, Windows Server 2008 R2, and as an update to Windows Vista (KB971644).
To create a Direct3D 11.1 device (
To create a Direct3D 11.2 device (
Set ppDevice and ppImmediateContext to
For an example, see How To: Create a Device and Immediate Context; to create a device and a swap chain at the same time, use D3D11CreateDeviceAndSwapChain.
If you set the pAdapter parameter to a non-
| Differences between Direct3D 10 and Direct3D 11: In Direct3D 10, the presence of pAdapter dictated which adapter to use and the DriverType could mismatch what the adapter was. In Direct3D 11, if you are trying to create a hardware or a software device, set pAdapter !=
On the other hand, if pAdapter ==
|
?
The function signature PFN_D3D11_CREATE_DEVICE is provided as a typedef, so that you can use dynamic linking techniques (GetProcAddress) instead of statically linking.
Windows?Phone?8: This API is supported.
Windows Phone 8.1: This API is supported.
Gets a debug interface.
The globally unique identifier (
The debug interface, as a reference to reference to void. See
This method returns one of the Direct3D 12 Return Codes.
The function signature PFN_D3D12_GET_DEBUG_INTERFACE is provided as a typedef, so that you can use dynamic linking techniques (GetProcAddress) instead of statically linking.
Represents the allocations of storage for graphics processing unit (GPU) commands.
Use
The command allocator object corresponds to the underlying allocations in which GPU commands are stored. The command allocator object applies to both direct command lists and bundles. You must use a command allocator object in a DirectX 12 app.
Indicates to re-use the memory that is associated with the command allocator.
This method returns E_FAIL if there is an actively recording command list referencing the command allocator. The debug layer will also issue an error in this case. See Direct3D 12 Return Codes for other possible return values.
Apps call Reset to re-use the memory that is associated with a command allocator. From this call to Reset, the runtime and driver determine that the graphics processing unit (GPU) is no longer executing any command lists that have recorded commands with the command allocator.
Unlike
The debug layer will issue a warning if it can't prove that there are no pending GPU references to command lists that have recorded commands in the allocator.
The debug layer will issue an error if Reset is called concurrently by multiple threads (on the same allocator object).
Gets the type of the command list, such as direct, bundle, compute, or copy.
Gets the type of the command list, such as direct, bundle, compute, or copy.
This method returns the type of the command list, as a
A command signature object enables apps to specify indirect drawing, including the buffer format, command type and resource bindings to be used.
To create a command signature, call
Provides methods to monitor and debug a command list.
Returns or sets the debug feature flags that have been set on a command list.
Checks whether a resource, or subresource, is in a specified state, or not.
Specifies the
The index of the subresource to check. This can be set to an index, or D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES.
Specifies the state to check for. This can be one or more
This method returns true if the resource or subresource is in the specified state, false otherwise.
Turns the debug features for a command list on or off.
A combination of feature-mask flags that are combined by using a bitwise OR operation. If a flag is present, that feature will be set to on, otherwise the feature will be set to off.
This method returns one of the Direct3D 12 Return Codes.
Returns the debug feature flags that have been set on a command list.
A bit mask containing the set debug features.
Provides methods to monitor and debug a command queue.
Provides methods to monitor and debug a command queue.
This interface represents a graphics device for debugging.
Gets or sets a bit field of flags that indicates which debug features are on or off.
Set a bit field of flags that will turn debug features on and off.
Feature-mask flags, as a bitwise-OR'd combination of
This method returns one of the Direct3D 12 Return Codes.
Gets a bit field of flags that indicates which debug features are on or off.
Mask of feature-mask flags, as a bitwise OR'ed combination of
Reports information about a device object's lifetime.
A value from the
This method returns one of the Direct3D 12 Return Codes.
A descriptor heap is a collection of contiguous allocations of descriptors, one allocation for every descriptor. Descriptor heaps contain many object types that are not part of a Pipeline State Object (PSO), such as Shader Resource Views (SRVs), Unordered Access Views (UAVs), Constant Buffer Views (CBVs), and Samplers.
Gets the descriptor heap description.
Gets the CPU descriptor handle that represents the start of the heap.
Gets the GPU descriptor handle that represents the start of the heap.
Gets the descriptor heap description.
The description of the descriptor heap, as a
Gets the CPU descriptor handle that represents the start of the heap.
Returns the CPU descriptor handle that represents the start of the heap.
Gets the GPU descriptor handle that represents the start of the heap.
Returns the GPU descriptor handle that represents the start of the heap.
An interface from which other core interfaces inherit from, including
Gets a reference to the device that created this interface.
The globally unique identifier (
A reference to a memory block that receives a reference to the
This method returns one of the Direct3D 12 Return Codes.
Any returned interfaces have their reference count incremented by one, so be sure to call ::release() on the returned references before they are freed or else you will have a memory leak.
Gets the current value of the fence.
Gets the current value of the fence.
Returns the current value of the fence.
Sets the fence to the specified value.
The value to set the fence to.
This method returns one of the Direct3D 12 Return Codes.
Use this method to set a fence value from the CPU side. Use
A heap is an abstraction of contiguous memory allocation, used to manage physical memory. This heap can be used with
Gets the heap description.
Gets the heap description.
Returns the
An information-queue interface stores, retrieves, and filters debug messages. The queue consists of a message queue, an optional storage filter stack, and a optional retrieval filter stack.
This interface is obtained by querying it from the IUnknown::QueryInterface.
Get or sets the maximum number of messages that can be added to the message queue.
Get the number of messages that were allowed to pass through a storage filter.
Get the number of messages that were denied passage through a storage filter.
Get the number of messages currently stored in the message queue.
Get the number of messages that are able to pass through a retrieval filter.
Get the number of messages that were discarded due to the message count limit.
Get and set the message count limit with GetMessageCountLimit and SetMessageCountLimit, respectively.
Get the size of the storage-filter stack in bytes.
Get the size of the retrieval-filter stack in bytes.
Get or sets a boolean that determines if debug output is on or off.
Set the maximum number of messages that can be added to the message queue.
Maximum number of messages that can be added to the message queue. -1 means no limit. When the number of messages in the message queue has reached the maximum limit, new messages coming in will push old messages out.
This method returns one of the Direct3D 12 Return Codes.
Clear all messages from the message queue.
Get a message from the message queue.
Index into message queue after an optional retrieval filter has been applied. This can be between 0 and the number of messages in the message queue that pass through the retrieval filter (which can be obtained with GetNumStoredMessagesAllowedByRetrievalFilter). 0 is the message at the front of the message queue.
Returned message.
Size of pMessage in bytes.
This method returns one of the Direct3D 12 Return Codes.
This method does not remove any messages from the message queue.
This method gets messages from the message queue after an optional retrieval filter has been applied.
Applications should call this method twice to retrieve a message - first to obtain the size of the message and second to get the message. Here is a typical example:
// Get the size of the message
messageLength = 0;
hr = pInfoQueue->GetMessage(0, null , &messageLength); // Allocate space and get the message
* pMessage = ( *)malloc(messageLength);
hr = pInfoQueue->GetMessage(0, pMessage, &messageLength);
Get the number of messages that were allowed to pass through a storage filter.
Number of messages allowed by a storage filter.
Get the number of messages that were denied passage through a storage filter.
Number of messages denied by a storage filter.
Get the number of messages currently stored in the message queue.
Number of messages currently stored in the message queue.
Get the number of messages that are able to pass through a retrieval filter.
Number of messages allowed by a retrieval filter.
Get the number of messages that were discarded due to the message count limit.
Number of messages discarded.
Get and set the message count limit with GetMessageCountLimit and SetMessageCountLimit, respectively.
Get the maximum number of messages that can be added to the message queue.
Maximum number of messages that can be added to the queue. -1 means no limit. When the number of messages in the message queue has reached the maximum limit, new messages coming in will push old messages out.
Add storage filters to the top of the storage-filter stack.
Array of storage filters.
This method returns one of the Direct3D 12 Return Codes.
Get the storage filter at the top of the storage-filter stack.
Storage filter at the top of the storage-filter stack.
Size of the storage filter in bytes. If pFilter is
This method returns one of the Direct3D 12 Return Codes.
Remove a storage filter from the top of the storage-filter stack.
Push an empty storage filter onto the storage-filter stack.
This method returns one of the Direct3D 12 Return Codes.
An empty storage filter allows all messages to pass through.
Push a copy of storage filter currently on the top of the storage-filter stack onto the storage-filter stack.
This method returns one of the Direct3D 12 Return Codes.
Push a storage filter onto the storage-filter stack.
Pointer to a storage filter.
This method returns one of the Direct3D 12 Return Codes.
Pop a storage filter from the top of the storage-filter stack.
Get the size of the storage-filter stack in bytes.
Size of the storage-filter stack in bytes.
Add storage filters to the top of the retrieval-filter stack.
Array of retrieval filters.
This method returns one of the Direct3D 12 Return Codes.
The following code example shows how to use this method:
cats[] = { ..., ..., ... };
sevs[] = { ..., ..., ... };
UINT ids[] = { ..., ..., ... }; filter;
memset( &filter, 0, sizeof(filter) ); // To set the type of messages to allow,
// set filter.AllowList as follows:
filter.AllowList.NumCategories = sizeof(cats / sizeof( ));
filter.AllowList.pCategoryList = cats;
filter.AllowList.NumSeverities = sizeof(sevs / sizeof( ));
filter.AllowList.pSeverityList = sevs;
filter.AllowList.NumIDs = sizeof(ids) / sizeof(UINT);
filter.AllowList.pIDList = ids; // To set the type of messages to deny, set filter.DenyList
// similarly to the preceding filter.AllowList. // The following single call sets all of the preceding information.
hr = infoQueue->AddRetrievalFilterEntries( &filter );
Get the retrieval filter at the top of the retrieval-filter stack.
Retrieval filter at the top of the retrieval-filter stack.
Size of the retrieval filter in bytes. If pFilter is
This method returns one of the Direct3D 12 Return Codes.
Remove a retrieval filter from the top of the retrieval-filter stack.
Push an empty retrieval filter onto the retrieval-filter stack.
This method returns one of the Direct3D 12 Return Codes.
An empty retrieval filter allows all messages to pass through.
Push a copy of retrieval filter currently on the top of the retrieval-filter stack onto the retrieval-filter stack.
This method returns one of the Direct3D 12 Return Codes.
Pop a retrieval filter from the top of the retrieval-filter stack.
Get the size of the retrieval-filter stack in bytes.
Size of the retrieval-filter stack in bytes.
Adds a debug message to the message queue and sends that message to debug output.
Category of a message.
Severity of a message.
Unique identifier of a message.
User-defined message.
This method returns one of the Direct3D 12 Return Codes.
This method is used by the runtime's internal mechanisms to add debug messages to the message queue and send them to debug output. For applications to add their own custom messages to the message queue and send them to debug output, call
Adds a user-defined message to the message queue and sends that message to debug output.
Severity of a message.
Specifies the message string.
This method returns one of the Direct3D 12 Return Codes.
Set a message category to break on when a message with that category passes through the storage filter.
Message category to break on.
Turns this breaking condition on or off (true for on, false for off).
This method returns one of the Direct3D 12 Return Codes.
Set a message severity level to break on when a message with that severity level passes through the storage filter.
A message severity level to break on.
Turns this breaking condition on or off (true for on, false for off).
This method returns one of the Direct3D 12 Return Codes.
Set a message identifier to break on when a message with that identifier passes through the storage filter.
Message identifier to break on.
Turns this breaking condition on or off (true for on, false for off).
This method returns one of the Direct3D 12 Return Codes.
Get a message category to break on when a message with that category passes through the storage filter.
Message category to break on.
Whether this breaking condition is turned on or off (true for on, false for off).
Get a message severity level to break on when a message with that severity level passes through the storage filter.
Message severity level to break on.
Whether this breaking condition is turned on or off (true for on, false for off).
Get a message identifier to break on when a message with that identifier passes through the storage filter.
Message identifier to break on.
Whether this breaking condition is turned on or off (true for on, false for off).
Set a boolean that turns the debug output on or off.
Disable/Enable the debug output (true to disable or mute the output, false to enable the output).
This will stop messages that pass the storage filter from being printed out in the debug output, however those messages will still be added to the message queue.
Get a boolean that determines if debug output is on or off.
Whether the debug output is on or off (true for on, false for off).
Associates a name with the device object. This name is for use in debug diagnostics and tools.
This method takes UNICODE names. The older Direct3D 11 debug object naming system through
Associates a name with the device object. This name is for use in debug diagnostics and tools.
This method takes UNICODE names. The older Direct3D 11 debug object naming system through
Gets application-defined data from a device object.
The
A reference to a variable that on input contains the size, in bytes, of the buffer that pData points to, and on output contains the size, in bytes, of the amount of data that GetPrivateData retrieved.
A reference to a memory block that receives the data from the device object if pDataSize points to a value that specifies a buffer large enough to hold the data.
This method returns one of the Direct3D 12 Return Codes.
Associates a name with the device object. This name is for use in debug diagnostics and tools.
A
This method returns one of the Direct3D 12 Return Codes.
This method takes UNICODE names. The older Direct3D 11 debug object naming system through
Associates an
This method returns one of the Direct3D 12 Return Codes.
Associates a name with the device object. This name is for use in debug diagnostics and tools.
A
This method returns one of the Direct3D 12 Return Codes.
This method takes UNICODE names. The older Direct3D 11 debug object naming system through
An interface from which many other core interfaces inherit from. It indicates that the object type encapsulates some amount of GPU-accessible memory; but does not strongly indicate whether the application can manipulate the object's residency.
For more details, refer to Memory Management in Direct3D 12 and the MakeResident method reference.
Represents the state of all currently set shaders as well as certain fixed function state objects.
Use
A pipeline state object corresponds to a significant portion of the state of the graphics processing unit (GPU). This state includes all currently set shaders and certain fixed function state objects. The only way to change states contained within the pipeline object is to change the currently bound pipeline object.
Gets the cached blob representing the pipeline state.
Refer to the remarks for
Gets the cached blob representing the pipeline state.
After this method returns, points to the cached blob representing the pipeline state.
This method returns one of the Direct3D 12 Return Codes.
Refer to the remarks for
Manages a query heap. A query heap holds an array of queries, referenced by indexes.
For more information, refer to Queries.
Gets the resource description.
This method returns the GPU virtual address of the resource.
For more information on the use of GPU virtual addresses, refer to Indirect Drawing.
Invalidates the CPU reference to the specified subresource in the resource. Unmap also flushes the CPU cache, when necessary, so that GPU reads to this address reflect any modifications made by the CPU.
Specifies the index of the subresource.
A reference to a
This indicates the region the CPU might have modified, and the coordinates are subresource-relative. A null reference indicates the entire subresource might have been modified by the CPU. It is valid to specify the CPU didn't write any data by passing a range where End is less than or equal to Begin.
Refer to the extensive Remarks and Examples for the Map method.
Gets the resource description.
A Direct3D 12 resource description structure.
This method returns the GPU virtual address of the resource.
This method returns the GPU virtual address. D3D12_GPU_VIRTUAL_ADDRESS is a typedef'd synonym of UINT64.
For more information on the use of GPU virtual addresses, refer to Indirect Drawing.
Uses the CPU to copy data into a subresource, enabling the CPU to modify the contents of most textures with undefined layouts.
Specifies the index of the subresource.
A reference to a box that defines the portion of the destination subresource to copy the resource data into. If
An empty box results in a no-op. A box is empty if the top value is greater than or equal to the bottom value, or the left value is greater than or equal to the right value, or the front value is greater than or equal to the back value. When the box is empty, this method doesn't perform any operation.
A reference to the source data in memory.
The distance from one row of source data to the next row.
The distance from one depth slice of source data to the next.
This method returns one of the Direct3D 12 Return Codes.
The resource should first be mapped using Map. Textures must be in the
For efficiency, ensure the bounds and alignment of the extents within the box are ( 64 / [bytes per pixel] ) pixels horizontally. Vertical bounds and alignment should be 2 rows, except when 1-byte-per-pixel formats are used, in which case 4 rows are recommended. Single depth slices per call are handled efficiently. It is recommended but not necessary to provide references and strides which are 128-byte aligned.
When writing to sub mipmap levels, it is recommended to use larger width and heights than described above. This is because small mipmap levels may actually be stored within a larger block of memory, with an opaque amount of offsetting which can interfere with alignment to cache lines.
WriteToSubresource and ReadFromSubresource enable near zero-copy optimizations for UMA adapters, but can prohibitively impair the efficiency of discrete/ NUMA adapters as the texture data cannot reside in local video memory. Typical applications should stick to discrete-friendly upload techniques, unless they recognize the adapter architecture is UMA. For more details on uploading, refer to CopyTextureRegion, and for more details on UMA, refer to
On UMA systems, this routine can be used to minimize the cost of memory copying through the loop optimization known as loop tiling. By breaking up the upload into chucks that comfortably fit in the CPU cache, the effective bandwidth between the CPU and main memory more closely achieves theoretical maximums.
Uses the CPU to copy data from a subresource, enabling the CPU to read the contents of most textures with undefined layouts.
A reference to the destination data in memory.
The distance from one row of destination data to the next row.
The distance from one depth slice of destination data to the next.
Specifies the index of the subresource to read from.
A reference to a box that defines the portion of the destination subresource to copy the resource data from. If
An empty box results in a no-op. A box is empty if the top value is greater than or equal to the bottom value, or the left value is greater than or equal to the right value, or the front value is greater than or equal to the back value. When the box is empty, this method doesn't perform any operation.
This method returns one of the Direct3D 12 Return Codes.
See the Remarks section for WriteToSubresource.
Retrieves the properties of the resource heap, for placed and committed resources.
Pointer to a
Specifies a
This method returns one of the Direct3D 12 Return Codes. If the resource was created as reserved, E_INVALIDARG is returned.
This method only works on placed and committed resources, not on reserved resources. If the resource was created as reserved, E_INVALIDARG is returned. The pages could be mapped to none, one, or more heaps.
For more information, refer to Memory Management in Direct3D 12.
The root signature defines what resources are bound to the graphics pipeline. A root signature is configured by the app and links command lists to the resources the shaders require. Currently, there is one graphics and one compute root signature per app.
Contains a method to return the deserialized
Gets the layout of the root signature.
Returns a reference to a
Gets the layout of the root signature.
Returns a reference to a
Stores a pipeline state.
This structure is used by the
This structure is intended to be filled with the data retrieved from
If the driver has been upgraded to a D3D12 driver after the PSO was cached, you might see a D3D12_ERROR_DRIVER_VERSION_MISMATCH return code, or if you?re running on a different GPU, the D3D12_ERROR_ADAPTER_NOT_FOUND return code.
Specifies reference that references the memory location of the cache.
Specifies the size of the cache in bytes.
Describes a value used to optimize clear operations for a particular resource.
This structure is optionally passed into the following methods:
Specifies one member of the
The format of the commonly cleared color follows the same validation rules as a view/ descriptor creation. In general, the format of the clear color can be any format in the same typeless group that the resource format belongs to.
This Format must match the format of the view used during the clear operation. It indicates whether the Color or the DepthStencil member is valid and how to convert the values for usage with the resource.
Specifies a 4-entry array of float values (each value in the range 0.0 to 1.0), determining the RGBA value. The order of RGBA matches the order used with ClearRenderTargetView.
Specifies one member of
Describes a constant buffer to view.
This structure is used by CreateConstantBufferView.
The D3D12_GPU_VIRTUAL_ADDRESS of the constant buffer. D3D12_GPU_VIRTUAL_ADDRESS is a typedef'd alias of UINT64.
The size in bytes of the constant buffer.
Describes stencil operations that can be performed based on the results of stencil test.
All stencil operations are specified as a
Members of
A
A
A
A
Specifies a depth and stencil value.
This structure is used in the
Specifies the depth value.
Specifies the stencil value.
Describes the subresources of a texture that are accessible from a depth-stencil view.
These are valid formats for a depth-stencil view:
A depth-stencil view can't use a typeless format. If the format chosen is
Pass a depth-stencil-view description into
Describes the subresource from a multi sampled 2D texture that is accessible to a depth-stencil view.
This structure is a member of the
Because a multi sampled 2D texture contains a single subresource, there is nothing to specify in
Unused.
Describes the subresources from an array of 2D textures that are accessible to a depth-stencil view.
Use this structure with a
The index of the first mipmap level to use.
The index of the first texture to use in an array of textures.
Number of textures to use.
Describes the subresources from an array of 1D textures to use in a depth-stencil view.
Use this structure with a
The index of the first mipmap level to use.
The index of the first texture to use in an array of textures.
Number of textures to use.
Describes the subresource from a 1D texture that is accessible to a depth-stencil view.
Use this structure with a
The index of the first mipmap level to use.
Describes the subresources from an array of multi sampled 2D textures for a depth-stencil view.
Use this structure with a
The index of the first texture to use in an array of textures.
Number of textures to use.
Describes the subresource from a 2D texture that is accessible to a depth-stencil view.
Use this structure with a
The index of the first mipmap level to use.
A
A
A combination of
A
A
A
A
A
A
Describes the descriptor heap.
This structure is used by the following:
A
The number of descriptors in the heap.
A combination of
For single-adapter operation, set this to zero. If there are multiple adapter nodes, set a bit to identify the node (one of the device's physical adapters) to which the descriptor heap applies. Each bit in the mask corresponds to a single node. Only one bit must be set. See Multi-Adapter.
Describes details for the discard-resource operation.
This structure is used by the
If rectangles are supplied in this structure, the resource must have 2D subresources with all specified subresources the same dimension.
The number of rectangles in the array that the pRects member specifies.
An array of D3D12_RECT structures for the rectangles in the resource to discard. If
Index of the first subresource in the resource to discard.
The number of subresources in the resource to discard.
Describes dispatch parameters, for use by the compute shader.
The members of this structure serve the same purpose as the parameters of Dispatch.
A compiled compute shader defines the set of instructions to execute per thread and the number of threads to run per group. The thread-group parameters indicate how many thread groups to execute. Each thread group contains the same number of threads, as defined by the compiled compute shader. The thread groups are organized in a three-dimensional grid. The total number of thread groups that the compiled compute shader executes is determined by the following calculation:
ThreadGroupCountX * ThreadGroupCountY * ThreadGroupCountZIn particular, if any of the values in the thread-group parameters are 0, nothing will happen.
The maximum size of any dimension is 65535.
The size, in thread groups, of the x-dimension of the thread-group grid.
The size, in thread groups, of the y-dimension of the thread-group grid.
The size, in thread groups, of the z-dimension of the thread-group grid.
Describes parameters for drawing instances.
The members of this structure serve the same purpose as the parameters of DrawInstanced.
Specifies the number of vertices to draw, per instance.
Specifies the number of instances.
Specifies an index to the first vertex to start drawing from.
Specifies an index to the first instance to start drawing from.
Describes parameters for drawing indexed instances.
The members of this structure serve the same purpose as the parameters of DrawIndexedInstanced.
The number of indices read from the index buffer for each instance.
The number of instances to draw.
The location of the first index read by the GPU from the index buffer.
A value added to each index before reading a vertex from the vertex buffer.
A value added to each index before reading per-instance data from a vertex buffer.
Provide detail about the adapter architecture, helping applications better optimize for certain adapter properties.
In multi-adapter operation, this indicates which physical adapter of the device is relevant. See Multi-Adapter. NodeIndex is filled out by the application before calling CheckFeatureSupport, as the application can retrieve details about the architecture of each adapter.
Specifies whether the hardware and driver support a tile-based renderer. The runtime sets this member to TRUE if the hardware and driver support a tile-based renderer.
Specifies whether the hardware and driver support UMA. The runtime sets this member to TRUE if the hardware and driver support UMA.
Specifies whether the hardware and driver support cache-coherent UMA. The runtime sets this member to TRUE if the hardware and driver support cache-coherent UMA.
Describes Direct3D 12 feature options in the current graphics driver.
See
Specifies whether double types are allowed for shader operations. If TRUE, double types are allowed; otherwise
To use any HLSL shader that is compiled with a double type, the runtime must set DoublePrecisionFloatShaderOps to TRUE.
Specifies whether logic operations are available in blend state. The runtime sets this member to TRUE if logic operations are available in blend state and
A combination of
Specifies whether the hardware and driver support tiled resources. The runtime sets this member to a
Specifies the level at which the hardware and driver support resource binding. The runtime sets this member to a
Specifies whether pixel shader stencil ref is supported. If TRUE, it's supported; otherwise
Specifies whether the loading of additional formats for typed unordered-access views (UAVs) is supported. If TRUE, it's supported; otherwise
Specifies whether Rasterizer Order Views (ROVs) are supported. If TRUE, they're supported; otherwise
Specifies the level at which the hardware and driver support conservative rasterization. The runtime sets this member to a
Don't use this field; instead, use the
TRUE if the hardware supports textures with the 64KB standard swizzle pattern. Support for this pattern enables zero-copy texture optimizations while providing near-equilateral locality for each dimension within the texture. For texture swizzle options and restrictions, see
A
Whether the viewport (VP) and Render Target (RT) array index from any shader feeding the rasterizer are supported without geometry shader emulation. Compare the VPAndRTArrayIndexFromAnyShaderFeedingRasterizer member of the
Specifies the level at which the hardware and driver require heap attribution related to resource type. The runtime sets this member to a
Describes the DXGI data format.
See
A
The number of planes to provide information about.
Describes which resources are supported by the current graphics driver for a given format.
Refer to the enum
A
A combination of
A combination of
Details the adapter's GPU virtual address space limitations, including maximum address bits per resource and per process.
See the enumeration constant
The maximum GPU virtual address bits per resource.
Some adapters have significantly less bits available per resource than per process, while other adapters have significantly greater bits available per resource than per process. The latter scenario tends to happen in less common scenarios, like when running a 32-bit process on certain UMA adapters.
When per resource capabilities are greater than per process, the greater per resource capabilities can only be leveraged by reserved resources or
The maximum GPU virtual address bits per process.
When this value is nearly equal to the available residency budget, Evict will not be a feasible option to manage residency. See MakeResident for more details.
Describes the image quality levels for a given format and sample count.
See
A
The number of multi-samples per pixel to return info about.
Flags to control quality levels, as a bitwise-OR'd combination of
The number of quality levels.
Describes the purpose of a query heap. A query heap contains an array of individual queries.
Use this structure with CreateQueryHeap.
Specifies one member of
Specifies the number of queries the heap should contain.
For single GPU operation, set this to zero. If there are multiple GPU nodes, set a bit to identify the node (the device's physical adapter) to which the query heap applies. Each bit in the mask corresponds to a single node. Only 1 bit must be set. Refer to Multi-Adapter.
Describes heap properties.
This structure is used by the following:
Valid combinations of struct member values:
A
A
A
For multi-adapter operation, this indicates the node where the resource should be created. Exactly one bit of this UINT must be set. See Multi-Adapter.
Passing zero is equivalent to passing one, in order to simplify the usage of single-GPU adapters.
For multi-adapter operation, this indicates the set of nodes where the resource is visible. VisibleNodeMask must have the same bits set as CreationNodeMask has. See Multi-Adapter.
Passing zero is equivalent to passing one, in order to simplify the usage of single-GPU adapters.
Describes an indirect argument (an indirect parameter), for use with a command signature.
Use this structure with the
A single
Specifies the slot containing the vertex buffer address.
Specifies the root index of the constant.
The offset, in 32-bit values, to set the first constant of the group. Supports multi-value constants at a given root index. Root constant entries must be sorted from smallest to largest DestOffsetIn32BitValues.
The number of 32-bit constants that are set at the given root index. Supports multi-value constants at a given root index.
Specifies the root index of the CBV.
Specifies the root index of the SRV.
Specifies the root index of the UAV.
Debug message filter; contains a lists of message types to allow or deny.
For use with an
Specifies types of messages that you want to allow. See
Specifies types of messages that you want to deny.
Allow or deny certain types of messages to pass through a filter.
For use with an
Number of message categories to allow or deny.
Array of message categories to allow or deny. Array must have at least NumCategories members (see
Number of message severity levels to allow or deny.
Array of message severity levels to allow or deny. Array must have at least NumSeverities members (see
Number of message IDs to allow or deny.
Array of message IDs to allow or deny. Array must have at least NumIDs members (see
A description of a single element for the input-assembler stage.
An input-layout object contains an array of structures, each structure defines one element being read from an input slot. Create an input-layout object by calling
The HLSL semantic associated with this element in a shader input-signature.
The semantic index for the element. A semantic index modifies a semantic, with an integer index number. A semantic index is only needed in a case where there is more than one element with the same semantic. For example, a 4x4 matrix would have four components each with the semantic name
matrix
, however each of the four component would have different semantic indices (0, 1, 2, and 3).
The data type of the element data. See
An integer value that identifies the input-assembler (see input slot). Valid values are between 0 and 15, defined in D3D11.h.
Optional. Offset (in bytes) between each element. Use D3D11_APPEND_ALIGNED_ELEMENT for convenience to define the current element directly after the previous one, including any packing if necessary.
Identifies the input data class for a single input slot (see
The number of instances to draw using the same per-instance data before advancing in the buffer by one element. This value must be 0 for an element that contains per-vertex data (the slot class is set to
Describes the input-buffer data for the input-assembler stage.
This structure is a member of the
An array of
The number of input-data types in the array of input elements that the pInputElementDescs member points to.
An array of
A debug message in the Information Queue.
This structure is returned from
The category of the message. See
The severity of the message. See
The ID of the message. See
The message string.
The length of pDescription, in bytes.
Describes the tile structure of a tiled resource with mipmaps.
This structure is used by the GetResourceTiling method.
The number of standard mipmaps in the tiled resource.
The number of packed mipmaps in the tiled resource.
This number starts from the least detailed mipmap (either sharing tiles or using non standard tile layout). This number is 0 if no such packing is in the resource. For array surfaces, this value is the number of mipmaps that are packed for a given array slice where each array slice repeats the same packing.
On Tier_2 tiled resources hardware, mipmaps that fill at least one standard shaped tile in all dimensions are not allowed to be included in the set of packed mipmaps. On Tier_1 hardware, mipmaps that are an integer multiple of one standard shaped tile in all dimensions are not allowed to be included in the set of packed mipmaps. Mipmaps with at least one dimension less than the standard tile shape may or may not be packed. When a given mipmap needs to be packed, all coarser mipmaps for a given array slice are considered packed as well.
The number of tiles for the packed mipmaps in the tiled resource.
If there is no packing, this value is meaningless and is set to 0. Otherwise, it is set to the number of tiles that are needed to represent the set of packed mipmaps. The pixel layout within the packed mipmaps is hardware specific. If apps define only partial mappings for the set of tiles in packed mipmaps, read and write behavior is vendor specific and undefined. For arrays, this value is only the count of packed mipmaps within the subresources for each array slice.
The offset of the first packed tile for the resource in the overall range of tiles. If NumPackedMips is 0, this value is meaningless and is 0. Otherwise, it is the offset of the first packed tile for the resource in the overall range of tiles for the resource. A value of 0 for StartTileIndexInOverallResource means the entire resource is packed. For array surfaces, this is the offset for the tiles that contain the packed mipmaps for the first array slice. Packed mipmaps for each array slice in arrayed surfaces are at this offset past the beginning of the tiles for each array slice.
Note?? The number of overall tiles, packed or not, for a given array slice is simply the total number of tiles for the resource divided by the resource's array size, so it is easy to locate the range of tiles for any given array slice, out of which StartTileIndexInOverallResource identifies which of those are packed. ? Describes the footprint of a placed subresource, including the offset and the
This structure is used in the
Height times depth times row-pitch plus offset must fit within the bounds of the parent resource.
This structure is used by the
When copying textures, use this structure along with
The offset of the subresource within the parent resource, in bytes. The offset between the start of the parent resource and this subresource.
The format, width, height, depth, and row-pitch of the subresource, as a
Query information about graphics-pipeline activity in between calls to BeginQuery and EndQuery.
Use this structure with
Describes the purpose of a query heap. A query heap contains an array of individual queries.
Use this structure with CreateQueryHeap.
Specifies one member of
Specifies the number of queries the heap should contain.
For single GPU operation, set this to zero. If there are multiple GPU nodes, set a bit to identify the node (the device's physical adapter) to which the query heap applies. Each bit in the mask corresponds to a single node. Only 1 bit must be set. Refer to Multi-Adapter.
Describes a memory range.
End is one-past-the-end. When Begin equals End, the range is empty. The size of the range is (End - Begin).
This structure is used by the Map and Unmap methods.
The offset, in bytes, denoting the beginning of a memory range.
The offset, in bytes, denoting the end of a memory range. End is one-past-the-end.
Describes rasterizer state.
A
Rasterizer state defines the behavior of the rasterizer stage.
If you do not specify some rasterizer state, the Direct3D runtime uses the following default values for rasterizer state.
| State | Default Value |
|---|---|
| FillMode | |
| CullMode | |
| FrontCounterClockwise | |
| DepthBias | 0 |
| DepthBiasClamp | 0.0f |
| SlopeScaledDepthBias | 0.0f |
| DepthClipEnable | TRUE |
| MultisampleEnable | |
| AntialiasedLineEnable | |
| ForcedSampleCount | 0 |
| ConservativeRaster |
?
A
A
Determines if a triangle is front- or back-facing. If this member is TRUE, a triangle will be considered front-facing if its vertices are counter-clockwise on the render target and considered back-facing if they are clockwise. If this parameter is
Depth value added to a given pixel. For info about depth bias, see Depth Bias.
Maximum depth bias of a pixel. For info about depth bias, see Depth Bias.
Scalar on a given pixel's slope. For info about depth bias, see Depth Bias.
Specifies whether to enable clipping based on distance.
The hardware always performs x and y clipping of rasterized coordinates. When DepthClipEnable is set to the default?TRUE, the hardware also clips the z value (that is, the hardware performs the last step of the following algorithm).
0 < w
-w <= x <= w (or arbitrarily wider range if implementation uses a guard band to reduce clipping burden)
-w <= y <= w (or arbitrarily wider range if implementation uses a guard band to reduce clipping burden)
0 <= z <= w
When you set DepthClipEnable to
Specifies whether to use the quadrilateral or alpha line anti-aliasing algorithm on multisample antialiasing (MSAA) render targets. Set to TRUE to use the quadrilateral line anti-aliasing algorithm and to
Specifies whether to enable line antialiasing; only applies if doing line drawing and MultisampleEnable is
The sample count that is forced while UAV rendering or rasterizing. Valid values are 0, 1, 2, 4, 8, and optionally 16. 0 indicates that the sample count is not forced.
A
Describes the blend state for a render target.
You specify an array of
For info about how blending is done, see the output-merger stage.
Here are the default values for blend state.
| State | Default Value |
|---|---|
| BlendEnable | |
| LogicOpEnable | |
| SrcBlend | |
| DestBlend | |
| BlendOp | |
| SrcBlendAlpha | |
| DestBlendAlpha | |
| BlendOpAlpha | |
| LogicOp | |
| RenderTargetWriteMask |
?
Specifies whether to enable (or disable) blending. Set to TRUE to enable blending.
Specifies whether to enable (or disable) a logical operation. Set to TRUE to enable a logical operation.
A
A
A
A
A
A
A
A combination of
Describes the subresources from a resource that are accessible by using a render-target view.
Pass a render-target-view description into
A render-target view can't use the following formats:
If the format is set to
Describes the subresources from a 3D texture to use in a render-target view.
Use this structure with a
The index of the mipmap level to use mip slice.
First depth level to use.
Number of depth levels to use in the render-target view, starting from FirstWSlice. A value of -1 indicates all of the slices along the w axis, starting from FirstWSlice.
Describes the elements in a buffer resource to use in a render-target view.
Use this structure with a
Number of bytes between the beginning of the buffer and the first element to access.
The total number of elements in the view.
Describes the subresource from a 1D texture to use in a render-target view.
Use this structure with a
The index of the mipmap level to use mip slice.
Describes the subresources from an array of 1D textures to use in a render-target view.
Use this structure with a
The index of the mipmap level to use mip slice.
The index of the first texture to use in an array of textures.
Number of textures to use.
Describes the subresource from a 2D texture to use in a render-target view.
Use this structure with a
The index of the mipmap level to use.
The index (plane slice number) of the plane to use in the texture.
Describes the subresources from an array of 2D textures to use in a render-target view.
Use this structure with a
The index of the mipmap level to use mip slice.
The index of the first texture to use in an array of textures.
Number of textures in the array to use in the render target view, starting from FirstArraySlice.
The index (plane slice number) of the plane to use in an array of textures.
Describes the subresource from a multi sampled 2D texture to use in a render-target view.
This structure is a member of the
Because a multi sampled 2D texture contains a single subresource, there is actually nothing to specify in
Integer of any value. See remarks.
Describes the subresources from an array of multi sampled 2D textures to use in a render-target view.
Use this structure with a
The index of the first texture to use in an array of textures.
The number of textures to use.
A
A
A
A
A
A
A
A
A
A
Describes the transition between usages of two different resources that have mappings into the same heap.
This structure is a member of the
Both the before and the after resources can be specified or one or both resources can be
Refer to the usage models described in CreatePlacedResource.
A reference to the
A reference to the
Describes parameters needed to allocate resources.
This structure is used by the GetResourceAllocationInfo method.
The size, in bytes, of the resource.
The alignment value for the resource; one of 4KB (4096), 64KB (65536) and 4MB (4194304) alignment.
Specifies a type of resource barrier (transition in resource use) description.
This enum is used in the
Describes a resource, such as a texture. This structure is used extensively.
Use this structure with:
Two common resources are buffers and textures, which both use this structure, but with quite different uses of the fields.
One member of
Specifies the alignment.
Specifies the width of the resource.
Specifies the height of the resource.
Specifies the depth of the resource, if it is 3D, or the array size if it is an array of 1D or 2D resources.
Specifies the number of MIP levels.
Specifies one member of
Specifies a
Specifies one member of
Bitwise-OR'd flags, as
Describes a 3D box.
This structure is used by the methods WriteToSubresource, ReadFromSubresource and CopyTextureRegion.
The x position of the left hand side of the box.
The y position of the top of the box.
The z position of the front of the box.
The x position of the right hand side of the box, plus 1. This means that right - left equals the width of the box.
The y position of the bottom of the box, plus 1. This means that top - bottom equals the height of the box.
The z position of the back of the box, plus 1. This means that front - back equals the depth of the box.
Describes the transition of subresources between different usages.
This struct is used by the Transition member of the
A reference to the
The index of the subresource for the transition. Use the D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES flag ( 0xffffffff ) to transition all subresources in a resource at the same time.
The "before" usages of the subresources, as a bitwise-OR'd combination of
The "after" usages of the subresources, as a bitwise-OR'd combination of
Represents a resource in which all UAV accesses must complete before any future UAV accesses can begin.
This struct represents a resource in which all unordered access view (UAV) accesses (reads or writes) must complete before any future UAV accesses (read or write) can begin.
This structure is a member of the
You don't need to insert a UAV barrier between 2 draw or dispatch calls that only read a UAV. Additionally, you don't need to insert a UAV barrier between 2 draw or dispatch calls that write to the same UAV if you know that it's safe to execute the UAV accesses in any order. The resource can be
The resource used in the transition, as a reference to
Describes constants inline in the root signature that appear in shaders as one constant buffer.
Refer to Resource Binding in HLSL for more information on shader registers and spaces.
The shader register.
The register space.
The number of constants that occupy a single shader slot (these constants appear like a single constant buffer). All constants occupy a single root signature bind slot.
Describes descriptors inline in the root signature that appear in shaders.
The shader register.
The register space.
Describes the layout of a descriptor table as a collection of descriptor ranges that appear one after the other in a descriptor heap.
Samplers are not allowed in the same descriptor table as constant-buffer views (CBVs), unordered-access views (UAVs), and shader-resource views (SRVs).
The number of descriptor ranges in the table layout.
An array of
Specifies the type of root signature slot.
This enum is used by the
Describes the layout of a root signature.
This structure is used by the
There is one graphics root signature, and one compute root signature.
Describes a sampler state.
These are the default values for sampler state.
| State | Default Value |
|---|---|
| Filter | |
| AddressU | |
| AddressV | |
| AddressW | |
| MinLOD | -3.402823466e+38F (-FLT_MAX) |
| MaxLOD | 3.402823466e+38F (FLT_MAX) |
| MipMapLODBias | 0.0f |
| MaxAnisotropy | 1 |
| ComparisonFunc | |
| BorderColor | float4(1.0f,1.0f,1.0f,1.0f) |
| Texture | N/A |
?
Filtering method to use when sampling a texture (see
Method to use for resolving a u texture coordinate that is outside the 0 to 1 range (see
Method to use for resolving a v texture coordinate that is outside the 0 to 1 range.
Method to use for resolving a w texture coordinate that is outside the 0 to 1 range.
Offset from the calculated mipmap level. For example, if Direct3D calculates that a texture should be sampled at mipmap level 3 and MipLODBias is 2, then the texture will be sampled at mipmap level 5.
Clamping value used if
A function that compares sampled data against existing sampled data. The function options are listed in
Border color to use if
Lower end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed.
Upper end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. This value must be greater than or equal to MinLOD. To have no upper limit on LOD set this to a large value such as D3D11_FLOAT32_MAX.
Describes shader data.
The
A reference to a memory block that contains the shader data.
The size, in bytes, of the shader data that the pShaderBytecode member points to.
Describes a shader-resource view.
A view is a format-specific way to look at the data in a resource. The view determines what data to look at, and how it is cast when read.
When viewing a resource, the resource-view description must specify a typed format, that is compatible with the resource format. So that means that you can't create a resource-view description using any format with _TYPELESS in the name. You can however view a typeless resource by specifying a typed format for the view. For example, a
Create a shader-resource-view description by calling
Identifies how to view a buffer resource.
This enumeration is used by
Indicates a default view.
View the buffer as raw. For more info about raw viewing of buffers, see Raw Views of Buffers.
Specifies the subresource from a 1D texture to use in a shader-resource view.
This structure is one member of a shader-resource-view description,
As an example, assuming MostDetailedMip = 6 and MipLevels = 2, the view will have access to 2 mipmap levels, 6 and 7, of the original texture for which
Index of the most detailed mipmap level to use; this number is between 0 and MipLevels (from the original Texture1D for which
The maximum number of mipmap levels for the view of the texture. See the remarks.
Set to -1 to indicate all the mipmap levels from MostDetailedMip on down to least detailed.
A value to clamp sample LOD values to. For example, if you specify 2.0f for the clamp value, you ensure that no individual sample accesses a mip level less than 2.0f.
Describes the subresources from an array of 1D textures to use in a shader-resource view.
This structure is one member of a shader-resource-view description,
Index of the most detailed mipmap level to use; this number is between 0 and MipLevels (from the original Texture1D for which
The maximum number of mipmap levels for the view of the texture. See the remarks in
Set to -1 to indicate all the mipmap levels from MostDetailedMip on down to least detailed.
The index of the first texture to use in an array of textures.
Number of textures in the array.
A value to clamp sample LOD values to. For example, if you specify 2.0f for the clamp value, you ensure that no individual sample accesses a mip level less than 2.0f.
Describes the subresource from a 2D texture to use in a shader-resource view.
This structure is one member of a shader-resource-view description,
Index of the most detailed mipmap level to use; this number is between 0 and MipLevels (from the original Texture2D for which
The maximum number of mipmap levels for the view of the texture. See the remarks in
Set to -1 to indicate all the mipmap levels from MostDetailedMip on down to least detailed.
The index (plane slice number) of the plane to use in the texture.
A value to clamp sample LOD values to. For example, if you specify 2.0f for the clamp value, you ensure that no individual sample accesses a mip level less than 2.0f.
Describes the subresources from an array of 2D textures to use in a shader-resource view.
This structure is one member of a shader-resource-view description,
Index of the most detailed mipmap level to use; this number is between 0 and MipLevels -1 (where MipLevels is from the original Texture2D for which
The maximum number of mipmap levels for the view of the texture. See the remarks in
Set to -1 to indicate all the mipmap levels from MostDetailedMip on down to least detailed.
The index of the first texture to use in an array of textures.
Number of textures in the array.
The index (plane slice number) of the plane to use in an array of textures.
A value to clamp sample LOD values to. For example, if you specify 2.0f for the clamp value, you ensure that no individual sample accesses a mip level less than 2.0f.
Describes the subresources from a multi sampled 2D texture to use in a shader-resource view.
This structure is a member of the
Since a multi sampled 2D texture contains a single subresource, there is actually nothing to specify in
Integer of any value. See remarks.
Describes the subresources from an array of multi sampled 2D textures to use in a shader-resource view.
This structure is one member of a shader-resource-view description,
The index of the first texture to use in an array of textures.
Number of textures to use.
Describes the subresources from a 3D texture to use in a shader-resource view.
This structure is one member of a shader-resource-view description,
Index of the most detailed mipmap level to use; this number is between 0 and MipLevels (from the original Texture3D for which
The maximum number of mipmap levels for the view of the texture. See the remarks in
Set to -1 to indicate all the mipmap levels from MostDetailedMip on down to least detailed.
A value to clamp sample LOD values to. For example, if you specify 2.0f for the clamp value, you ensure that no individual sample accesses a mip level less than 2.0f.
Describes the subresource from a cube texture to use in a shader-resource view.
This structure is one member of a shader-resource-view description,
Index of the most detailed mipmap level to use; this number is between 0 and MipLevels (from the original TextureCube for which
The maximum number of mipmap levels for the view of the texture. See the remarks in
Set to -1 to indicate all the mipmap levels from MostDetailedMip on down to least detailed.
A value to clamp sample LOD values to. For example, if you specify 2.0f for the clamp value, you ensure that no individual sample accesses a mip level less than 2.0f.
Describes the subresources from an array of cube textures to use in a shader-resource view.
This structure is one member of a shader-resource-view description,
Index of the most detailed mipmap level to use; this number is between 0 and MipLevels (from the original TextureCube for which
The maximum number of mipmap levels for the view of the texture. See the remarks in
Set to -1 to indicate all the mipmap levels from MostDetailedMip on down to least detailed.
Index of the first 2D texture to use.
Number of cube textures in the array.
A value to clamp sample LOD values to. For example, if you specify 2.0f for the clamp value, you ensure that no individual sample accesses a mip level less than 2.0f.
A
A
A
A
A
A
A
A
A
A
A
A
A
Describes a static sampler.
Use this structure with the
The filtering method to use when sampling a texture, as a
Specifies the
Specifies the
Specifies the
Offset from the calculated mipmap level. For example, if Direct3D calculates that a texture should be sampled at mipmap level 3 and MipLODBias is 2, then the texture will be sampled at mipmap level 5.
Clamping value used if
A function that compares sampled data against existing sampled data. The function options are listed in
One member of
Lower end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed.
Upper end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. This value must be greater than or equal to MinLOD. To have no upper limit on LOD set this to a large value such as D3D12_FLOAT32_MAX.
The ShaderRegister and RegisterSpace parameters correspond to the binding syntax of HLSL. For example, in HLSL:
Texture2D<float4> a : register(t2, space3); This corresponds to a ShaderRegister of 2 (indicating the type is SRV), and RegisterSpace is 3.
The ShaderRegister and RegisterSpace pair is needed to establish correspondence between shader resources and runtime heap descriptors, using the root signature data structure.
See the description for ShaderRegister. Register space is optional; the default register space is 0.
Specifies the visibility of the sampler to the pipeline shaders, one member of
Describes a streaming output buffer.
A
An array of
The number of entries in the stream output declaration array that the pSODeclaration member points to.
An array of buffer strides; each stride is the size of an element for that buffer.
The number of strides (or buffers) that the pBufferStrides member points to.
The index number of the stream to be sent to the rasterizer stage.
An array of
Describes a vertex element in a vertex buffer in an output slot.
Specify an array of
Zero-based, stream number.
Type of output element; possible values include: "POSITION", "NORMAL", or "TEXCOORD0". Note that if SemanticName is
Output element's zero-based index. Use, for example, if you have more than one texture coordinate stored in each vertex.
The component of the entry to begin writing out to. Valid values are 0 to 3. For example, if you only wish to output to the y and z components of a position, StartComponent is 1 and ComponentCount is 2.
The number of components of the entry to write out to. Valid values are 1 to 4. For example, if you only wish to output to the y and z components of a position, StartComponent is 1 and ComponentCount is 2. Note that if SemanticName is
The associated stream output buffer that is bound to the pipeline. The valid range for OutputSlot is 0 to 3.
Describes query data for stream output.
Use this structure with
Specifies the number of primitives written.
Specifies the total amount of storage needed by the primitives.
Describes subresource data.
This structure is used by a number of the helper functions, refer to Helper Structures and Functions for D3D12.
A reference to a memory block that contains the subresource data.
The row pitch, or width, or physical size, in bytes, of the subresource data.
The depth pitch, or width, or physical size, in bytes, of the subresource data.
Describes the format, width, height, depth, and row-pitch of the subresource into the parent resource.
Use this structure in the
The helper structure is CD3DX12_SUBRESOURCE_FOOTPRINT.
A
The width of the subresource.
The height of the subresource.
The depth of the subresource.
The row pitch, or width, or physical size, in bytes, of the subresource data. This must be a multiple of D3D12_TEXTURE_DATA_PITCH_ALIGNMENT (256), and must be greater than or equal to the size of the data within a row.
Describes subresource data.
Offset, in bytes, between the start of the parent resource and this subresource.
The row pitch, or width, or physical size, in bytes, of the subresource data.
The depth pitch, or width, or physical size, in bytes, of the subresource data.
Describes a tiled subresource volume.
This structure is used by the GetResourceTiling method.
The width in tiles of the subresource.
The height in tiles of the subresource.
The depth in tiles of the subresource.
The index of the tile in the overall tiled subresource to start with.
Describes a portion of a texture for the purpose of texture copies.
Use this structure with CopyTextureRegion.
Describes a portion of a texture for the purpose of texture copies.
Use this structure with CopyTextureRegion.
Describes the coordinates of a tiled resource.
This structure is used by the CopyTiles, CopyTileMappings and UpdateTileMappings methods.
The x-coordinate of the tiled resource.
The y-coordinate of the tiled resource.
The z-coordinate of the tiled resource.
The index of the subresource for the tiled resource.
Describes the size of a tiled region.
This structure is used by the CopyTiles, CopyTileMappings and UpdateTileMappings methods.
The number of tiles in the tiled region.
Specifies whether the runtime uses the Width, Height, and Depth members to define the region.
If TRUE, the runtime uses the Width, Height, and Depth members to define the region. In this case, NumTiles should be equal to Width * Height * Depth.
If
Regardless of whether you specify TRUE or
When the region includes mipmaps that are packed with nonstandard tiling, UseBox must be
The width of the tiled region, in tiles. Used for buffer and 1D, 2D, and 3D textures. For more info, see Tile and toast image sizes.
The height of the tiled region, in tiles. Used for 2D and 3D textures. For more info, see Tile and toast image sizes.
The depth of the tiled region, in tiles. Used for 3D textures or arrays. For arrays, used for advancing in depth jumps to next slice of same mipmap size, which isn't contiguous in the subresource counting space if there are multiple mipmaps.
Describes the shape of a tile by specifying its dimensions.
This structure is used by the GetResourceTiling method.
The width in texels of the tile.
The height in texels of the tile.
The depth in texels of the tile.
Describes the subresources from a resource that are accessible by using an unordered-access view.
Pass an unordered-access-view description into
Describes the elements in a buffer to use in a unordered-access view.
Use this structure with a
The zero-based index of the first element to be accessed.
The number of elements in the resource. For structured buffers, this is the number of structures in the buffer.
The size of each element in the buffer structure (in bytes) when the buffer represents a structured buffer.
The counter offset, in bytes.
A
Describes a unordered-access 1D texture resource.
Use this structure with a
The mipmap slice index.
Describes an array of unordered-access 1D texture resources.
Use this structure with a
The mipmap slice index.
The zero-based index of the first array slice to be accessed.
The number of slices in the array.
Describes a unordered-access 2D texture resource.
Use this structure with a
The mipmap slice index.
The index (plane slice number) of the plane to use in the texture.
Describes an array of unordered-access 2D texture resources.
Use this structure with a
The mipmap slice index.
The zero-based index of the first array slice to be accessed.
The number of slices in the array.
The index (plane slice number) of the plane to use in an array of textures.
Describes a unordered-access 3D texture resource.
Use this structure with a
The mipmap slice index.
The zero-based index of the first depth slice to be accessed.
The number of depth slices.
A
A
A
A
A
A
A
A
Describes the dimensions of a viewport.
Pass an array of these structures to the pViewports parameter in a call to
X position of the left hand side of the viewport.
Y position of the top of the viewport.
Width of the viewport.
Height of the viewport.
Minimum depth of the viewport. Ranges between 0 and 1.
Maximum depth of the viewport. Ranges between 0 and 1.