Hazel icon indicating copy to clipboard operation
Hazel copied to clipboard

Setup.bat requires a specific version of VulkanSDK, ignoring anything newer

Open CalSeedy opened this issue 4 years ago • 3 comments

Is your feature request related to a problem? Please describe

On a fresh install and setup, even if you have a more recent version of the VulkanSDK installed, you are still required to install the specified version.

image

Describe the solution you'd like

Check for versions that are compatible with the current required version. Could be done by parsing the version strings and checking for equality or a more recent version. Like in the following, the packaging module allows for version comparison.


from packaging import version

@classmethod
def CheckVulkanSDK(cls):
    vulkanSDK = os.environ.get("VULKAN_SDK")
    if (vulkanSDK is None):
        print("\nYou don't have the Vulkan SDK installed!")
        cls.__InstallVulkanSDK()
        return False
    else:
        print(f"\nLocated Vulkan SDK at {vulkanSDK}")
    
    # guarantee slashes are correct
    vulkanSDK.replace("\\", "/")

    # get the substring that follows the final slash (assuming no trailing slash)
    installedVulkanVersion = vulkanSDK.split("/")[-1]
    if (version.parse(cls.requiredVulkanVersion) > version.parse(installedVulkanVersion)):
        print(f"You don't have the correct Vulkan SDK version! (Engine requires {cls.requiredVulkanVersion})")
        cls.__InstallVulkanSDK()
        return False

Describe alternatives you've considered

None.

Additional context

This would also effect the version of the debug SDK needed. So the required version should be changed when a newer SDK version is detected.

CalSeedy avatar Aug 22 '21 23:08 CalSeedy

Probably something worth adding, but just a hunch - suppose there's any changes in the Vulkan SDK API, and the version used by Hazel requires a downgraded version compulsorily, then it will throw out errors because of incompatibilities between Hazel's compatibility with an older version of SDK and the newer version of SDK probably not having those functionalities which Hazel requires.

This is a long oversight- but something that still might have a possibility of occurring. I believe somewhere, you have a varaible to change the version of Vulkan SDK used by Hazel in the Python scripts. For people who want to use newer versions of SDK, this serves as additional control over what they want to use.

CybernetHacker14 avatar Aug 24 '21 06:08 CybernetHacker14

but just a hunch - suppose there's any changes in the Vulkan SDK API, and the version used by Hazel requires a downgraded version compulsorily, then it will throw out errors because of incompatibilities between Hazel's compatibility with an older version of SDK and the newer version of SDK probably not having those functionalities which Hazel requires.

Very good point, I didn't event think that far ahead! I guess it's a decision on whether or not Hazel should leave Vulkan compatibility to the developer or the user. Personally, for ease of use on their end, I think users would benefit from not having to change setup scripts.

I believe somewhere, you have a varaible to change the version of Vulkan SDK used by Hazel in the Python scripts.

One solution to the issue of changing API could be to have a min and max supported version, checking whether the user's Vulkan install is within the bounds. But, there is also what you said (and what I did end up doing), just changing the version in SetupVulkan.py. The latter is easy enough.

CalSeedy avatar Aug 24 '21 07:08 CalSeedy

How about offering a command-line option that lets the user choose? Something like --vk-sdk=x.x.x.x. Let the engine pick a version by default and if the user provides the option then use that (possibly checking for incompatible versions).

Isho312 avatar Aug 24 '21 08:08 Isho312