From e892b7f1ac426fdc8a3ac1fa28026b86cc06279b Mon Sep 17 00:00:00 2001 From: iwubcode Date: Fri, 21 Jul 2023 19:09:40 -0500 Subject: VideoBackends: add support for cube maps for OGL, Vulkan, and D3D --- Source/Core/VideoBackends/Vulkan/VKTexture.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source/Core/VideoBackends/Vulkan/VKTexture.cpp') diff --git a/Source/Core/VideoBackends/Vulkan/VKTexture.cpp b/Source/Core/VideoBackends/Vulkan/VKTexture.cpp index f8923b4edc..e80ce4f2f7 100644 --- a/Source/Core/VideoBackends/Vulkan/VKTexture.cpp +++ b/Source/Core/VideoBackends/Vulkan/VKTexture.cpp @@ -70,7 +70,8 @@ std::unique_ptr VKTexture::Create(const TextureConfig& tex_config, st VkImageCreateInfo image_info = {VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, nullptr, - 0, + tex_config.IsCubeMap() ? VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT : + static_cast(0), VK_IMAGE_TYPE_2D, GetVkFormatForHostTextureFormat(tex_config.format), {tex_config.width, tex_config.height, 1}, @@ -106,7 +107,8 @@ std::unique_ptr VKTexture::Create(const TextureConfig& tex_config, st std::unique_ptr texture = std::make_unique( tex_config, alloc, image, name, VK_IMAGE_LAYOUT_UNDEFINED, ComputeImageLayout::Undefined); - if (!texture->CreateView(VK_IMAGE_VIEW_TYPE_2D_ARRAY)) + if (!texture->CreateView(tex_config.IsCubeMap() ? VK_IMAGE_VIEW_TYPE_CUBE : + VK_IMAGE_VIEW_TYPE_2D_ARRAY)) return nullptr; return texture; -- cgit v1.2.3