Direct3D 12 Graphics API Reference
This section provides detailed reference documentation for the Direct3D 12 API, a low-overhead graphics API that gives developers more control over hardware performance. This API is designed for modern graphics development on Windows.
Core Concepts
Understanding the fundamental concepts of Direct3D 12 is crucial for effective graphics programming. This includes:
- Command Lists and Command Queues
- Pipeline State Objects (PSOs)
- Resource Binding and Descriptors
- Synchronization Primitives (Fences, Semaphores)
- Heap and Memory Management
Enumerations
Enumerations define specific states, flags, and values used within the Direct3D 12 API.
Name | Description |
---|---|
D3D12_COMMAND_LIST_TYPE |
Specifies the type of command list. |
D3D12_PRIMITIVE_TOPOLOGY_TYPE |
Specifies the primitive topology. |
D3D12_DESCRIPTOR_HEAP_TYPE |
Specifies the type of descriptor heap. |
D3D12_RESOURCE_DIMENSION |
Specifies the dimensions of a resource. |
D3D12_SHADER_VISIBILITY |
Specifies which shader stages a root signature parameter is visible to. |
Structures
Structures are used to pass data to and from Direct3D 12 functions, defining parameters, states, and resource configurations.
Name | Description |
---|---|
D3D12_GRAPHICS_PIPELINE_STATE_DESC |
Describes the pipeline state for graphics rendering. |
D3D12_ROOT_SIGNATURE_DESC |
Describes a root signature. |
D3D12_RESOURCE_DESC |
Describes a generic resource. |
D3D12_VIEWPORT |
Specifies the viewport transform. |
D3D12_RECT |
Specifies a rectangle. |
D3D12_CLEAR_VALUE |
Specifies a clear value for a render target or depth-stencil buffer. |
Functions
These functions are the primary interface for interacting with the Direct3D 12 device and its capabilities.
Name | Description |
---|---|
D3D12CreateDevice |
Creates a Direct3D 12 device. |
ID3D12Device::CreateCommandAllocator |
Creates a command allocator. |
ID3D12Device::CreateCommandList |
Creates a command list. |
ID3D12Device::CreateGraphicsPipelineState |
Creates a graphics pipeline state object. |
ID3D12GraphicsCommandList::DrawInstanced |
Draws instances of an indexed or non-indexed primitive. |
ID3D12CommandQueue::ExecuteCommandLists |
Executes an array of command lists. |
Interfaces
Interfaces represent the core objects and functionalities exposed by the Direct3D 12 API.
Name | Description |
---|---|
ID3D12Device |
Represents the graphics adapter. |
ID3D12CommandQueue |
Represents a queue for command lists. |
ID3D12CommandAllocator |
Manages command list memory. |
ID3D12GraphicsCommandList |
Records rendering commands. |
ID3D12PipelineState |
Represents a complete pipeline state. |
ID3D12Resource |
Represents a graphics resource such as a texture or buffer. |
ID3D12DescriptorHeap |
Manages descriptor tables for shader resource binding. |
ID3D12Fence |
Synchronization primitive to signal completion. |
Callbacks
Callbacks define methods that the application implements to respond to specific events or provide data.
Name | Description |
---|---|
PFN_D3D12_DEBUG_MESSAGE_CALLBACK |
Callback function for debug messages. |
Constants
Predefined constants and macros used in Direct3D 12 programming.
Name | Value | Description |
---|---|---|
D3D12_DEFAULT_SHADER_MODEL |
6_5 |
Default shader model version. |
D3D12_MAX_SPLIT_CHART_COLORS |
16 |
Maximum number of split chart colors. |
D3D12_REQ_SUBRESOURCE_WIDTH_128 |
128 |
Minimum required subresource width. |