Showing posts from 2017

VK9 - Milestone23 Completed

VK9 has reached it's 23rd milestone. Reaching this milestone required the implementation of basic shader support. Leading up to this new feature enhancements were made to fixed function lighting support and several minor improvements such as converting Vulkan API results to human readable strings in log messages. The next steps for the project will be to continue implementing the remaining fixed function features as well as the remaining DXBC instructions. I plan to take a break for the Holiday's and hit the ground running in 2018.

For those of you interested in the technical approach VK9's shader support works by taking the DXBC (Microsoft's old DirectX byte code format) passed to it by the application and it converts it to SPIR-V which is Vulkan's byte code format. There are significant challenges in the conversion for various reasons. One such example is the TEX instruction which functions differently depending on the shader model used. The rules for input/outpu…

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

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

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

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.

VK9 - Community Benchmark

A member of the community who goes by "Syntist" ran some benchmarks comparing the latest VK9 build to native Direct 3D 9. The results show very competitive average and minimum frame rates. Development effort has been primarily focused on feature parity so it's encouraging to see results this close on real hardware. Dx9 and Vk9 Comparison

VK9 - Milestone16 Completed

VK9 has reached it's 14th,15th, and 16th milestones. Reaching these milestones required further work on alpha blending and lighting support for fixed function. In addition this release switched to the glslc shader compiler from Google. The primary reason for the switch is the addition of #include support in shaders. This will allow some shader code for fixed function to be deduplicated.

VK9 - Milestone13 Completed

VK9 has reached it's 12th and 13th milestones. Reaching these milestones required the addition of limited lighting support and significant improvements to the texture stage support. The variables used for texture stages are now handled with specialization constants. What this means is that although they exist in the SPIR-V they should be optimized away when the SPIR-V is compiled into GPU instructions. This approach means that the GPU should only be running relevant code for fixed function. As part of initial lighting support both the light structures and material structure are available to the shaders being used to handle fixed function.

VK9 - Progress Update

It's been over a month since my last blog post. As those of you on the VKx Discord server are aware the current milestone involves texture stages, lights, and materials. Because of the breadth of features needed to support this sample it's taking longer to complete. However, rest assured work is still underway and I expect another milestone either late this month or early next month.

VK9 - Milestone11 Completed

VK9 has reached it's 10th & 11th milestones. The primary features added to support these milestones were improvements to mipmapping & texture support. This release also includes a good number of performance improvements. The transformation matrices are now multiplied together before passing to the shader so they can fit into a push constant. The switch away from a buffer to a push constant for the transformation matrices caused a very noticeable performance improvement. For math glm has been replaced with eigen which improves the performance of matrix multiplication. In addition vectors and maps were replaced with small size optimized vectors and flat maps respectively which in my testing resulted in a performance improvement. Other smaller optimizations have been applied as well.

VK9 - Milestone9 Completed

VK9 has reached it's 9th milestone. The primary changes for this release include enhancements to texture/surface handling as well as improvements to the stateblock implementation. Thanks to web archive I was able to continue with the roadmap as is even though the is no longer online. Special thanks to Xaviour for pointing that out to me.

VK9 - Discord server

I setup a discord server so that members of the community can communicate. Interest in solutions for other versions of D3d has been expressed by the community so I setup the server as VKx and setup separate channels for vk9, vk11, vk12, and vkg (gallium). I am currently focused on VK9 but I do believe these other projects are worth exploring.

VK9 - Milestone8 Completed

VK9 has reached it's 7th & 8th milestones. The primary features added to support these milestones include state blocks and initial alpha blending support. The code is available on github. Some of you may have noticed that is no longer online. Because of this I'll need to re-evaluate the future milestones because the samples are no longer available. I've started the process of evaluating alternatives and will make another announcement once I've updated the road map.

VK9 - Quick Status

I'm making good progress toward the next milestone. The largest advancement so far is the inclusion of state blocks. I'm currently looking into why fonts from d3d9x don't render properly.