Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f5514504e1ab2449deb29445c8b4516698469f9b
      
https://github.com/WebKit/WebKit/commit/f5514504e1ab2449deb29445c8b4516698469f9b
  Author: Adrian Perez de Castro <[email protected]>
  Date:   2026-05-21 (Thu, 21 May 2026)

  Changed paths:
    M Source/WebCore/PlatformGTK.cmake
    M Source/WebCore/PlatformWPE.cmake
    A Source/WebCore/platform/graphics/vulkan/VulkanHandle.h
    A Source/WebCore/platform/graphics/vulkan/VulkanStructure.h
    M Source/WebCore/platform/graphics/vulkan/VulkanTypes.cpp
    M Source/WebCore/platform/graphics/vulkan/VulkanTypes.h
    M Source/WebCore/platform/graphics/vulkan/VulkanUtilities.cpp
    M Source/WebCore/platform/graphics/vulkan/VulkanUtilities.h
    A Source/WebCore/platform/graphics/vulkan/VulkanVolk.h

  Log Message:
  -----------
  [WPE][GTK] Rationalize Vulkan types and their base wrapper templates
https://bugs.webkit.org/show_bug.cgi?id=315200

Reviewed by Nikolas Zimmermann.

Factor out and improve the Vulkan base wrapper templates in the
following ways:

1. Rename BaseStruct<T> as Handle<T> and split it off into its own
   header, along with a new BorrowedHandle<T> template. While at it, add
   convenience methods (swap, leakPtr, boolean check, etc.) to make them
   behave in a way more similar to other WebKit smart pointers.

2. Move Structure<T, C> into its own header, and remove its inheritance
   from BaseStruct<T>, because structures and handles are unrelated Vulkan
   types which are treated differently. The inheritance was intended to
   reuse code; but the advantage was negligible.

3. Make the Structure::m_inner and Handle::m_ptr members private.

4. Move the VOLK_NO_DEVICE_PROTOTYPES and volk.h inclusion into a separate
   VulkanVolk.h header, which WebKit code can use to avoid accidentally
   forgetting to define the macro.

* Source/WebCore/PlatformGTK.cmake: List added headers.
* Source/WebCore/PlatformWPE.cmake: Ditto.
* Source/WebCore/platform/graphics/vulkan/VulkanHandle.h: Added.
(WebCore::Vulkan::Handle::Handle):
(WebCore::Vulkan::Handle::swap):
(WebCore::Vulkan::Handle::operator=):
(WebCore::Vulkan::Handle::leakPtr):
(WebCore::Vulkan::Handle::operator bool const):
(WebCore::Vulkan::Handle::operator! const):
(WebCore::Vulkan::BorrowedHandle::operator bool const):
(WebCore::Vulkan::BorrowedHandle::operator! const):
* Source/WebCore/platform/graphics/vulkan/VulkanStructure.h: Added.
(WebCore::Vulkan::Structure::Structure):
(WebCore::Vulkan::Structure::next):
* Source/WebCore/platform/graphics/vulkan/VulkanTypes.cpp:
(WebCore::Vulkan::ApplicationInfo::ApplicationInfo):
(WebCore::Vulkan::InstanceCreateInfo::InstanceCreateInfo):
(WebCore::Vulkan::PhysicalDeviceIDProperties::deviceUUID const):
(WebCore::Vulkan::PhysicalDeviceIDProperties::driverUUID const):
(WebCore::Vulkan::PhysicalDevice::fillProperties const):
(WebCore::Vulkan::PhysicalDevice::queueFamilies const):
(WebCore::Vulkan::DeviceQueueCreateInfo::DeviceQueueCreateInfo):
(WebCore::Vulkan::DeviceCreateInfo::DeviceCreateInfo):
(WebCore::Vulkan::Device::Device):
(WebCore::Vulkan::Device::~Device):
(WebCore::Vulkan::Device::create):
(WebCore::Vulkan::Device::setSharedDevice):
(WebCore::Vulkan::Device::sharedDeviceIfExists):
(WebCore::Vulkan::Device::sharedDevice):
(WebCore::Vulkan::Instance::setSharedInstance):
(WebCore::Vulkan::Instance::sharedInstanceIfExists):
(WebCore::Vulkan::Instance::sharedInstance):
(WebCore::Vulkan::Instance::create):
(WebCore::Vulkan::Instance::Instance):
(WebCore::Vulkan::Instance::~Instance):
(WebCore::Vulkan::Instance::availableDevices const):
(WebCore::Vulkan::Instance::installDebugMessenger):
* Source/WebCore/platform/graphics/vulkan/VulkanTypes.h:
(WebCore::Vulkan::PhysicalDeviceProperties::operator-> const):
(WebCore::Vulkan::PhysicalDeviceProperties::operator->):
(WebCore::Vulkan::Device::Device):
(WebCore::Vulkan::Device::operator=):
(WebCore::Vulkan::Device::swap):
(WebCore::Vulkan::Instance::Instance):
(WebCore::Vulkan::Instance::operator=):
(WebCore::Vulkan::Instance::swap):
(WebCore::Vulkan::BaseStruct::BaseStruct): Deleted.
(WebCore::Vulkan::BaseStruct::operator=): Deleted.
(WebCore::Vulkan::BaseStruct::ptr const): Deleted.
(WebCore::Vulkan::BaseStruct::ptr): Deleted.
(WebCore::Vulkan::Structure::Structure): Deleted.
(WebCore::Vulkan::Structure::next): Deleted.
(WebCore::Vulkan::Structure::operator-> const): Deleted.
(WebCore::Vulkan::Structure::operator->): Deleted.
(WebCore::Vulkan::QueueFamilyProperties::operator-> const): Deleted.
(WebCore::Vulkan::QueueFamilyProperties::operator->): Deleted.
(WebCore::Vulkan::PhysicalDevice::PhysicalDevice): Deleted.
* Source/WebCore/platform/graphics/vulkan/VulkanUtilities.cpp:
(WebCore::Vulkan::initializeIfNeeded):
* Source/WebCore/platform/graphics/vulkan/VulkanUtilities.h:
* Source/WebCore/platform/graphics/vulkan/VulkanVolk.h: Copied from 
Source/WebCore/platform/graphics/vulkan/VulkanUtilities.h.

Canonical link: https://commits.webkit.org/313650@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to