Vulkan: Construct a Vulkan 1.2 Context. #107300

Merged
Jeroen Bakker merged 1 commits from Jeroen-Bakker/blender:vulkan-init-correct-context into main 2023-04-24 15:32:24 +02:00
9 changed files with 9 additions and 12 deletions

View File

@ -761,7 +761,7 @@ GHOST_IContext *GHOST_SystemCocoa::createOffscreenContext(GHOST_GLSettings glSet
#ifdef WITH_VULKAN_BACKEND #ifdef WITH_VULKAN_BACKEND
if (glSettings.context_type == GHOST_kDrawingContextTypeVulkan) { if (glSettings.context_type == GHOST_kDrawingContextTypeVulkan) {
const bool debug_context = (glSettings.flags & GHOST_glDebugContext) != 0; const bool debug_context = (glSettings.flags & GHOST_glDebugContext) != 0;
GHOST_Context *context = new GHOST_ContextVK(false, NULL, 1, 0, debug_context); GHOST_Context *context = new GHOST_ContextVK(false, NULL, 1, 2, debug_context);
if (!context->initializeDrawingContext()) { if (!context->initializeDrawingContext()) {
delete context; delete context;
return NULL; return NULL;

View File

@ -6298,7 +6298,7 @@ GHOST_IContext *GHOST_SystemWayland::createOffscreenContext(GHOST_GLSettings glS
wl_surface, wl_surface,
display_->wl_display, display_->wl_display,
1, 1,
0, 2,
debug_context); debug_context);
if (!context->initializeDrawingContext()) { if (!context->initializeDrawingContext()) {

View File

@ -267,7 +267,7 @@ GHOST_IContext *GHOST_SystemWin32::createOffscreenContext(GHOST_GLSettings glSet
#ifdef WITH_VULKAN_BACKEND #ifdef WITH_VULKAN_BACKEND
/* Vulkan does not need a window. */ /* Vulkan does not need a window. */
if (glSettings.context_type == GHOST_kDrawingContextTypeVulkan) { if (glSettings.context_type == GHOST_kDrawingContextTypeVulkan) {
context = new GHOST_ContextVK(false, (HWND)0, 1, 0, debug_context); context = new GHOST_ContextVK(false, (HWND)0, 1, 2, debug_context);
if (!context->initializeDrawingContext()) { if (!context->initializeDrawingContext()) {
delete context; delete context;

View File

@ -417,7 +417,7 @@ GHOST_IContext *GHOST_SystemX11::createOffscreenContext(GHOST_GLSettings glSetti
#ifdef WITH_VULKAN_BACKEND #ifdef WITH_VULKAN_BACKEND
if (glSettings.context_type == GHOST_kDrawingContextTypeVulkan) { if (glSettings.context_type == GHOST_kDrawingContextTypeVulkan) {
context = new GHOST_ContextVK( context = new GHOST_ContextVK(
false, GHOST_kVulkanPlatformX11, 0, m_display, NULL, NULL, 1, 0, debug_context); false, GHOST_kVulkanPlatformX11, 0, m_display, NULL, NULL, 1, 2, debug_context);
if (!context->initializeDrawingContext()) { if (!context->initializeDrawingContext()) {
delete context; delete context;

View File

@ -815,7 +815,7 @@ GHOST_Context *GHOST_WindowCocoa::newDrawingContext(GHOST_TDrawingContextType ty
{ {
#ifdef WITH_VULKAN_BACKEND #ifdef WITH_VULKAN_BACKEND
if (type == GHOST_kDrawingContextTypeVulkan) { if (type == GHOST_kDrawingContextTypeVulkan) {
GHOST_Context *context = new GHOST_ContextVK(m_wantStereoVisual, m_metalLayer, 1, 0, true); GHOST_Context *context = new GHOST_ContextVK(m_wantStereoVisual, m_metalLayer, 1, 2, true);
if (!context->initializeDrawingContext()) { if (!context->initializeDrawingContext()) {
delete context; delete context;

View File

@ -1744,7 +1744,7 @@ GHOST_Context *GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType
window_->wl_surface, window_->wl_surface,
system_->wl_display(), system_->wl_display(),
1, 1,
0, 2,
true); true);
break; break;
#endif #endif

View File

@ -637,7 +637,7 @@ GHOST_Context *GHOST_WindowWin32::newDrawingContext(GHOST_TDrawingContextType ty
#ifdef WITH_VULKAN_BACKEND #ifdef WITH_VULKAN_BACKEND
else if (type == GHOST_kDrawingContextTypeVulkan) { else if (type == GHOST_kDrawingContextTypeVulkan) {
GHOST_Context *context = new GHOST_ContextVK(false, m_hWnd, 1, 0, m_debug_context); GHOST_Context *context = new GHOST_ContextVK(false, m_hWnd, 1, 2, m_debug_context);
if (context->initializeDrawingContext()) { if (context->initializeDrawingContext()) {
return context; return context;

View File

@ -1235,7 +1235,7 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
NULL, NULL,
NULL, NULL,
1, 1,
0, 2,
m_is_debug_context); m_is_debug_context);
if (!context->initializeDrawingContext()) { if (!context->initializeDrawingContext()) {

View File

@ -39,10 +39,7 @@ VKContext::VKContext(void *ghost_window, void *ghost_context)
/* Initialize the memory allocator. */ /* Initialize the memory allocator. */
VmaAllocatorCreateInfo info = {}; VmaAllocatorCreateInfo info = {};
/* Should use same vulkan version as GHOST (1.2), but set to 1.0 as 1.2 requires info.vulkanApiVersion = VK_API_VERSION_1_2;
* correct extensions and functions to be found by VMA, which isn't working as expected and
* requires more research. To continue development we lower the API to version 1.0. */
info.vulkanApiVersion = VK_API_VERSION_1_0;
info.physicalDevice = vk_physical_device_; info.physicalDevice = vk_physical_device_;
info.device = vk_device_; info.device = vk_device_;
info.instance = vk_instance_; info.instance = vk_instance_;