From 5618b6ce04f56c3065510424893e462d05799ee4 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Tue, 6 Feb 2024 08:41:04 +0000 Subject: [PATCH] rendervulkan: Use getprocaddr for vkCreateImageView --- src/backend.h | 2 +- src/rendervulkan.cpp | 6 +++--- src/vulkan_include.h | 4 ++++ src/wlserver.hpp | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 src/vulkan_include.h diff --git a/src/backend.h b/src/backend.h index 37e93345b..f19456a75 100644 --- a/src/backend.h +++ b/src/backend.h @@ -2,8 +2,8 @@ #include "color_helpers.h" #include "gamescope_shared.h" +#include "vulkan_include.h" -#include "vulkan/vulkan_core.h" #include #include #include diff --git a/src/rendervulkan.cpp b/src/rendervulkan.cpp index 7cb3c1df3..d476d443b 100644 --- a/src/rendervulkan.cpp +++ b/src/rendervulkan.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include "vulkan_include.h" #if defined(__linux__) #include @@ -2315,7 +2315,7 @@ bool CVulkanTexture::BInit( uint32_t width, uint32_t height, uint32_t depth, uin createInfo.format = VK_FORMAT_R8_UNORM; createInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_PLANE_0_BIT; - res = vkCreateImageView(g_device.device(), &createInfo, nullptr, &m_lumaView); + res = g_device.vk.CreateImageView(g_device.device(), &createInfo, nullptr, &m_lumaView); if ( res != VK_SUCCESS ) { vk_errorf( res, "vkCreateImageView failed" ); return false; @@ -2324,7 +2324,7 @@ bool CVulkanTexture::BInit( uint32_t width, uint32_t height, uint32_t depth, uin createInfo.pNext = NULL; createInfo.format = VK_FORMAT_R8G8_UNORM; createInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_PLANE_1_BIT; - res = vkCreateImageView(g_device.device(), &createInfo, nullptr, &m_chromaView); + res = g_device.vk.CreateImageView(g_device.device(), &createInfo, nullptr, &m_chromaView); if ( res != VK_SUCCESS ) { vk_errorf( res, "vkCreateImageView failed" ); return false; diff --git a/src/vulkan_include.h b/src/vulkan_include.h new file mode 100644 index 000000000..1f78e5232 --- /dev/null +++ b/src/vulkan_include.h @@ -0,0 +1,4 @@ +#pragma once + +#define VK_NO_PROTOTYPES +#include diff --git a/src/wlserver.hpp b/src/wlserver.hpp index c148847fb..f0b8e1e1c 100644 --- a/src/wlserver.hpp +++ b/src/wlserver.hpp @@ -11,7 +11,8 @@ #include #include #include -#include + +#include "vulkan_include.h" #include "steamcompmgr_shared.hpp"