Skip to content

Commit 460a4da

Browse files
committed
Some D3d12 safety checks.
1 parent dbf9c2a commit 460a4da

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

DirectX12/RenderPlatform.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2833,7 +2833,8 @@ void RenderPlatform::DeactivateRenderTargets(crossplatform::GraphicsDeviceContex
28332833
void RenderPlatform::SetViewports(crossplatform::GraphicsDeviceContext &deviceContext, int num, const crossplatform::Viewport *vps)
28342834
{
28352835
ID3D12GraphicsCommandList *commandList = deviceContext.asD3D12Context();
2836-
2836+
if(!commandList)
2837+
return;
28372838
D3D12_VIEWPORT viewports[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT] = {};
28382839
D3D12_RECT scissors[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT] = {};
28392840

DirectX12/Texture.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,8 @@ void Texture::RestoreExternalTextureState(crossplatform::DeviceContext& deviceCo
10371037
{
10381038
if ((crossplatform::ResourceState)mExternalLayout == crossplatform::ResourceState::UNKNOWN)
10391039
return;
1040+
if(!IsValid())
1041+
return;
10401042
auto rPlat = (dx12::RenderPlatform*)(renderPlatform);
10411043
SetLayout(deviceContext, mExternalLayout);
10421044
}

0 commit comments

Comments
 (0)