D3D12Device: Fix crash on SW renderer switch

This commit is contained in:
Stenzek 2023-12-09 01:45:36 +10:00
parent 1f4a37f8eb
commit 1a5865bf95
No known key found for this signature in database
1 changed files with 5 additions and 5 deletions

View File

@ -233,8 +233,8 @@ bool D3D12Device::CreateRTVDescriptor(ID3D12Resource* resource, u32 samples, DXG
return false;
}
const D3D12_RENDER_TARGET_VIEW_DESC desc = {format, (samples > 1) ? D3D12_RTV_DIMENSION_TEXTURE2DMS :
D3D12_RTV_DIMENSION_TEXTURE2D, {} };
const D3D12_RENDER_TARGET_VIEW_DESC desc = {
format, (samples > 1) ? D3D12_RTV_DIMENSION_TEXTURE2DMS : D3D12_RTV_DIMENSION_TEXTURE2D, {}};
m_device->CreateRenderTargetView(resource, &desc, dh->cpu_handle);
return true;
}
@ -326,7 +326,7 @@ void D3D12Texture::Destroy(bool defer)
ID3D12GraphicsCommandList4* D3D12Texture::GetCommandBufferForUpdate()
{
D3D12Device& dev = D3D12Device::GetInstance();
if (m_type != Type::Texture || m_use_fence_counter == dev.GetCurrentFenceValue())
if ((m_type != Type::Texture && m_type != Type::DynamicTexture) || m_use_fence_counter == dev.GetCurrentFenceValue())
{
// Console.WriteLn("Texture update within frame, can't use do beforehand");
if (dev.InRenderPass())