+static VkResult
+x11_present_to_x11_sw(struct x11_swapchain *chain, uint32_t image_index,
+ uint32_t target_msc)
+{
+ struct x11_image *image = &chain->images[image_index];
+
+ xcb_void_cookie_t cookie;
+ void *myptr;
+ chain->base.wsi->MapMemory(chain->base.device,
+ image->base.memory,
+ 0, 0, 0, &myptr);
+
+ cookie = xcb_put_image(chain->conn, XCB_IMAGE_FORMAT_Z_PIXMAP,
+ chain->window,
+ chain->gc,
+ image->base.row_pitches[0] / 4,
+ chain->extent.height,
+ 0,0,0,24,
+ image->base.row_pitches[0] * chain->extent.height,
+ myptr);
+
+ chain->base.wsi->UnmapMemory(chain->base.device, image->base.memory);
+ xcb_discard_reply(chain->conn, cookie.sequence);
+ xcb_flush(chain->conn);
+ return x11_swapchain_result(chain, VK_SUCCESS);
+}
+static VkResult
+x11_present_to_x11(struct x11_swapchain *chain, uint32_t image_index,
+ uint32_t target_msc)
+{
+ if (chain->base.wsi->sw)
+ return x11_present_to_x11_sw(chain, image_index, target_msc);
+ return x11_present_to_x11_dri3(chain, image_index, target_msc);
+}
+