Skip to content

Commit

Permalink
If SetPrivateData data is null, clear tracked data
Browse files Browse the repository at this point in the history
  • Loading branch information
davidd-lunarg committed Oct 26, 2023
1 parent eb9e1a7 commit d77e3e2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions framework/encode/dx12_state_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,20 @@ void Dx12StateTracker::TrackResizeBuffers(IDXGISwapChain_Wrapper* swapch
void Dx12StateTracker::TrackPrivateData(IUnknown_Wrapper* wrapper, REFGUID name, UINT data_size, const void* data)
{
GFXRECON_ASSERT(wrapper != nullptr);
GFXRECON_ASSERT(data != nullptr);

auto* info = GetWrapperInfo(wrapper);
if (info)
{
std::vector<uint8_t> private_data(data_size);
memcpy(private_data.data(), data, data_size);
info->private_datas[name] = std::move(private_data);
if (data != nullptr)
{
std::vector<uint8_t> private_data(data_size);
memcpy(private_data.data(), data, data_size);
info->private_datas[name] = std::move(private_data);
}
else
{
info->private_datas.erase(name);
}
}
}

Expand Down

0 comments on commit d77e3e2

Please sign in to comment.