Skip to content

Commit

Permalink
layers: Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dorian-apanel-intel committed Jul 13, 2023
1 parent ada331e commit e770fc2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions layers/gpu_validation/debug_printf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,14 @@ void DebugPrintf::PostCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount,
bool device_lost = (result == VK_ERROR_DEVICE_LOST);

if (aborted) return;
if (!((result == VK_SUCCESS) || (device_lost && use_uncached_buffer))) return;

if (result != VK_SUCCESS) {
if (!use_uncached_buffer) {
return;
} else if (!device_lost) {
return; // VK_ERROR_OUT_OF_HOST_MEMORY or VK_ERROR_OUT_OF_DEVICE_MEMORY
}
}

bool buffers_present = false;
// Don't QueueWaitIdle if there's nothing to process
Expand Down Expand Up @@ -822,12 +829,11 @@ void DebugPrintf::AllocateDebugPrintfResources(const VkCommandBuffer cmd_buffer,
result = vmaMapMemory(vmaAllocator, output_block.allocation, reinterpret_cast<void **>(&output_block.data));
if (result == VK_SUCCESS) {
memset(output_block.data, 0, output_buffer_size);
// Mapping may fail after DEVICE_LOST. Keep it mapped for now in such case.
// Will be unmapped in debug_printf_state::CommandBuffer::Process
if (!use_uncached_buffer) {
vmaUnmapMemory(vmaAllocator, output_block.allocation);
output_block.data = nullptr;
} else {
// Mapping may fail after DEVICE_LOST. Keep it mapped for now.
// Will be unmapped in debug_printf_state::CommandBuffer::Process
}
}

Expand Down

0 comments on commit e770fc2

Please sign in to comment.