|
1 | | -/* Copyright (c) 2025, Arm Limited and Contributors |
| 1 | +/* Copyright (c) 2026, Arm Limited and Contributors |
2 | 2 | * |
3 | 3 | * SPDX-License-Identifier: Apache-2.0 |
4 | 4 | * |
@@ -77,14 +77,10 @@ void DeviceFault::on_update_ui_overlay(vkb::Drawer &drawer) |
77 | 77 | } |
78 | 78 | } |
79 | 79 |
|
80 | | -void DeviceFault::check_device_fault(VkResult result) |
| 80 | +void DeviceFault::check_device_fault() |
81 | 81 | { |
82 | 82 | VkDevice vk_device = get_device().get_handle(); |
83 | 83 |
|
84 | | - if (result != VK_ERROR_DEVICE_LOST) { |
85 | | - return; |
86 | | - } |
87 | | - |
88 | 84 | // First query just the counts |
89 | 85 | VkDeviceFaultCountsEXT faultCount = { VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT }; |
90 | 86 | VkResult countResult = vkGetDeviceFaultInfoEXT(vk_device, &faultCount, nullptr); |
@@ -112,7 +108,6 @@ void DeviceFault::check_device_fault(VkResult result) |
112 | 108 |
|
113 | 109 | // Log the description and address info if it was able to catch the fault. |
114 | 110 | if (faultResult == VK_SUCCESS) { |
115 | | - |
116 | 111 | // Some vendors may provide additional information |
117 | 112 | LOGE("Vendor Fault Description: {}", faultInfo.pVendorInfos ? faultInfo.pVendorInfos->description : "No Vendor Information available.") |
118 | 113 | // Log each address info |
@@ -353,7 +348,7 @@ std::unique_ptr<vkb::core::BufferC> DeviceFault::create_index_buffer() |
353 | 348 |
|
354 | 349 | void DeviceFault::create_vbo_buffers() |
355 | 350 | { |
356 | | - test_buffers.resize(64); |
| 351 | + test_buffers.resize(640); |
357 | 352 | for (auto &buffer : test_buffers) |
358 | 353 | { |
359 | 354 | buffer = create_vbo_buffer(); |
@@ -434,7 +429,6 @@ DeviceFault::TestBuffer DeviceFault::create_pointer_buffer() |
434 | 429 | set_memory_debug_label("Allocating Pointer Buffer "); |
435 | 430 | VK_CHECK(vkAllocateMemory(get_device().get_handle(), &memory_allocation_info, nullptr, &buffer.memory)); |
436 | 431 |
|
437 | | - // DONE: LOGI("PointerBuffer::BindMemory::Binding"); |
438 | 432 | set_memory_debug_label("Binding Pointer Buffer "); |
439 | 433 | VK_CHECK(vkBindBufferMemory(get_device().get_handle(), buffer.buffer, buffer.memory, 0)); |
440 | 434 |
|
@@ -581,13 +575,10 @@ void DeviceFault::render(float delta_time) |
581 | 575 | { |
582 | 576 | ApiVulkanSample::submit_frame(); |
583 | 577 | } |
584 | | - catch (std::exception const &e) |
| 578 | + catch (std::runtime_error const &e) |
585 | 579 | { |
586 | | - vk::DeviceLostError const *device_lost_error = reinterpret_cast<vk::DeviceLostError const *>(&e); |
587 | | - if (device_lost_error) |
588 | | - { |
589 | | - check_device_fault(VK_ERROR_DEVICE_LOST); |
590 | | - } |
| 580 | + check_device_fault(); |
| 581 | + std::rethrow_exception(std::current_exception()); |
591 | 582 | } |
592 | 583 |
|
593 | 584 | } |
|
0 commit comments