summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'vulkan/libvulkan/driver.h')
-rw-r--r--vulkan/libvulkan/driver.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/vulkan/libvulkan/driver.h b/vulkan/libvulkan/driver.h
index de9d1c65a0..22db93f577 100644
--- a/vulkan/libvulkan/driver.h
+++ b/vulkan/libvulkan/driver.h
@@ -18,6 +18,7 @@
#define LIBVULKAN_DRIVER_H 1
#include <inttypes.h>
+#include <bitset>
#include <type_traits>
#include <log/log.h>
@@ -25,6 +26,9 @@
#include <hardware/hwvulkan.h>
#include "api_gen.h"
+#include "driver_gen.h"
+#include "debug_report.h"
+#include "swapchain.h"
namespace vulkan {
@@ -61,15 +65,43 @@ struct DeviceData {
namespace driver {
struct InstanceData {
+ InstanceData(const VkAllocationCallbacks& alloc)
+ : opaque_api_data(),
+ allocator(alloc),
+ driver(),
+ get_device_proc_addr(nullptr) {
+ hook_extensions.set(ProcHook::EXTENSION_CORE);
+ hal_extensions.set(ProcHook::EXTENSION_CORE);
+ }
+
api::InstanceData opaque_api_data;
const VkAllocationCallbacks allocator;
+
+ std::bitset<ProcHook::EXTENSION_COUNT> hook_extensions;
+ std::bitset<ProcHook::EXTENSION_COUNT> hal_extensions;
+
+ InstanceDriverTable driver;
+ PFN_vkGetDeviceProcAddr get_device_proc_addr;
+
+ DebugReportCallbackList debug_report_callbacks;
};
struct DeviceData {
+ DeviceData(const VkAllocationCallbacks& alloc)
+ : opaque_api_data(), allocator(alloc), driver() {
+ hook_extensions.set(ProcHook::EXTENSION_CORE);
+ hal_extensions.set(ProcHook::EXTENSION_CORE);
+ }
+
api::DeviceData opaque_api_data;
const VkAllocationCallbacks allocator;
+
+ std::bitset<ProcHook::EXTENSION_COUNT> hook_extensions;
+ std::bitset<ProcHook::EXTENSION_COUNT> hal_extensions;
+
+ DeviceDriverTable driver;
};
bool Debuggable();
@@ -80,6 +112,17 @@ const VkAllocationCallbacks& GetDefaultAllocator();
VKAPI_ATTR PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* pName);
VKAPI_ATTR PFN_vkVoidFunction GetDeviceProcAddr(VkDevice device, const char* pName);
VKAPI_ATTR VkResult EnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties);
+
+VKAPI_ATTR VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties);
+
+VKAPI_ATTR VkResult CreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance);
+VKAPI_ATTR void DestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator);
+VKAPI_ATTR VkResult CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice);
+VKAPI_ATTR void DestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator);
+
+VKAPI_ATTR VkResult EnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
+VKAPI_ATTR void GetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue);
+VKAPI_ATTR VkResult AllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers);
// clang-format on
template <typename DispatchableType>