Skip to content

Commit

Permalink
[Impeller] Don't override user specification on Vulkan validation in …
Browse files Browse the repository at this point in the history
…unopt. (#54816)

This overrides the documented behavior silently but only in unopt. Make opt and unopt modes behave the same. Disabling validation is frequently necessary to test behavior on simulators or when connecting to Renderdoc.
  • Loading branch information
chinmaygarde authored Aug 27, 2024
1 parent f2b4989 commit 5a9de11
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions impeller/renderer/backend/vulkan/context_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,8 @@ void ContextVK::Setup(Settings settings) {
auto& dispatcher = VULKAN_HPP_DEFAULT_DISPATCHER;
dispatcher.init(settings.proc_address_callback);

// Enable Vulkan validation if either:
// 1. The user has explicitly enabled it.
// 2. We are in a combination of debug mode, and running on Android.
// (It's possible 2 is overly conservative and we can simplify this)
auto enable_validation = settings.enable_validation;

#if defined(FML_OS_ANDROID) && !defined(NDEBUG)
enable_validation = true;
#endif

auto caps = std::shared_ptr<CapabilitiesVK>(new CapabilitiesVK(
enable_validation, settings.fatal_missing_validations));
settings.enable_validation, settings.fatal_missing_validations));

if (!caps->IsValid()) {
VALIDATION_LOG << "Could not determine device capabilities.";
Expand Down

0 comments on commit 5a9de11

Please sign in to comment.