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

(Meta issue) Simplify the framework #1201

Open
SaschaWillems opened this issue Oct 21, 2024 · 4 comments
Open

(Meta issue) Simplify the framework #1201

SaschaWillems opened this issue Oct 21, 2024 · 4 comments
Labels
framework This is relevant to the framework

Comments

@SaschaWillems
Copy link
Collaborator

A common criticism with our samples is the complicated framework. Esp. the samples that use the high level framework have a lot of abstraction, making it hard to debug, follow or learn from the code. While there is no direct action to take here we should look at ways to simplify the framework like removing multiple levels of abstraction and agreeing on ways to write code. Using modern C++ features might look nice, but if they result in code that's hard to follow we should not use in the samples.

@SaschaWillems SaschaWillems added the framework This is relevant to the framework label Oct 21, 2024
@SaschaWillems
Copy link
Collaborator Author

SaschaWillems commented Oct 24, 2024

Looking through the framework makes me wonder why we did certain things the way we do. We have different design patterns, heavily templated code, lots of abstractions which in the end do nothing more than to fill out a Vk*CreateInfo structure. I wonder how we can simplify that in such a way that esp. the higher level framework becomes easy to follow and debug again? I don't consider myself a C++ power user, but imo the code should be readable by someone with average C++ skills (like me). Yet we have whole header/implementation files that I don't understand at all (and sadly those files have little or often no code comments at all).

@SRSaunders
Copy link
Contributor

SRSaunders commented Nov 22, 2024

A side effect of the current project structure is a relatively long compile time. A clean build on macOS takes about 5 minutes on my 8700K machine (6x2 cores using parallel compilation). This also results in longer CI times which has been a topic here before. Can things be restructured to use precompiled headers or other componentization methods to reduce both clean and incremental build times? Even if the frameworks continue to take time, speeding up sample compilation could really help. In the current setup using my machine, each sample takes about 16-18 sec which quickly adds up even with parallel compilation enabled (12 threads). Single-threaded serialized compilation illustrates the issue more starkly, taking about 30 minutes on my machine with 9-10 seconds per sample.

@SaschaWillems
Copy link
Collaborator Author

SaschaWillems commented Nov 25, 2024

Indeed, it's something we need to address. We did some improvements, but still compilation times are too long compared to other similar projects. We'll probably move to C++20 (for other reasons) and then start using modules which should reduce build times, esp. for anything using Vulkan.hpp.

Windows is a bit better, but building this repo still takes almost 5 minutes in my setup, compared to building my own samples, which only takes ~40s.

@SaschaWillems
Copy link
Collaborator Author

We also do a lot of abstractions that are IMO totally unnecessary. Even for simple, non-Vulkan related things. This is causing us issues that are night impossible to debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework This is relevant to the framework
Projects
None yet
Development

No branches or pull requests

2 participants