Vulkan: Fixes validation errors with "null" textures

These arise in non-buffered rendering when we don't have a framebuffer
to texture from.
This commit is contained in:
Henrik Rydgård committed 2022-10-28 18:40:55 +02:00
1 parent ac818d9639
commit c6fe91224a
3 files changed
+10 -3

No files matched your search

+2 -2
View File
@@ -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_;
}