Report a lost device where it is first seen, at the read of the submissions' timeline.

The result of that read was not checked. After a device loss the value was taken as it came, the callbacks of submissions that never ran were called as if their work were done, and the game went on recording until the next checked queue call failed. That was an upload's, so two players' reports read as an upload fault.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 12:40:10 -05:00
parent fd22aab8d4
commit a6a3944ba0

View File

@@ -401,7 +401,15 @@ static void completion_main(void *arg) {
vk_device_fault_report(r);
rt_fatal("vk: vkWaitSemaphores failed (%d; device lost?)", (int)r);
}
vkGetSemaphoreCounterValue(c->device, c->timeline, &reached);
// A lost device is reported here, where it is first seen. Unchecked, the value was taken as it came: the
// callbacks of submissions that never ran were called as if their work were done (one report's first sign
// was an occlusion query "not available after its fence"), and the game went on recording until the next
// checked queue call failed, an upload's, which then read as the cause.
r = vkGetSemaphoreCounterValue(c->device, c->timeline, &reached);
if (r != VK_SUCCESS) {
vk_device_fault_report(r);
rt_fatal("vk: the submissions' timeline could not be read (%d; device lost?)", (int)r);
}
plat_mutex_lock(&st_lock);
if (reached > issued) reached = issued;
}