Friday, April 29, 2022

Returning to Vulkan

 This week was all about Vulkan, as I had to fix an issue that was preventing Anisotropic filtering for GVulkan surface. The fix was easy, as the flag that enabled the feature was inside an if statement that was checking for MSAA being enabled. By moving the flag out of the if statement any user wishing to program with GVulkan surface can use Anisotropic filtering without the need for MSAA. 




Most of my work went into rewriting the unit test to show a texture of a ship painting. I got to learn how to write a GLSL shader for texture sampling, which made the image below possible.



the texture itself is a header file with the color data, which is then fed into the Vulkan shaders with a buffer to access the data itself. This was quite a challenge since it had been a while since I visited low level Vulkan code! All in all this week was challenging with low level code but I'm glad I was able to pull through this one! This also brings my second month on the Gateware team to a close!

Saturday, April 23, 2022

Learning basics of xaudio2 and Vulkan

 This week was a learning process, as I necessitated learning xaudio2 and Vulkan for the bugs I had to fix.

First I added a function to GVulkan surface to allow the user access to the depth image and view, which was a matter of figuring out which variable held the specific data needed for the return value.

The second bug I fixed took up the rest of the week, as it was hidden deep within GMusic's code. It ended up being in a lambda function which was a bit weird to debug, but was super quick once I had enabled all the necessary debug tools to point out the exact issue that had been occuring. What had been happening was xaudio2 was expecting a buffer that was a multiple of 6 for 24bit audio, and not a multiple of 4 for 16bit audio.

the fix for making sure the buffer was always a multiple of 6

After the GMusic bug was fixed, 24bit audio was able to be played inside GMusic!


Friday, April 15, 2022

GUtility is gone!

 GUtility has now been removed from gateware. In its place is winutils.h. As of now the header includes a better solution for UTF8 to UTF16 conversions that prevents any issues with translation units by replacing an old static function with an overloaded inline function. Mac and Linux build also had their strlcpy replaced with calls to snprintf, which was what the old strlcpy macros were a layer ontop of.


the all new winutils.h! This is version 1.0

The next bug I fixed was a minor math library bug, in the GQuaternion file. SlerpF and SlerpD had been lacking code to handle an edge case where parallel quaternions were leading to a NaN state when calculations were ran. The fix to this issue was adding a check for the dot product in which if a dot product of 1 (or close to 1) is produced, Slerp will then use a normal Lerp in its place to prevent any divide by 0 scenarios.

The new if check to handle the edge case

Super great week! I was able to solve two bugs in the time I was working during the week! 


Friday, April 8, 2022

End of Week April 8th

 

The EOF bug I chose to fix has uncovered many flaws in Gateware, but they've since been patched up. Though, I've also learned how to not go about merging branches on GitKraken, as I lost my work on Monday afternoon due to an improper merge. Thankfully, I was able to recover my work using the tools provided on GitKraken. 

    
The bug that had me caught all day on Thursday involved unnecessary calls to Seekg inside the Readline() function for the Linux build of Gateware. Calling Seekg too often drastically hinders the performance of the Single Header Compiler to the point it would time out from taking too long. These unneeded calls were removed from mac and windows, but had been lost during my learning experience with using GitKraken's merge tool. They were recovered after returning to an older commit.

The last bug I managed to discover is, after my merge to recover lost work, was that the Linux Test machine was not building the GVersion file which the unit test files rely on inorder to function. This was caused by an internal issue in a CMake script