Skip to content

Conversation

@jason-simmons
Copy link
Member

The build script for this version of the Vulkan headers defines VK_USE_PLATFORM_XLIB_KHR. This brings in some X11 headers that define macros with commonly used names.

Files that include Vulkan headers may need to undefine some of these macros to prevent conflicts with other code that uses the same names.

@github-actions github-actions bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Sep 30, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates Vulkan dependencies and addresses macro conflicts introduced by X11 headers. It undefines conflicting macros like Bool, None, Status, and Success in common Vulkan headers. Additionally, it improves error handling by checking the return value of vkResetCommandPool and removes an unnecessary Vulkan header from a GL test file. My review includes a suggestion to refactor the command pool reset logic for better readability and to reduce duplication.

Comment on lines 275 to 282
vk::Result result;
if (should_trim) {
buffers.clear();
device.resetCommandPool(pool.get(),
vk::CommandPoolResetFlagBits::eReleaseResources);
result = device.resetCommandPool(
pool.get(), vk::CommandPoolResetFlagBits::eReleaseResources);
} else {
device.resetCommandPool(pool.get(), {});
result = device.resetCommandPool(pool.get(), {});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To reduce code duplication, you could determine the flags first and then make a single call to resetCommandPool.

  vk::CommandPoolResetFlags flags = {};
  if (should_trim) {
    buffers.clear();
    flags = vk::CommandPoolResetFlagBits::eReleaseResources;
  }
  const auto result = device.resetCommandPool(pool.get(), flags);

Copy link
Member

Choose a reason for hiding this comment

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

not a bad call gem gem

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@jason-simmons
Copy link
Member Author

@chinmaygarde PTAL at the changes that were required by the latest Vulkan validation layers:


#include <vulkan/vulkan.h>

// The Vulkan headers may bring in X11 headers which define some macros that
Copy link
Member

Choose a reason for hiding this comment

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

Maybe and ifdef-undef pair instead? I am pretty sure this would cause errors in TUs that dont suppress the "undefining an unknown macro".

Copy link
Member

Choose a reason for hiding this comment

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

Ditto elsewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

The language spec says that #undef can safely be used for a macro with no previous definition

virtual size_t GetMinimumUniformAlignment() const = 0;

/// @brief The minimum alignment of storage buffer value offsets in bytes.
virtual size_t GetMinimumStorageAlignment() const {
Copy link
Member

Choose a reason for hiding this comment

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

OOL virtuals please.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

virtual size_t GetMinimumUniformAlignment() const = 0;

/// @brief The minimum alignment of storage buffer value offsets in bytes.
virtual size_t GetMinimumStorageAlignment() const {
Copy link
Member

Choose a reason for hiding this comment

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

GetMinimumStorageBuffer alignment? Or even GetMinimumSSBO alignment? I wasn't sure what storage was without a lot of context.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to GetMinimumStorageBufferAlignment


minimum_uniform_alignment_ =
device_properties_.limits.minUniformBufferOffsetAlignment;
minimum_storage_alignment_ =
Copy link
Member

Choose a reason for hiding this comment

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

Dang. I didn't know these were different. TIL.

swapchain_info.imageExtent.height);

std::vector<std::shared_ptr<KHRSwapchainImageVK>> swapchain_images;
std::vector<vk::UniqueSemaphore> present_semaphores;
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the context. TIL.

vk::PhysicalDevice physical_device_;
vk::PhysicalDeviceProperties device_properties_;
size_t minimum_uniform_alignment_ = 256;
size_t minimum_storage_alignment_ = 256;
Copy link
Member

Choose a reason for hiding this comment

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

In a later patch, we should add a comment for each of these to the GPU info page so its easier to tell whats out there in the wild. For instance, for this one, I had to look up https://vulkan.gpuinfo.org/displaydevicelimit.php?name=minStorageBufferOffsetAlignment&platform=all.

Comment on lines 275 to 282
vk::Result result;
if (should_trim) {
buffers.clear();
device.resetCommandPool(pool.get(),
vk::CommandPoolResetFlagBits::eReleaseResources);
result = device.resetCommandPool(
pool.get(), vk::CommandPoolResetFlagBits::eReleaseResources);
} else {
device.resetCommandPool(pool.get(), {});
result = device.resetCommandPool(pool.get(), {});
}
Copy link
Member

Choose a reason for hiding this comment

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

not a bad call gem gem

The build script for this version of the Vulkan headers defines VK_USE_PLATFORM_XLIB_KHR.  This brings in some X11 headers that define macros with commonly used names.

Files that include Vulkan headers may need to undefine some of these macros to prevent conflicts with other code that uses the same names.
@jason-simmons jason-simmons force-pushed the roll_vulkan_deps_092625 branch from 13e2d69 to bb3971f Compare October 3, 2025 20:53
@jason-simmons jason-simmons added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 6, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Oct 6, 2025
Merged via the queue into flutter:master with commit 003eb65 Oct 6, 2025
188 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 6, 2025
Var('swiftshader_git') + '/SwiftShader.git' + '@' + 'd040a5bab638bf7c226235c95787ba6288bb6416',

'engine/src/flutter/third_party/angle':
Var('chromium_git') + '/angle/angle.git' + '@' + '6a09e41ce6ea8c93524faae1a925eb01562f53b1',

Choose a reason for hiding this comment

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

This broke the angle -> flutter roller. Was it intentional? Does the roller configuration need to be updated?

Copy link
Member Author

Choose a reason for hiding this comment

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

The ANGLE->Flutter roller has been stopped for a long time and I don't think it will be reactivated in the near future.

The version of ANGLE used in Flutter now requires patches for compatibility with the Flutter engine source tree and is hosted in a branch on https://flutter.googlesource.com/. For now I expect that any future rolls of ANGLE will be done manually.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 7, 2025
mboetger pushed a commit to mboetger/flutter that referenced this pull request Oct 7, 2025
The build script for this version of the Vulkan headers defines
VK_USE_PLATFORM_XLIB_KHR. This brings in some X11 headers that define
macros with commonly used names.

Files that include Vulkan headers may need to undefine some of these
macros to prevent conflicts with other code that uses the same names.
okorohelijah pushed a commit to okorohelijah/flutter that referenced this pull request Oct 7, 2025
The build script for this version of the Vulkan headers defines
VK_USE_PLATFORM_XLIB_KHR. This brings in some X11 headers that define
macros with commonly used names.

Files that include Vulkan headers may need to undefine some of these
macros to prevent conflicts with other code that uses the same names.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Oct 8, 2025
Roll Flutter from 908012d58baa to e11e2c11288b (39 revisions)

flutter/flutter@908012d...e11e2c1

2025-10-08 [email protected] Configure FfiNative resolver on dart:io (flutter/flutter#176621)
2025-10-08 [email protected] Marks Linux_pixel_7pro service_extensions_test to be unflaky (flutter/flutter#176700)
2025-10-08 [email protected] Keyboard Animation Fix (flutter/flutter#176418)
2025-10-08 [email protected] Feat: Add carousel view builder (flutter/flutter#172837)
2025-10-08 [email protected] Roll Skia from d10a0d877ff4 to ea7cdbc6b986 (15 revisions) (flutter/flutter#176686)
2025-10-08 [email protected] Roll Fuchsia Linux SDK from jJr3my9C6TwYWPygi... to xrIAL91ngrd-wNr9S... (flutter/flutter#176682)
2025-10-08 [email protected] Fix InputDecoration helper/error padding is not compliant (flutter/flutter#176353)
2025-10-08 [email protected] Fix PopupMenu does not update when PopupMenuTheme in Theme changes. (flutter/flutter#175513)
2025-10-07 [email protected] Roll Dart SDK to 3.10.0-290.1.beta (flutter/flutter#176629)
2025-10-07 [email protected] [ Tool ] Output `app.dtd` and `app.devTools` in machine mode (flutter/flutter#176655)
2025-10-07 [email protected] Rename UIScene integration test projects and fix Xcode compatibility (flutter/flutter#176635)
2025-10-07 [email protected] Selecting an implementation widget with the on-device inspector opens the code location for the nearest project widget (flutter/flutter#176530)
2025-10-07 [email protected] Migrate to `WidgetStateInputBorder` (flutter/flutter#176386)
2025-10-07 [email protected] Make it clear that you need to install clangd in VSCode intellisense c++ config (flutter/flutter#176609)
2025-10-07 [email protected] Bump the customer tests to pick up an update to Zulip's tests. (flutter/flutter#176463)
2025-10-07 [email protected] Roll Packages from d3ef88b to 8ca6416 (2 revisions) (flutter/flutter#176633)
2025-10-07 [email protected] Add fallback for 'scene:willConnectToSession:options' (flutter/flutter#176580)
2025-10-07 [email protected] Roll Skia from d09786dfb854 to d10a0d877ff4 (11 revisions) (flutter/flutter#176616)
2025-10-07 [email protected] [ Widget Preview ] Rework UI and theming (flutter/flutter#176581)
2025-10-07 [email protected] Handle FlutterEngine registration when embedded in Multi-Scene apps (flutter/flutter#176490)
2025-10-07 [email protected] Fix code style in Linux embedder template (flutter/flutter#176256)
2025-10-07 [email protected] Add tooling to migrate to UIScene (flutter/flutter#176427)
2025-10-06 [email protected] Bump customer tests.version to 986c4326b4e4bb4e37bc963c2cc2aaa10b943859 (flutter/flutter#176594)
2025-10-06 [email protected] Fix typo in pages.dart (flutter/flutter#176438)
2025-10-06 [email protected] Fix: Update anchorRect for overlayBuilder when anchor moves (flutter/flutter#169814)
2025-10-06 [email protected] Roll Fuchsia Linux SDK from Zm6K_3gP3VCaMy9rH... to jJr3my9C6TwYWPygi... (flutter/flutter#176591)
2025-10-06 [email protected] Fix deprecated configureStatusBarForFullscreenFlutterExperience for Android 15+ (flutter/flutter#175501)
2025-10-06 [email protected] updates docs for flutter engine footprint (flutter/flutter#176217)
2025-10-06 [email protected] [ Widget Preview ] Fix `WidgetInspectorService` override (flutter/flutter#176550)
2025-10-06 [email protected] Fix NavigatorBar lacks visual feedback (flutter/flutter#175182)
2025-10-06 [email protected] Roll Packages from e401aeb to d3ef88b (4 revisions) (flutter/flutter#176582)
2025-10-06 [email protected] Roll Dart SDK from 898380a41c90 to 6b0193498f09 (2 revisions) (flutter/flutter#176576)
2025-10-06 [email protected] Roll Skia from bc7cf194f4ee to d09786dfb854 (1 revision) (flutter/flutter#176577)
2025-10-06 [email protected] Roll vulkan-deps to a9e2ca3b (flutter/flutter#176322)
2025-10-06 [email protected] Add an AppDelegate callback for implicit FlutterEngines (flutter/flutter#176240)
2025-10-06 [email protected] Roll Skia from 45191c22b15c to bc7cf194f4ee (2 revisions) (flutter/flutter#176572)
2025-10-06 [email protected] [ Widget Preview ] Fix type error when retrieving flags from persistent preferences (flutter/flutter#176546)
2025-10-06 [email protected] Roll Skia from 1fd0ca1f2120 to 45191c22b15c (3 revisions) (flutter/flutter#176556)
2025-10-05 [email protected] Roll Dart SDK from 016a8c0045fd to 898380a41c90 (1 revision) (flutter/flutter#176549)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
The build script for this version of the Vulkan headers defines
VK_USE_PLATFORM_XLIB_KHR. This brings in some X11 headers that define
macros with commonly used names.

Files that include Vulkan headers may need to undefine some of these
macros to prevent conflicts with other code that uses the same names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants