This commit is contained in:
2025-09-10 04:09:26 +03:00
parent 1e060cba27
commit fd9d39bf8b
163 changed files with 14832 additions and 1030 deletions
@@ -0,0 +1,36 @@
#pragma once
#include <vector>
#include <stdexcept>
#include <IntrusivePtr.h>
#include <VulkanPP/VulkanFunctions.hpp>
namespace VulkanPP {
class PhysicalDevice;
// === Lifetime summary (deterministic) ===
// Handle: VkDisplayKHR
// Holds (destroy/free owners + creation parent, or producer parent): PhysicalDevice
// Keeps (from *CreateInfo/*AllocateInfo): —
// Destructor calls vkDestroy*/vkFree* only if _owned == true.
class DisplayKHR : public RefCounted {
public:
VkDisplayKHR getHandle() const noexcept { return _handle; }
IntrusivePtr<PhysicalDevice> getPhysicalDevice() const noexcept { return _owner0; }
public:
static IntrusivePtr<DisplayKHR> fromHandle(IntrusivePtr<PhysicalDevice> owner0, VkDisplayKHR handle) {
return IntrusivePtr<DisplayKHR>(new DisplayKHR(owner0, handle, false));
}
private:
explicit DisplayKHR(IntrusivePtr<PhysicalDevice> owner0, VkDisplayKHR handle, bool owned);
~DisplayKHR() override;
private:
VkDisplayKHR _handle{VK_NULL_HANDLE};
bool _owned{false};
IntrusivePtr<PhysicalDevice> _owner0;
};
using PDisplayKHR = IntrusivePtr<DisplayKHR>;
} // namespace VulkanPP