summaryrefslogtreecommitdiff
path: root/drivers/vulkan/vulkan_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vulkan/vulkan_context.h')
-rw-r--r--drivers/vulkan/vulkan_context.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/vulkan/vulkan_context.h b/drivers/vulkan/vulkan_context.h
index 2f10fbfdef..51c3febb47 100644
--- a/drivers/vulkan/vulkan_context.h
+++ b/drivers/vulkan/vulkan_context.h
@@ -33,6 +33,8 @@
#include "core/error_list.h"
#include "core/map.h"
+#include "core/os/mutex.h"
+#include "core/rid_owner.h"
#include "core/ustring.h"
#include "servers/display_server.h"
#include <vulkan/vulkan.h>
@@ -45,8 +47,6 @@ class VulkanContext {
FRAME_LAG = 2
};
- bool use_validation_layers;
-
VkInstance inst;
VkSurfaceKHR surface;
VkPhysicalDevice gpu;
@@ -107,6 +107,14 @@ class VulkanContext {
}
};
+ struct LocalDevice {
+ bool waiting = false;
+ VkDevice device;
+ VkQueue queue;
+ };
+
+ RID_Owner<LocalDevice, true> local_device_owner;
+
Map<DisplayServer::WindowID, Window> windows;
uint32_t swapchainImageCount;
@@ -181,6 +189,8 @@ protected:
bool buffers_prepared;
+ bool use_validation_layers;
+
public:
VkDevice get_device();
VkPhysicalDevice get_physical_device();
@@ -194,6 +204,12 @@ public:
VkFramebuffer window_get_framebuffer(DisplayServer::WindowID p_window = 0);
VkRenderPass window_get_render_pass(DisplayServer::WindowID p_window = 0);
+ RID local_device_create();
+ VkDevice local_device_get_vk_device(RID p_local_device);
+ void local_device_push_command_buffers(RID p_local_device, const VkCommandBuffer *p_buffers, int p_count);
+ void local_device_sync(RID p_local_device);
+ void local_device_free(RID p_local_device);
+
VkFormat get_screen_format() const;
VkPhysicalDeviceLimits get_device_limits() const;