The application discloses a Direct3D 12 depth offset semantic implementation method based on
shader compensation, and when GPU does not support VK_EXT_depth_bias_control, the
system starts after the
kernel level detects GPU depth offset characteristics, and builds an adaptive strategy and stores it in the kernel state buffer; after VKD3D and application start, the first history buffer and three-level PSO cache are created by VKD3D; when the application creates a
shader and creates a D3D12 PSO, the VKD3D extracts parameters, compiles a Vulkan
shader module, analyzes depth offset parameters, queries an adaptive strategy, and generates a corresponding type of shader variant; a PSO fixed template is built, a cache key is generated to query a PSO dynamic variant in the three-level PSO cache, a PSO dynamic variant is bound when a pipeline state is set in the application, and after a drawing instruction is submitted, a Vulkan command buffer is submitted to the GPU to complete rendering.