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

Make vulkan build as optional #4815

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

alexkalmuk
Copy link
Contributor

Add cmake option WITH_VULKAN, which enables/disables Vulkan in Orbit in a straightforward way. It should introduce a bit of additional modularity to the Orbit. By default, this option set to ON (i.e., Vulkan enabled).
This change affects only Linux, related to #4814.

I'm not sure about one place:

if (timer_info.type() == TimerInfo::kGpuCommandBuffer) {
has_vulkan_layer_command_buffer_timers_ = true;
}

Basically, this file is compiled fine. On the other hand, it looks like it implicitly relies on Vulkan as a background layer.

@google-cla
Copy link

google-cla bot commented Mar 7, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

RunVulkanTutorial();
#else
ORBIT_ERROR("Vulkan isn't enabled");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can you extend the comment to include the flag? Something like: "Compile with WITH_VULKAN".

Copy link
Contributor Author

@alexkalmuk alexkalmuk Mar 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done (commits are squashed).

Copy link
Collaborator

@orbitprofiler-bot orbitprofiler-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your change. Please address the suggested formatting changes.

@@ -19,7 +19,9 @@
#include "OrbitBase/ExecutablePath.h"
#include "OrbitBase/Logging.h"
#include "OrbitBase/ThreadUtils.h"
#include "VulkanTutorial/OffscreenRenderingVulkanTutorial.h"
#ifdef VULKAN_ENABLED
#include "VulkanTutorial/OffscreenRenderingVulkanTutorial.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format:

Suggested change
#include "VulkanTutorial/OffscreenRenderingVulkanTutorial.h"
#include "VulkanTutorial/OffscreenRenderingVulkanTutorial.h"

Add option WITH_VULKAN, which is ON by default.
If set to OFF, modules OrbitTriggerCaptureVulkanLayer, OrbitVulkanLayer,
and VulkanTutorial won't be built
@alexkalmuk
Copy link
Contributor Author

By the way, I didn't update conanfile.py with the new option, which means that for Conan build Vulkan is enabled unconditionally.

@florian-kuebler
Copy link
Collaborator

By the way, I didn't update conanfile.py with the new option, which means that for Conan build Vulkan is enabled unconditionally.

I guess this is fine for now.

Copy link
Collaborator

@florian-kuebler florian-kuebler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@florian-kuebler florian-kuebler merged commit e9d7974 into google:main Mar 8, 2023
pierricgimmig pushed a commit to pierricgimmig/orbit that referenced this pull request Aug 18, 2023
Add option WITH_VULKAN, which is ON by default.
If set to OFF, modules OrbitTriggerCaptureVulkanLayer, OrbitVulkanLayer,
and VulkanTutorial won't be built
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants