The application discloses a Direct3D 12
resource management method based on a virtual general
layout, and after VKD3D is initialized when VK_KHR_unified_image_layouts is not supported, a mapping matrix of a D3D12 resource state, a virtual general
layout, a Vulkan physical
layout and a pre-compiled conversion path
library are constructed by traversing a Vulkan image format, when a D3D application creates a D3D12 resource, parameters are parsed to divide a sub-resource, a resource
handle containing a physical layout
pool and a sub-resource view array is created, binding of a Vulkan image and memory is completed, when a resource state is set, a resource
handle is inquired, the virtual general layout and the Vulkan physical layout are compared in sequence, redundant requests with no change in
semantics and layout are filtered to obtain a resource conversion request, the resource conversion request is combined to generate a batch
memory barrier instruction, and the batch
memory barrier instruction is pre-submitted to a kernel, and execution is completed by a GPU
idle time window.