diff --git a/util/test/demos/d3d12/d3d12_test.cpp b/util/test/demos/d3d12/d3d12_test.cpp index d1d838125..33f5b3939 100644 --- a/util/test/demos/d3d12/d3d12_test.cpp +++ b/util/test/demos/d3d12/d3d12_test.cpp @@ -784,22 +784,18 @@ void D3D12GraphicsTest::SetBufferData(ID3D12ResourcePtr buffer, D3D12_RESOURCE_S void D3D12GraphicsTest::pushMarker(ID3D12GraphicsCommandListPtr cmd, const std::string &name) { - // D3D debug layer spams un-mutable errors if we call this. Don't do anything unless renderdoc is - // attached - if(rdoc) - cmd->BeginEvent(1, name.data(), (UINT)name.size()); + // D3D debug layer spams un-mutable errors if we don't include the NULL terminator in the size. + cmd->BeginEvent(1, name.data(), (UINT)name.size() + 1); } void D3D12GraphicsTest::setMarker(ID3D12GraphicsCommandListPtr cmd, const std::string &name) { - if(rdoc) - cmd->SetMarker(1, name.data(), (UINT)name.size()); + cmd->SetMarker(1, name.data(), (UINT)name.size() + 1); } void D3D12GraphicsTest::popMarker(ID3D12GraphicsCommandListPtr cmd) { - if(rdoc) - cmd->EndEvent(); + cmd->EndEvent(); } void D3D12GraphicsTest::ResourceBarrier(ID3D12GraphicsCommandListPtr cmd, ID3D12ResourcePtr res,