The Wine project has released a new version of the vkd3d 1.2 package with a Direct3D 12 implementation that works by translating calls to the Vulkan graphics API.
This new version of vkd3d 1.2 contains several improvements, but the main ones that stand out are the availability of libvkd3d-shader as a public library , support for tessellation shaders, as well as support for stream output.
The package includes the libvkd3d library with Direct3D 12 implementations, the libvkd3d-shader library with a model 4 and 5 shader translator, and the libvkd3d-utils library with functions to simplify the migration of Direct3D 12 applications, as well as a set of demos, including the glxgears port to Direct3D 12. The project code is distributed under the LGPLv2.1 license.
The libvkd3d library supports most Direct3D 12 features, including graphics and compute functions, command lists and queues, descriptors and heap descriptors, root signatures, unordered access, samplers, command signatures, root constants, indirect rendering, etc.
Libvkd3d-shader implements the translation of bytecode 4 and 5 of shader models into the intermediate SPIR-V representation. Vertices, pixels, tessellation, simple and computational geometry shaders, root signature serialization, and deserialization are supported.
Shader instructions include arithmetic, atomic, and bit-by-bit operations, data flow control and comparison operators, sampling, gathering, and loading instructions, and unordered access operations (UAV, Unordered Access View).
At this stage of development, not all Direct3D 12 calls are implemented , and testing was primarily conducted on a set of demo applications. This release does not include features under development such as support for tessellation and complex geometry shaders, as well as several improvements related to shaders and core Direct3D 12 methods. These features will be offered in a future release.
Main new features of Vkd3d 1.2
One of the most important changes in the new version is the availability of the libvkd3d-shader library for use in third-party projects, as several Direct3D 12 features have been added, such as:
- Multi-sampling.
- Reserved resources.
- Instance data passing rates.
- "Private data" API for all interfaces.
- Shader resource view component mappings.
- VK_KHR_draw_indirect_count extension.
- Predicate / conditional representation.
- Depth rendering without pixel shader.
- Depth cutout. This requires the VK_EXT_depth_clip_enable extension.
- Discard the rasterizer.
- Dual source mixing.
- Mapping of placed resources.
- The ReadFromSubresource () and WriteToSubresource () ID3D12Resource methods.
- Simultaneous access to multi-queue resources.
- Null views. That is, views without an underlying resource.
- Several more feature support inquiries.
In addition to this, the added support for converting, serializing and deserializing root signatures (vkd3d_serialize_versioned_root_signature() and vkd3d_create_versioned_root_signature_deserializer()) is also noteworthy , as well as the support for streaming output.
Another notable change is the implementation of environment variables: VKD3D_CONFIG to set options to change the behavior of libvkd3d and VKD3D_VULKAN_DEVICE to override the device for the Vulkan API.
In addition, support was added for the shading instructions bufinfo, eval_centroid, eval_sample_index, ld2ms, sample_b, sample_d, sample_info, samplepos and preliminary support for model 5.1 shaders.
And also support for OpenGL SPIR-V target environments. This allows SPIR-V produced by libvkd3d-shader to be used with GL_ARB_gl_spirv. This includes support for OpenGL atomic counters and combined samplers.
Finally, if you want to learn more about this new version, you can consult the complete list of changes at the following link.
How to install vkd3d on Linux?
For those who are interested in being able to install vkd3d on their system, they should obtain the source code and proceed with the compilation, although for practical purposes or for those newbies, they can try this library without much effort. For this, they only have to install lutris and within its configurations.
As for those interested in compilation, they must obtain the code with:
git clone git://source.winehq.org/git/vkd3d.git/
./autogen.sh
./configure
make
../vkd3d/configure --build=i686-pc-linux-gnu "CPPFLAGS=-m32" "LDFLAGS=-m32"
Finally, the Vulkan layers must be enabled:
export VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation
VKD3D_CONFIG=vk_debug