From 9fce945b62b1c1e71f91ef53dea12203c1c0d316 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 17 Jan 2020 04:18:49 +0000 Subject: [PATCH] [d3d9] Don't create views if we are a null resource --- src/d3d9/d3d9_subresource.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d3d9/d3d9_subresource.h b/src/d3d9/d3d9_subresource.h index ed18baf93..7ef871850 100644 --- a/src/d3d9/d3d9_subresource.h +++ b/src/d3d9/d3d9_subresource.h @@ -68,7 +68,7 @@ namespace dxvk { Rc GetImageView(bool Srgb) { Rc& view = m_sampleView.Pick(Srgb); - if (unlikely(view == nullptr)) + if (unlikely(view == nullptr && !IsNull())) view = m_texture->CreateView(m_face, m_mipLevel, VK_IMAGE_USAGE_SAMPLED_BIT, Srgb); return view; @@ -77,7 +77,7 @@ namespace dxvk { Rc GetRenderTargetView(bool Srgb) { Rc& view = m_renderTargetView.Pick(Srgb); - if (unlikely(view == nullptr)) + if (unlikely(view == nullptr && !IsNull())) view = m_texture->CreateView(m_face, m_mipLevel, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, Srgb); return view; @@ -90,7 +90,7 @@ namespace dxvk { Rc GetDepthStencilView() { Rc& view = m_depthStencilView; - if (unlikely(view == nullptr)) + if (unlikely(view == nullptr && !IsNull())) view = m_texture->CreateView(m_face, m_mipLevel, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, false); return view;