raze/libraries/ZVulkan/include/zvulkan/vulkandevice.h
Christoph Oelckers 4a87003408 - backend update from GZDoom.
* Vulkan backend updated.
* zlib replaced with miniz.
* FileReader is now 64 bit capable.
* jpeg replaced with stb-image.
* CMake project warnings fixed.
2023-09-23 09:56:27 +02:00

52 lines
1.2 KiB
C++

#pragma once
#include "vulkaninstance.h"
#include <functional>
#include <mutex>
#include <vector>
#include <algorithm>
#include <memory>
class VulkanSwapChain;
class VulkanSemaphore;
class VulkanFence;
class VulkanPhysicalDevice;
class VulkanSurface;
class VulkanCompatibleDevice;
class VulkanDevice
{
public:
VulkanDevice(std::shared_ptr<VulkanInstance> instance, std::shared_ptr<VulkanSurface> surface, const VulkanCompatibleDevice& selectedDevice);
~VulkanDevice();
std::set<std::string> EnabledDeviceExtensions;
VulkanDeviceFeatures EnabledFeatures;
VulkanPhysicalDevice PhysicalDevice;
std::shared_ptr<VulkanInstance> Instance;
std::shared_ptr<VulkanSurface> Surface;
VkDevice device = VK_NULL_HANDLE;
VmaAllocator allocator = VK_NULL_HANDLE;
VkQueue GraphicsQueue = VK_NULL_HANDLE;
VkQueue PresentQueue = VK_NULL_HANDLE;
int GraphicsFamily = -1;
int PresentFamily = -1;
bool GraphicsTimeQueries = false;
bool SupportsExtension(const char* ext) const;
void SetObjectName(const char* name, uint64_t handle, VkObjectType type);
private:
bool DebugLayerActive = false;
void CreateDevice();
void CreateAllocator();
void ReleaseResources();
};