diff --git a/Common/GPU/Vulkan/thin3d_vulkan.cpp b/Common/GPU/Vulkan/thin3d_vulkan.cpp index fda775f1d0..17d6ed113c 100644 --- a/Common/GPU/Vulkan/thin3d_vulkan.cpp +++ b/Common/GPU/Vulkan/thin3d_vulkan.cpp @@ -1343,7 +1343,11 @@ void VKContext::BindTextures(int start, int count, Texture **textures, TextureBi boundImageView_[i] = boundTextures_[i]->GetImageView(); } } else { - boundImageView_[i] = GetNullTexture()->GetImageView(); + if (flags & TextureBindFlags::VULKAN_BIND_ARRAY) { + boundImageView_[i] = GetNullTexture()->GetImageArrayView(); + } else { + boundImageView_[i] = GetNullTexture()->GetImageView(); + } } } } @@ -1693,6 +1697,8 @@ uint64_t VKContext::GetNativeObject(NativeObject obj, void *srcObject) { return (uint64_t)(uintptr_t)&renderManager_; case NativeObject::NULL_IMAGEVIEW: return (uint64_t)GetNullTexture()->GetImageView(); + case NativeObject::NULL_IMAGEVIEW_ARRAY: + return (uint64_t)GetNullTexture()->GetImageArrayView(); case NativeObject::TEXTURE_VIEW: return (uint64_t)(((VKTexture *)srcObject)->GetImageView()); case NativeObject::BOUND_FRAMEBUFFER_COLOR_IMAGEVIEW_ALL_LAYERS: diff --git a/Common/GPU/thin3d.h b/Common/GPU/thin3d.h index 695e1c83c8..9bc0c3a14a 100644 --- a/Common/GPU/thin3d.h +++ b/Common/GPU/thin3d.h @@ -249,6 +249,7 @@ enum class NativeObject { RENDER_MANAGER, TEXTURE_VIEW, NULL_IMAGEVIEW, + NULL_IMAGEVIEW_ARRAY, FRAME_DATA_DESC_SET_LAYOUT, THIN3D_PIPELINE_LAYOUT, }; diff --git a/GPU/Vulkan/DrawEngineVulkan.cpp b/GPU/Vulkan/DrawEngineVulkan.cpp index 68108fe107..f54afee3a9 100644 --- a/GPU/Vulkan/DrawEngineVulkan.cpp +++ b/GPU/Vulkan/DrawEngineVulkan.cpp @@ -770,7 +770,7 @@ void DrawEngineVulkan::DoFlush() { textureCache_->ApplyTexture(); textureCache_->GetVulkanHandles(imageView, sampler); if (imageView == VK_NULL_HANDLE) - imageView = (VkImageView)draw_->GetNativeObject(Draw::NativeObject::NULL_IMAGEVIEW); + imageView = (VkImageView)draw_->GetNativeObject(gstate_c.arrayTexture ? Draw::NativeObject::NULL_IMAGEVIEW_ARRAY : Draw::NativeObject::NULL_IMAGEVIEW); if (sampler == VK_NULL_HANDLE) sampler = nullSampler_; } @@ -906,7 +906,7 @@ void DrawEngineVulkan::DoFlush() { textureCache_->ApplyTexture(); textureCache_->GetVulkanHandles(imageView, sampler); if (imageView == VK_NULL_HANDLE) - imageView = (VkImageView)draw_->GetNativeObject(Draw::NativeObject::NULL_IMAGEVIEW); + imageView = (VkImageView)draw_->GetNativeObject(gstate_c.arrayTexture ? Draw::NativeObject::NULL_IMAGEVIEW_ARRAY : Draw::NativeObject::NULL_IMAGEVIEW); if (sampler == VK_NULL_HANDLE) sampler = nullSampler_; }