Skip to content

Commit

Permalink
Some D3d12 safety checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvkennedy committed Dec 17, 2024
1 parent dbf9c2a commit 460a4da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DirectX12/RenderPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2833,7 +2833,8 @@ void RenderPlatform::DeactivateRenderTargets(crossplatform::GraphicsDeviceContex
void RenderPlatform::SetViewports(crossplatform::GraphicsDeviceContext &deviceContext, int num, const crossplatform::Viewport *vps)
{
ID3D12GraphicsCommandList *commandList = deviceContext.asD3D12Context();

if(!commandList)
return;
D3D12_VIEWPORT viewports[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT] = {};
D3D12_RECT scissors[D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT] = {};

Expand Down
2 changes: 2 additions & 0 deletions DirectX12/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,8 @@ void Texture::RestoreExternalTextureState(crossplatform::DeviceContext& deviceCo
{
if ((crossplatform::ResourceState)mExternalLayout == crossplatform::ResourceState::UNKNOWN)
return;
if(!IsValid())
return;
auto rPlat = (dx12::RenderPlatform*)(renderPlatform);
SetLayout(deviceContext, mExternalLayout);
}
Expand Down

0 comments on commit 460a4da

Please sign in to comment.