Files
DroidDeck/tools/tests/vk_terminal_callers_test.c
T
MaxsTechReview 4349563fd1 feat(display): zero-copy presentation toggle and compositor display buffers (#2905)
* feat(display): zero-copy presentation toggle and compositor display buffers

Adds a Zero-copy presentation switch under Steam Settings, Display,
Session Display (on by default), and a display-buffer allocator in the
compositor: a Vulkan driver that states displayBuffers asks it for the
memory of the images it exports, so frames presented through the nested
compositor are gralloc buffers that go on the display layer without a
copy. Compressed buffers are offered only where the device's allocator
matches the layout the drivers render to; everything else stays on the
copy path.

The private buffer protocol is renamed to droiddeck-ahb-v1.

* fix(display): zero-copy frames keep the full refresh rate

Two buffers set on the game layer inside one refresh replaced each other, and a frame that slipped into the next refresh made the compositor hold and drop the on-time frame behind it. The layer now queues buffers, and a refresh takes a second frame when the one before it took none. The pacing tool no longer counts its dump time in the frame rate.

* Keep cropped scenes on the display layer and pace layer frames evenly

Accept any in-bounds source crop for the display layer and map the draw
geometry the same way the copy path does. Time layer frames against the
display's frame timeline, and when the game's rate is a steady whole
fraction of the refresh rate show each frame a fixed number of refreshes
after the last so uneven arrivals no longer reach the screen.

* List zero-copy in the settings map

* Hold display buffers until the display releases them

A buffer the game or gamescope rendered straight into went back to its
client as soon as the next one was latched, with the display's release
fence attached to the dma-buf. The KGSL driver does not wait on that
fence, so the client could draw into a buffer the panel was still
reading. Display buffers now wait for the release fence before the
release event, and gamescope composites only into output images the
host has released.

* Keep the game picture copy-free when an overlay has no display layer

When the display cannot give a second layer of its own to an overlay,
the compositor tells gamescope how many planes it can show directly.
gamescope then composes its overlays into the game picture, which still
reaches the display without a copy.

* feat(session): the panel refresh rate follows the session's frame rate

The session learns the panel's refresh rates and reports the refresh rate and
frame rate it wants. The panel moves to the highest rate the frame rate divides
evenly, frame generation counts at its output rate, and a panel whose rate the
system holds offers only that rate.

* feat(session): the panel follows a frame rate the game holds on its own

The compositor reports the game's frame rate once a second. A rate that
holds for three seconds and divides a panel rate becomes the content
rate when neither the app's limit nor the session's limiter is setting
the pace, so a game capped in its own settings gets a panel rate its
frames divide into. A rate that was dropped has to hold twice as long
before it is used again.

* Show generated frames on the game's display layer

With frame generation on, the game's own frames stay on their display
layer untouched and each generated frame is placed on the same layer
between them, timed across the game's frame interval. The compositor
pass is kept when effects, HDR routing or a cursor need it, or when the
panel cannot show the multiplied rate.

* Keep scaling, generated frames and HDR on the display layer

A scaler or frame generation with zero-copy on now draws once into the
display layer instead of falling back to the copied surface. HDR output
goes to the layer when the panel supports it; on a panel without HDR the
picture is tone-mapped on the same path, and the toggle is labelled to
match what the panel can do.

* Spread a frame limit the refresh rate does not divide evenly across refreshes

* Cover the spare-tick and panel-rate paths in the compositor source tests

* Pin the gamescope build with the display-plane, release, refresh and limiter patches

* Give the layer and terminal-caller harnesses the black fill state they compile against

* feat(display): switch HDR during a session without restarting the app

The compositor now offers HDR whenever the device can present it, and the
HDR setting only decides whether the session uses it. Both HDR switches set
gamescope's hdr_enabled, the compositor's HDR output and zero-copy for the
running session. gamescope patch 0139 lets hdr_enabled change after start.
The 'Restart the app to apply.' hint is removed from every locale.

* Remake the output images in the new format when HDR is switched during a session

* Pin the gamescope build that switches HDR during a session

* Apply a saved HDR opt-out at session start and keep HDR retries with their session

* Serialise the HDR output switch with the gate opening

* feat(display): keep the client's HDR setting and the session's in step

The session publishes its HDR state with the other device controls and the
client helper applies it to the client's own display setting. A change made in
the client is reported back and goes through the same switch the drawer and
Session Display use, so all three always show one value.

* fix(desktop): keep the display-buffer socket when the runtime directory is cleared

The desktop launcher removed everything in the runtime directory except the
compositor's Wayland socket, which took the display-buffer socket with it, so
no desktop program could ask for display buffers and every frame was copied.

* fix(display): the client's HDR setting follows the session in every client mode

The bridge only ran when a variable nothing sets was present, so the client's
HDR setting and the session's never met. It now runs whenever the session
publishes an HDR state, and a client that has no such setting is asked again
only every ten seconds.

* fix(display): harden display-buffer hand-off, layer fallbacks and HDR sync

- Stop closing a buffer handle's descriptor the allocator still owns, and free an allocation whose reply could not be sent.
- Rebuild the advertised buffer formats when zero-copy is switched during a session.
- Fall back to the copy path when a layer buffer cannot be allocated, and hide the game layer when it is skipped for a frame.
- Keep a release fence that has not signalled instead of rendering into a buffer the display still reads.
- Ignore a refresh-target reset from a client that does not own the target.
- Restart the content-rate measurement after a pause, clear it when the game stops, and lengthen engagement only for a rate that was released before.
- Compare colour conversions by their values, and read padded cursor buffers at their row width.
- Use the running session's mode for the HDR and zero-copy settings, probe the display before screen effects are pushed, retry a held panel mode, and ignore callbacks after the activity is destroyed.
- Write a newer HDR value while an earlier write is settling, and reapply the value after the bridge is reinstalled.
2026-11-21 00:26:50 -05:00

293 lines
16 KiB
C

/* Compiled with the complete, unmodified production translation unit. The
* compositor's take_shm/take_pixel functions are inserted verbatim by Python. */
#include "vk_present.c"
#include <assert.h>
struct vk_api g_vk;
static unsigned operations, acquires, submits, markers, waits, idle_calls, resets;
static unsigned destroys, releases, lost_notifications, presented_notifications;
static VkResult idle_answer, fence_answer, acquire_answer, present_answer;
static unsigned fail_acquire_at;
static int generated;
/* Every work-issuing callback is an oracle: no GPU operation after a terminal
* result. Object destruction is counted separately for genuine device loss. */
static void live(void) { assert(g_dev_state == 1); ++operations; }
static VkResult acquire(VkDevice d, VkSwapchainKHR s, uint64_t t, VkSemaphore a, VkFence f, uint32_t *i) {
live(); ++acquires; *i = 0;
return acquires == fail_acquire_at ? acquire_answer : VK_SUCCESS;
}
static VkResult idle(VkDevice d) { live(); ++idle_calls; return idle_answer; }
static VkResult wait_fences(VkDevice d, uint32_t n, const VkFence *f, VkBool32 all, uint64_t t) {
live(); ++waits; return fence_answer;
}
static VkResult submit(VkQueue q, uint32_t n, const VkSubmitInfo *s, VkFence f) {
live(); ++submits; if (!s->commandBufferCount) ++markers; return VK_SUCCESS;
}
static VkResult present(VkQueue q, const VkPresentInfoKHR *p) { live(); return present_answer; }
static VkResult reset_cmd(VkCommandBuffer c, VkCommandBufferResetFlags f) { live(); ++resets; return VK_SUCCESS; }
static VkResult reset_fence(VkDevice d, uint32_t n, const VkFence *f) { live(); ++resets; return VK_SUCCESS; }
static VkResult begin_cmd(VkCommandBuffer c, const VkCommandBufferBeginInfo *b) { live(); return VK_SUCCESS; }
static VkResult end_cmd(VkCommandBuffer c) { live(); return VK_SUCCESS; }
static void barrier(VkCommandBuffer c, VkPipelineStageFlags s, VkPipelineStageFlags d, VkDependencyFlags f,
uint32_t nm, const VkMemoryBarrier *m, uint32_t nb, const VkBufferMemoryBarrier *b,
uint32_t ni, const VkImageMemoryBarrier *i) { live(); }
static void clear(VkCommandBuffer c, VkImage i, VkImageLayout l, const VkClearColorValue *v,
uint32_t n, const VkImageSubresourceRange *r) { live(); }
static void blit(VkCommandBuffer c, VkImage s, VkImageLayout sl, VkImage d, VkImageLayout dl,
uint32_t n, const VkImageBlit *b, VkFilter f) { live(); }
static void destroy_swap(VkDevice d, VkSwapchainKHR s, const VkAllocationCallbacks *a) { ++destroys; }
static void destroy_surface(VkInstance i, VkSurfaceKHR s, const VkAllocationCallbacks *a) { ++destroys; }
static void destroy_sem(VkDevice d, VkSemaphore s, const VkAllocationCallbacks *a) { live(); ++destroys; }
static VkResult create_sem(VkDevice d, const VkSemaphoreCreateInfo *c, const VkAllocationCallbacks *a, VkSemaphore *s) {
live(); *s = (VkSemaphore)(uintptr_t)1; return VK_SUCCESS;
}
static void destroy_image(VkDevice d, VkImage i, const VkAllocationCallbacks *a) { ++destroys; }
static void free_memory(VkDevice d, VkDeviceMemory m, const VkAllocationCallbacks *a) { ++destroys; }
static void unmap(VkDevice d, VkDeviceMemory m) { ++destroys; }
/* External modules are not the subject of this fault injection. Their declared
* signatures remain checked by the production headers. */
int __android_log_print(int p, const char *t, const char *f, ...) { return 0; }
void droiddeck_log(const char *t, const char *f, ...) {}
void droiddeck_on_first_frame(void) {}
int32_t ANativeWindow_getWidth(ANativeWindow *w) { return 64; }
int32_t ANativeWindow_getHeight(ANativeWindow *w) { return 64; }
void ANativeWindow_release(ANativeWindow *w) {}
void sc_layer_window_gone(void) {}
int sc_layer_present_pass(const struct vkp_draw *d, int n, int w, int h) { return 0; }
void sc_layer_hide(void) {}
int sc_layer_base_black(int w, int h) { return 0; }
void sc_layer_hide_base(void) {}
void sc_layer_hide_overlay(void) {}
void vkp_cardboard_bind_device(VkDevice d, const VkPhysicalDeviceMemoryProperties *m) {}
int vkp_cardboard_active(void) { return 0; }
void vkp_cardboard_begin_frame(void) {}
VkImage vkp_cardboard_run(VkCommandBuffer c, VkImage s, int sw, int sh, int ow, int oh) { return s; }
int vk_loader_open(const char *a, const char *b, const char *c) { assert(0); return -1; }
void vk_loader_close(void) { assert(0); }
void vk_loader_load_instance(VkInstance i) { assert(0); }
void vk_loader_load_device(VkDevice d) { assert(0); }
PFN_vkGetInstanceProcAddr vk_loader_gipa(void) { return NULL; }
void vkp_effects_bind_device(VkDevice d, VkPhysicalDevice p, const VkPhysicalDeviceMemoryProperties *m) {}
int vkp_effects_active(void) { return 0; }
int vkp_effects_upscaling(void) { return 0; }
int vkp_effects_sharpening(void) { return 0; }
int vkp_effects_postprocessing(void) { return 0; }
VkFilter vkp_effects_blit_filter(void) { return VK_FILTER_NEAREST; }
void vkp_effects_set_formats(VkFormat a, VkFormat b) {}
VkImage vkp_effects_run(VkCommandBuffer c, VkImage i, int w, int h, int ow, int oh, int *rw, int *rh) {
*rw = w; *rh = h; return i;
}
const void *vkp_framegen_device_features(VkInstance i, PFN_vkGetInstanceProcAddr p, VkPhysicalDevice d) { return NULL; }
void vkp_framegen_device_ready(VkDevice d, VkQueue q, uint32_t f, int e) {}
void vkp_framegen_device_lost(void) { ++lost_notifications; }
int vkp_framegen_active(void) { return generated != 0; }
int vkp_framegen_extra_images(void) { return generated; }
int vkp_framegen_format_ok(VkFormat f) { return 0; }
int vkp_framegen_run(VkCommandBuffer c, VkImage s, VkImageView v, int w, int h,
VkFormat f, VkImage images[VKP_FG_MAX_GENERATIONS]) {
for (int i = 0; i < generated; ++i) images[i] = s;
return generated;
}
void vkp_framegen_presented(int n) { ++presented_notifications; }
void vkp_gpu_busy_device(VkPhysicalDevice p, VkDevice d, uint32_t f) {}
void vkp_gpu_busy_device_lost(void) {}
void hdrc_bind_device(VkDevice d, const VkPhysicalDeviceMemoryProperties *m) {}
void hdrc_forget_image(VkImage i) {}
int hdrc_encode(VkCommandBuffer c, VkImage a, VkImage b, VkFormat f, int w, int h, const struct hdrc_params *p) { return -1; }
void blendp_bind_device(VkDevice d) {}
void blendp_forget_image(VkImage i) {}
void vkp_effects_forget_image(VkImage i) {}
void blendp_begin_frame(void) {}
int blendp_draw(VkCommandBuffer c, VkImage s, VkFormat sf, int sw, int sh, int sg,
VkImage d, VkFormat df, int dw, int dh, const VkImageBlit *b) { return -1; }
int droiddeck_color_requested(void) { return 0; }
float droiddeck_color_sdr_white(void) { return 203.0f; }
enum surface_role { ROLE_NONE, ROLE_TOPLEVEL };
struct damage_list { int n; };
struct surface {
struct vkp_image *shm_img;
struct wl_resource *resource;
int buf_w, buf_h, buf_alpha, has_content, black_fill;
/* Read by take_shm's game-frame detection; with no damage it stays off here. */
int src_set; float src[4];
struct damage_list damage_buf, damage_local;
struct surface *parent; enum surface_role role; int mapped;
};
static void surface_size(const struct surface *s, int *w, int *h) { *w = s->buf_w; *h = s->buf_h; }
static void scene_size(int *w, int *h) { *w = *h = 0; }
static int64_t damage_area(const struct damage_list *d, int bound_w, int bound_h) { return 0; }
static int64_t now_ns(void) { return 0; }
static struct surface *g_hud_surface, *g_hud_shm;
static int64_t g_hud_shm_ns, g_hud_last_ns;
static int g_hud_new;
static void droiddeck_on_game_frame(void) {}
struct client_info { int asked_feedback, shm_frames; };
struct wl_shm_buffer { int w, h, stride; const void *data; };
#define WL_SHM_FORMAT_ARGB8888 0
static unsigned g_stat_shm;
static int wl_shm_buffer_get_width(struct wl_shm_buffer *b) { return b->w; }
static int wl_shm_buffer_get_height(struct wl_shm_buffer *b) { return b->h; }
static int wl_shm_buffer_get_stride(struct wl_shm_buffer *b) { return b->stride; }
static int wl_shm_buffer_get_format(struct wl_shm_buffer *b) { return WL_SHM_FORMAT_ARGB8888; }
static const void *wl_shm_buffer_get_data(struct wl_shm_buffer *b) { return b->data; }
static void wl_shm_buffer_begin_access(struct wl_shm_buffer *b) {}
static void wl_shm_buffer_end_access(struct wl_shm_buffer *b) {}
struct wl_resource { int dmabuf; };
static struct wl_resource *expected_release;
static void wl_buffer_send_release(struct wl_resource *b) { assert(b && b == expected_release); ++releases; }
static struct wl_client *wl_resource_get_client(struct wl_resource *r) { return NULL; }
static struct client_info *client_info_of(struct wl_client *c) { return NULL; }
struct dmabuf_buffer { int unused; };
static struct dmabuf_buffer dmabuf_fixture;
static struct dmabuf_buffer *get_dmabuf(struct wl_resource *buffer) {
assert(buffer);
return buffer->dmabuf ? &dmabuf_fixture : NULL;
}
/* COMPOSITOR_CALLERS */
static void setup(int extra) {
g_vk = (struct vk_api){.AcquireNextImageKHR = acquire, .DeviceWaitIdle = idle,
.WaitForFences = wait_fences, .QueueSubmit = submit, .QueuePresentKHR = present,
.ResetCommandBuffer = reset_cmd, .ResetFences = reset_fence, .BeginCommandBuffer = begin_cmd,
.EndCommandBuffer = end_cmd, .CmdPipelineBarrier = barrier, .CmdClearColorImage = clear,
.CmdBlitImage = blit, .DestroySwapchainKHR = destroy_swap, .DestroySurfaceKHR = destroy_surface,
.DestroySemaphore = destroy_sem, .CreateSemaphore = create_sem,
.DestroyImage = destroy_image, .FreeMemory = free_memory, .UnmapMemory = unmap};
idle_answer = fence_answer = acquire_answer = present_answer = VK_SUCCESS;
generated = g_swap_extra = extra;
g_dev_state = 1;
g_dev = (VkDevice)(uintptr_t)1; g_inst = (VkInstance)(uintptr_t)1;
g_window = (ANativeWindow *)(uintptr_t)1; g_queue = (VkQueue)(uintptr_t)1;
g_swapchain = (VkSwapchainKHR)(uintptr_t)2; g_surface = (VkSurfaceKHR)(uintptr_t)3;
g_images = calloc(1, sizeof(*g_images)); assert(g_images);
*g_images = (VkImage)(uintptr_t)4; g_nimg = 1;
g_extent = g_caps_extent = (VkExtent2D){64, 64};
g_surface_checked_ns = INT64_MAX; /* no simulated geometry change */
g_scene.img = (VkImage)(uintptr_t)5; g_scene.mem = (VkDeviceMemory)(uintptr_t)6;
g_scene.w = g_scene.h = 64;
for (int k = 0; k < MAX_PRESENTS; ++k) {
g_cmds[k] = (VkCommandBuffer)(uintptr_t)(10 + k);
g_acqs[k] = (VkSemaphore)(uintptr_t)(20 + k);
g_rnds[k] = (VkSemaphore)(uintptr_t)(30 + k);
}
g_fence = (VkFence)(uintptr_t)40;
}
/* Probe the public GPU entry points after a terminal result. This includes an
* active off-screen pass and consumed release fds, not just the render guard. */
static void assert_stopped(void) {
unsigned before = operations, before_destroys = destroys;
struct vkp_image src = {.image = (VkImage)(uintptr_t)7, .w = 1, .h = 1};
struct vkp_image dst = {.image = (VkImage)(uintptr_t)8, .w = 1, .h = 1, .blit_dst = 1};
uint32_t pixel = 0; uint64_t mod = 0;
assert(vkp_render(64, 64, NULL, 0) == -1);
assert(vkp_render_plain(64, 64) == -1);
assert(vkp_render_hdr(64, 64, NULL, 0, NULL, NULL) == -1);
assert(vkp_base_black(64, 64) == -1);
assert(vkp_update_map(64, 64) == -1);
assert(vkp_ready() == -1);
assert(vkp_image_create_shm(1, 1) == NULL);
assert(vkp_image_import_dmabuf(-1, 0, VKP_MOD_LINEAR, 1, 1, 4, 0, 0) == NULL);
assert(vkp_dmabuf_modifiers(0, &mod, 1) == 0);
assert(vkp_image_readback(&src, &pixel, 1) == -1);
assert(vkp_pass_begin(64, 64, NULL, 0, NULL, NULL) == -1);
int fd[2]; assert(pipe(fd) == 0);
assert(vkp_blit_image(&src, &dst, fd[0]) == -1);
errno = 0; assert(close(fd[0]) == -1 && errno == EBADF); close(fd[1]);
g_pass.active = 1;
assert(pipe(fd) == 0);
assert(vkp_pass_copy_to(&dst, fd[0]) == -1 && !g_pass.active);
errno = 0; assert(close(fd[0]) == -1 && errno == EBADF); close(fd[1]);
g_pass.active = 1; vkp_pass_abort(); assert(!g_pass.active);
assert(timed_wait(g_fence, UINT64_MAX) != VK_SUCCESS);
assert(operations == before && destroys == before_destroys);
}
static void acquire_failure(int later, VkResult result) {
setup(later ? 1 : 0);
fail_acquire_at = later ? 2 : 1; acquire_answer = result;
idle_answer = VK_ERROR_OUT_OF_HOST_MEMORY;
VkImage *retained = g_images;
assert(vkp_render(64, 64, NULL, 0) == -1);
assert(g_dev_state == -3 && vkp_completion_unknown() && !vkp_device_lost());
assert(acquires == fail_acquire_at && idle_calls == 1);
assert(submits == (unsigned)later && markers == 0 && waits == 0);
assert(destroys == 0 && g_images == retained && g_nimg == 1);
assert(g_swapchain && g_surface && g_fence && g_scene.img && g_scene.mem);
assert_stopped();
free(g_images); /* test-owned fake resources only */
}
static void upload_timeout(int single_pixel) {
setup(0);
uint8_t bytes[48], saved[48], data[16];
memset(bytes, 0xa5, sizeof(bytes)); memset(data, 0x3c, sizeof(data));
struct vkp_image *img = calloc(1, sizeof(*img)); assert(img);
*img = (struct vkp_image){.image = (VkImage)(uintptr_t)7, .mem = (VkDeviceMemory)(uintptr_t)8,
.map = bytes, .offset = 3, .row_pitch = 16,
.w = single_pixel ? 1 : 2, .h = single_pixel ? 1 : 2};
struct surface s = {.shm_img = img};
struct wl_shm_buffer b = {.w = img->w, .h = img->h, .stride = img->w * 4, .data = data};
struct wl_resource resource = {0};
expected_release = &resource;
if (single_pixel) take_pixel(&s, data, &resource); else take_shm(&s, &b, &resource);
assert(bytes[3] == 0x3c && bytes[0] == 0xa5 && releases == 1);
memcpy(saved, bytes, sizeof(saved));
struct vkp_image dst = {.image = (VkImage)(uintptr_t)9, .blit_dst = 1, .w = img->w, .h = img->h};
fence_answer = VK_TIMEOUT;
assert(vkp_blit_image(img, &dst, -1) == -1);
assert(g_dev_state == -3 && submits == 1 && waits == 1);
memset(data, 0x7e, sizeof(data));
if (single_pixel) take_pixel(&s, data, &resource); else take_shm(&s, &b, &resource);
assert(s.shm_img == img && memcmp(saved, bytes, sizeof(saved)) == 0 && releases == 2);
struct wl_resource dmabuf = {.dmabuf = 1};
expected_release = &dmabuf;
assert(buffer_release_blocked(&dmabuf));
send_buffer_release(&dmabuf);
assert(releases == 2);
vkp_image_destroy(img);
assert(destroys == 0 && img->map == bytes && img->image && img->mem);
assert_stopped();
g_dev_state = 1;
assert(!buffer_release_blocked(&dmabuf));
send_buffer_release(&dmabuf);
assert(releases == 3);
free(img); free(g_images); /* fake resources only, not production cleanup */
}
int main(int argc, char **argv) {
assert(argc == 2);
const char *name = argv[1];
if (!strcmp(name, "first-out-of-date")) acquire_failure(0, VK_ERROR_OUT_OF_DATE_KHR);
else if (!strcmp(name, "first-surface-lost")) acquire_failure(0, VK_ERROR_SURFACE_LOST_KHR);
else if (!strcmp(name, "later-out-of-date")) acquire_failure(1, VK_ERROR_OUT_OF_DATE_KHR);
else if (!strcmp(name, "later-surface-lost")) acquire_failure(1, VK_ERROR_SURFACE_LOST_KHR);
else if (!strcmp(name, "shm-timeout")) upload_timeout(0);
else if (!strcmp(name, "pixel-timeout")) upload_timeout(1);
else if (!strcmp(name, "pass-terminal")) { setup(0); g_dev_state = -3; assert_stopped(); free(g_images); }
else if (!strcmp(name, "normal") || !strcmp(name, "framegen")) {
int extra = !strcmp(name, "framegen"); setup(extra);
assert(vkp_render(64, 64, NULL, 0) == 0 && g_dev_state == 1);
assert(acquires == (unsigned)(1 + extra) && submits == (unsigned)(1 + extra));
assert(waits == 1 && markers == 0 && idle_calls == 0 && destroys == 0);
assert(presented_notifications == (unsigned)extra); free(g_images);
} else if (!strcmp(name, "later-timeout")) {
setup(1); fail_acquire_at = 2; acquire_answer = VK_TIMEOUT;
assert(vkp_render(64, 64, NULL, 0) == -1 && g_dev_state == 1);
assert(acquires == 2 && submits == 2 && markers == 1 && waits == 1); free(g_images);
} else if (!strcmp(name, "acquire-device-lost") || !strcmp(name, "present-device-lost")) {
setup(1);
if (!strcmp(name, "acquire-device-lost")) { fail_acquire_at = 2; acquire_answer = VK_ERROR_DEVICE_LOST; }
else present_answer = VK_ERROR_DEVICE_LOST;
assert(vkp_render(64, 64, NULL, 0) == -1 && vkp_device_lost());
assert(!vkp_completion_unknown());
assert(g_dev_state == -2 && lost_notifications == 1 && markers == 0 && waits == 0);
assert(!g_images && !g_swapchain && !g_surface && destroys == 2);
assert_stopped();
} else assert(0 && "unknown scenario");
return 0;
}