Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-platform Vulkan #71

Merged
merged 8 commits into from
Mar 9, 2025
Merged

Cross-platform Vulkan #71

merged 8 commits into from
Mar 9, 2025

Conversation

brenocq
Copy link
Owner

@brenocq brenocq commented Mar 9, 2025

Cross-Platform Vulkan

This PR significantly enhances Atta's graphics module by enabling seamless Vulkan support across Linux, MacOS, Windows, and Web. It addresses the limitations of relying on the Vulkan SDK and glslc being pre-installed on the user's system.

🔍 Key Changes

  1. Dynamic Vulkan Loading with Volk:

    • Integrated the Volk library for dynamic loading of Vulkan functions at runtime.
    • Eliminates the dependency on a specific Vulkan SDK version being present on the user's machine.
    • Ensures that Atta can utilize the Vulkan API available on the system without requiring pre-compilation against a particular SDK.
  2. Static Linking of ShaderC:

    • Enables Atta to compile shaders to Vulkan SPIR-V directly within the engine, simplifying the build process and user experience.
    • Statically linked the ShaderC library into Atta.
    • Removes the requirement for glslc to be installed on the user's system.
  3. Conditional Compilation and Linking:

    • On platforms without Vulkan support (MacOS and Web), Vulkan dependencies (Volk, ShaderC) are not linked, and Vulkan-specific code within Atta's graphics module is excluded from compilation.
    • Reduces the final build size and avoids unnecessary dependencies on these platforms.

🔧 Changelog

  • Feat
    • Dynamic loading of Vulkan with Volk
    • Migrated shader compilation to use Shaderc
    • Disabled Vulkan build on MacOS and Web builds
    • Added --disable-vulkan flag to build script
    • Added support CMake option ATTA_VULKAN_SUPPORT to allow disabling Vulkan when building
    • Fallback to OpenGL if there is no GPU with Vulkan support
  • Refactor
    • Updated solveImgui.cmake to build Vulkan backend with Volk
    • Removed Vulkan-related code from Glad 2
  • Style
    • Fixed typo in CMakeLists.txt from "Releaese" to "Release"
  • Chore
    • Added solveShaderc.cmake and solveVolk.cmake for external dependencies

@brenocq brenocq added module:graphics Graphics Module prio:high High priority status:review The task is under review type:fix Something needs to be fixed labels Mar 9, 2025
@brenocq brenocq self-assigned this Mar 9, 2025
@brenocq brenocq added the version:patch Increases the patch version when added to a PR label Mar 9, 2025
@brenocq brenocq merged commit 1a4fb37 into dev Mar 9, 2025
@brenocq brenocq deleted the cross-platform-vulkan branch March 9, 2025 20:02
@brenocq brenocq added status:done Task completed successfully and removed status:review The task is under review labels Mar 10, 2025
@brenocq brenocq linked an issue Mar 10, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:graphics Graphics Module prio:high High priority status:done Task completed successfully type:fix Something needs to be fixed version:patch Increases the patch version when added to a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Cross-platform Vulkan
1 participant