Skip to content

Commit 3714a42

Browse files
committed
Copyright headers and error checking differences
1 parent d9fcac9 commit 3714a42

File tree

6 files changed

+12
-21
lines changed

6 files changed

+12
-21
lines changed

samples/extensions/device_fault/README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
////
2-
- Copyright (c) 2025, Arm Limited and Contributors
2+
- Copyright (c) 2026, Arm Limited and Contributors
33
-
44
- SPDX-License-Identifier: Apache-2.0
55
-

samples/extensions/device_fault/device_fault.cpp

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2025, Arm Limited and Contributors
1+
/* Copyright (c) 2026, Arm Limited and Contributors
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*
@@ -77,14 +77,10 @@ void DeviceFault::on_update_ui_overlay(vkb::Drawer &drawer)
7777
}
7878
}
7979

80-
void DeviceFault::check_device_fault(VkResult result)
80+
void DeviceFault::check_device_fault()
8181
{
8282
VkDevice vk_device = get_device().get_handle();
8383

84-
if (result != VK_ERROR_DEVICE_LOST) {
85-
return;
86-
}
87-
8884
// First query just the counts
8985
VkDeviceFaultCountsEXT faultCount = { VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT };
9086
VkResult countResult = vkGetDeviceFaultInfoEXT(vk_device, &faultCount, nullptr);
@@ -112,7 +108,6 @@ void DeviceFault::check_device_fault(VkResult result)
112108

113109
// Log the description and address info if it was able to catch the fault.
114110
if (faultResult == VK_SUCCESS) {
115-
116111
// Some vendors may provide additional information
117112
LOGE("Vendor Fault Description: {}", faultInfo.pVendorInfos ? faultInfo.pVendorInfos->description : "No Vendor Information available.")
118113
// Log each address info
@@ -353,7 +348,7 @@ std::unique_ptr<vkb::core::BufferC> DeviceFault::create_index_buffer()
353348

354349
void DeviceFault::create_vbo_buffers()
355350
{
356-
test_buffers.resize(64);
351+
test_buffers.resize(640);
357352
for (auto &buffer : test_buffers)
358353
{
359354
buffer = create_vbo_buffer();
@@ -434,7 +429,6 @@ DeviceFault::TestBuffer DeviceFault::create_pointer_buffer()
434429
set_memory_debug_label("Allocating Pointer Buffer ");
435430
VK_CHECK(vkAllocateMemory(get_device().get_handle(), &memory_allocation_info, nullptr, &buffer.memory));
436431

437-
// DONE: LOGI("PointerBuffer::BindMemory::Binding");
438432
set_memory_debug_label("Binding Pointer Buffer ");
439433
VK_CHECK(vkBindBufferMemory(get_device().get_handle(), buffer.buffer, buffer.memory, 0));
440434

@@ -581,13 +575,10 @@ void DeviceFault::render(float delta_time)
581575
{
582576
ApiVulkanSample::submit_frame();
583577
}
584-
catch (std::exception const &e)
578+
catch (std::runtime_error const &e)
585579
{
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());
591582
}
592583

593584
}

samples/extensions/device_fault/device_fault.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2025, Arm Limited and Contributors
1+
/* Copyright (c) 2026, Arm Limited and Contributors
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*
@@ -38,7 +38,7 @@ class DeviceFault : public ApiVulkanSample
3838
VkPipelineLayout create_pipeline_layout(bool graphics);
3939
void create_compute_pipeline();
4040
void create_graphics_pipeline();
41-
void check_device_fault(VkResult result);
41+
void check_device_fault();
4242
void update_pointer_buffer(VkCommandBuffer cmd);
4343
void update_meshlets(VkCommandBuffer cmd);
4444

shaders/device_fault/glsl/render.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2025, Arm Limited and Contributors
1+
/* Copyright (c) 2026, Arm Limited and Contributors
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*

shaders/device_fault/glsl/render.vert

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2025, Arm Limited and Contributors
1+
/* Copyright (c) 2026, Arm Limited and Contributors
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*

shaders/device_fault/glsl/update_vbo.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2025, Arm Limited and Contributors
1+
/* Copyright (c) 2026, Arm Limited and Contributors
22
*
33
* SPDX-License-Identifier: Apache-2.0
44
*

0 commit comments

Comments
 (0)