1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[d3d9] Don't create views if we are a null resource

This commit is contained in:
Joshua Ashton 2020-01-17 04:18:49 +00:00
parent bafcaa0c07
commit 9fce945b62

View File

@ -68,7 +68,7 @@ namespace dxvk {
Rc<DxvkImageView> GetImageView(bool Srgb) {
Rc<DxvkImageView>& 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<DxvkImageView> GetRenderTargetView(bool Srgb) {
Rc<DxvkImageView>& 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<DxvkImageView> GetDepthStencilView() {
Rc<DxvkImageView>& 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;