The invention discloses a Direct3D 12 depth migration semantic implementation method based on
shader compensation, and the method comprises the steps: carrying out the hierarchical detection of GPU depth migration characteristics through a kernel after a
system is started when a GPU does not support VKEXTdepthbiascontrol, constructing an adaptive strategy, and storing the adaptive strategy into a kernel mode cache; after the VKD3D and the application are started, the VKD3D creates a first historical buffer area and a three-level PSO (
Particle Swarm Optimization) buffer area; when the application creates a
shader and creates a D3D12 PSO, the VKD3D extracts parameters to compile a Vulkan
shader module, analyzes a depth offset parameter query
adaptation strategy, and generates a shader variant of a corresponding type; and constructing a PSO fixed template, generating a cache key, querying a PSO dynamic variant in a three-level PSO cache, binding the PSO dynamic variant when an application sets a pipeline state, and submitting a Vulkan command buffer area to a GPU (Graphic
Processing Unit) to finish rendering after a drawing instruction is submitted.