mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Merge pull request #113000 from brycehutchings/d3d12_descriptor_heap_pool_corruption_fix
Fix corruption of D3D12 CPU descriptor heap free blocks
This commit is contained in:
commit
8480b62202
1 changed files with 8 additions and 6 deletions
|
|
@ -491,13 +491,15 @@ Error RenderingDeviceDriverD3D12::CPUDescriptorsHeapPool::release(const CPUDescr
|
||||||
} else if (next != free_blocks_by_offset.end()) {
|
} else if (next != free_blocks_by_offset.end()) {
|
||||||
// Connects to the next block.
|
// Connects to the next block.
|
||||||
remove_from_size_map(next->value);
|
remove_from_size_map(next->value);
|
||||||
|
|
||||||
|
FreeBlockInfo merged_block = next->value;
|
||||||
|
merged_block.global_offset -= p_result.count;
|
||||||
|
merged_block.size += p_result.count;
|
||||||
|
|
||||||
|
// Replace with the merged block.
|
||||||
free_blocks_by_offset.erase(next->value.global_offset);
|
free_blocks_by_offset.erase(next->value.global_offset);
|
||||||
|
DEV_ASSERT(!free_blocks_by_offset.has(merged_block.global_offset));
|
||||||
next->value.global_offset -= p_result.count;
|
new_block = free_blocks_by_offset.insert(merged_block.global_offset, merged_block);
|
||||||
next->value.size += p_result.count;
|
|
||||||
|
|
||||||
DEV_ASSERT(!free_blocks_by_offset.has(next->value.global_offset));
|
|
||||||
new_block = free_blocks_by_offset.insert(next->value.global_offset, next->value);
|
|
||||||
} else {
|
} else {
|
||||||
// Connects to no block.
|
// Connects to no block.
|
||||||
new_block = free_blocks_by_offset.insert(global_offset, FreeBlockInfo{ p_result.heap, global_offset, p_result.base_offset, p_result.count });
|
new_block = free_blocks_by_offset.insert(global_offset, FreeBlockInfo{ p_result.heap, global_offset, p_result.base_offset, p_result.count });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue