Posts

VK9 - Status Report - Nov

This month progress has continued on shader support. One of the bigger updates since the last post is support for shader constants. In the end I used specialization constants to achieve this. They line up with the features and constraints of shader constants better than uniform buffers or push constants. For example in the documentation the stated purpose of boolean and integer shader constants is branching. Using specialization constants for those cases means that when the SPIR-V is compiled by the driver unused code paths can be optimized away. The obvious drawback is that creating a new pipeline is expensive and shader constants are also used for things like transformation matrices in D3D9. I'll need to do some testing with real games to properly optimize this piece but my intended solution is to determine frequently updated ranges and use push constants for those instead.

In addition to several small enhancements I've also added OpName instructions to the SPIR-V to make it…

VK9 - Status Report - OCT

This month progress has continued on shader support. Several new features have been added including swizzle operations on targets, temporary registers, input/output register decoration, and many small improvements/fixes. As of this writing my current focus is on constant registers. D3D9 allows constants to be defined either in the shader or by calling functions from the C++ code. The equivalent feature in Vulkan would be push constants. However, The minimum size guaranteed for push constants is only enough for a couple matrices. Currently I'm handling DEF instructions with true constants inside of the shader. My intended approach with the ones defined from c++ code is to look at every place one is used that is not defined and create a push constant block that includes variables for all of them. If more are used than are allowed by the current hardware for now I'll write an error. I have noticed that some hardware allows 256 bytes instead of 128 bytes which gives us more space …

VK9 - Status Report - SEP

Image
This month progress has continued on shader support. Although not complete the translation is starting to look like a valid shader. The picture below is the disassembled SPIR-V which was translated on the fly from DXBC. Although I was sick a week out of this month I was able to add support for swizzle on source registers, automatically adding load instructions where a source register is a pointer and other misc improvements. As always the source is up on github and if you would like to support this project I'm also on Patreon.

VK9 - Status Report - AUG

This will be a quick post to let everyone know how shader support is progressing. The instructions present in my sample shader are all being translated in the current code base. The next steps will be to finish implementing the SPIR-V header and make sure the register type detection is working properly with the sample shader. Once all of that is complete I can begin unit testing this new functionality. My intention is to write an equivalent GLSL shader by hand and compile it to ensure the correctness of the converted SPIR-V.

VK9 - Status Report

Image
Since my last post I've continued to work through the features necessary to reach more milestones. One of the biggest missing features is shader support. All of the fixed function support implemented so far is handled with shaders. However, D3D9 allows programmers to specify custom vertex and pixel shaders as well. As with the rest of D3D9 the shader format is proprietary. It will take me some time to build out the pieces to parse and convert the shaders to SPIR-V (the bytecode format that Vulkan uses). I will be nose down on this so until I get it implemented status updates may be less frequent and will likely be in a status update format rather than milestone announcements. Once basic support is implemented I can start hitting milestones again. The reason for this temporary shift is that shader support has irreducible complexity. Unlike the other milestones I have to implement several features before I can verify progress with a sample. I have however gotten a few more samples t…

VK9 - Milestone17 Completed

Image
VK9 has reached it's 17th milestone. Reaching this milestone required implementation of depth bias support. In addition the shaders have been re-structured using includes which were introduced in the previous release by switching to glslc. This release also contains full screen support. Special thanks to my patrons over on Patreon you guys are great.

VK9 - Now on Patreon

Several people have asked about Patreon or some other way to support the project. As of today I am now on Patreon. I've created a couple perks for Patreon supporters. There are two levels "Supporters" and "Premium Supporters" both receive a role on the community Discord for their level and the premium supporters gain access to a private channel. The source and release builds will still remain available to everyone but Premium Supporters will gain access to early builds and demos. https://www.patreon.com/disks86