DirectX 11 Enumerations
Enumerations in DirectX 11 are used to define a set of named constants that represent specific states, options, or values. This page provides a comprehensive list and explanation of the common enumerations used within the DirectX 11 API.
D3D11_BIND_FLAG Enumeration
Description
Specifies how a resource will be used by the GPU. Resources can be bound to multiple stages of the pipeline simultaneously.
- D3D11_BIND_VERTEX_BUFFER: The resource will be bound as a vertex buffer.
- D3D11_BIND_INDEX_BUFFER: The resource will be bound as an index buffer.
- D3D11_BIND_CONSTANT_BUFFER: The resource will be bound as a constant buffer.
- D3D11_BIND_SHADER_RESOURCE: The resource will be bound as a shader resource.
- D3D11_BIND_STREAM_OUTPUT: The resource will be used for stream output.
- D3D11_BIND_RENDER_TARGET: The resource will be bound as a render target.
- D3D11_BIND_DEPTH_STENCIL: The resource will be bound as a depth-stencil buffer.
- D3D11_BIND_UNORDERED_ACCESS: The resource will be bound as an unordered-access view.
- D3D11_BIND_IMU_TEXTURE: (Reserved for future use.)
D3D11_USAGE Enumeration
Description
Specifies how a resource will be accessed by the CPU and GPU. This determines memory placement and update behavior.
- D3D11_USAGE_DEFAULT: The resource is accessible by the GPU and can be read by the CPU, but it cannot be written to by the CPU directly. This is the default usage.
- D3D11_USAGE_IMMUTABLE: The resource is immutable. It can be read by the GPU, but it cannot be modified by the CPU or GPU after creation. This usage is best for resources that won't change.
- D3D11_USAGE_DYNAMIC: The resource is dynamic. It can be updated by the CPU using methods like
Map
andUnmap
. This is suitable for resources that change frequently. - D3D11_USAGE_STAGING: The resource is a staging resource. It can be read from and written to by the CPU using
Map
andUnmap
, and can be copied to and from other resources by the GPU. This is primarily used for transferring data between CPU and GPU.
D3D11_PRIMITIVE_TOPOLOGY Enumeration
Description
Specifies the type of primitive (point, line, triangle) and how its vertices are ordered for rendering.
- D3D11_PRIMITIVE_TOPOLOGY_POINTLIST: Vertices are treated as individual points.
- D3D11_PRIMITIVE_TOPOLOGY_LINELIST: Vertices are treated as pairs of lines.
- D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP: Vertices are treated as a connected series of lines.
- D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST: Vertices are treated as individual triangles.
- D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP: Vertices are treated as a connected series of triangles.
- D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ: Vertices are treated as pairs of lines, with adjacency information.
- D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ: Vertices are treated as a connected series of lines, with adjacency information.
- D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ: Vertices are treated as individual triangles, with adjacency information.
- D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ: Vertices are treated as a connected series of triangles, with adjacency information.
D3D11_SRV_DIMENSION Enumeration
Description
Specifies the dimensionality of a shader resource view (SRV).
D3D11_COMPARISON_FUNC Enumeration
Description
Specifies a comparison function used in depth-stencil testing and texture samplers.
- D3D11_COMPARISON_NEVER: Never pass.
- D3D11_COMPARISON_LESS: Pass if the source is less than the destination.
- D3D11_COMPARISON_EQUAL: Pass if the source is equal to the destination.
- D3D11_COMPARISON_LESS_EQUAL: Pass if the source is less than or equal to the destination.
- D3D11_COMPARISON_GREATER: Pass if the source is greater than the destination.
- D3D11_COMPARISON_NOT_EQUAL: Pass if the source is not equal to the destination.
- D3D11_COMPARISON_GREATER_EQUAL: Pass if the source is greater than or equal to the destination.
- D3D11_COMPARISON_ALWAYS: Always pass.
Explore the detailed documentation for each enumeration for specific usage scenarios and parameter definitions.