Skip to content

Commit ba67c32

Browse files
committed
Don't name a resource before checking if it created successfully
1 parent 1708bee commit ba67c32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

renderdoc/driver/d3d12/d3d12_debug.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,14 +2661,14 @@ uint32_t D3D12DebugManager::PickVertex(uint32_t eventID, const MeshDisplay &cfg,
26612661
D3D12_RESOURCE_STATE_GENERIC_READ, NULL,
26622662
__uuidof(ID3D12Resource), (void **)&m_PickVB);
26632663

2664-
m_PickVB->SetName(L"m_PickVB");
2665-
26662664
if(FAILED(hr))
26672665
{
26682666
RDCERR("Couldn't create pick vertex buffer: %08x", hr);
26692667
return ~0U;
26702668
}
26712669

2670+
m_PickVB->SetName(L"m_PickVB");
2671+
26722672
sdesc.Buffer.NumElements = cfg.position.numVerts;
26732673
m_WrappedDevice->CreateShaderResourceView(m_PickVB, &sdesc, GetCPUHandle(PICK_VB_SRV));
26742674
}

0 commit comments

Comments
 (0)