Edit

Share via


Generic programs

Generic programs provide a way to define graphics and compute pipelines within state objects, using the same infrastructure as raytracing and work graphs. Instead of creating separate pipeline state objects (PSOs), you can define multiple programs in a single state object by composing shared building blocks, such as shaders and blend state.

This article describes the DDIs for a user-mode graphics driver (UMD) to support generic programs, available starting in Windows 11, version 24H2 (WDDM 3.2). Generic programs require Shader Model 6.8 support. For details, see the Generic Programs specification.

Reporting generic programs support

Shader Model 6.8 support implies generic programs support. There's no separate capability reporting specific to generic programs.

DDI function tables

Generic programs use the following DDI functions:

State objects

Define generic programs within state objects by using the D3D12DDI_STATE_SUBOBJECT_TYPE_GENERIC_PROGRAM subobject type (value 15) in D3D12DDI_STATE_SUBOBJECT_TYPE. See D3D12DDI_GENERIC_PROGRAM_DESC_0108 for the subobject structure.

A generic program specifies a program name, shader exports (vertex shader, pixel shader, compute shader, and others), and references to other subobjects like blend state and rasterizer state. Graphics pipeline state subobjects include blend, rasterizer, depth/stencil, input layout, primitive topology, render target formats, and others as defined in the D3D12DDI_STATE_SUBOBJECT_TYPE enum.

Generic programs support the following Shader Model 6.8 shader targets: vs_6_8, ps_6_8, cs_6_8, ms_6_8, and as_6_8.

Relationship to work graphs

Generic programs and work graphs are independent features that share state object infrastructure. Generic programs require only Shader Model 6.8, while work graphs require explicit WorkGraphsTier capability support.

See also