diff options
author | John Lindgren <john@jlindgren.net> | 2022-10-08 11:56:09 -0400 |
---|---|---|
committer | John Lindgren <john@jlindgren.net> | 2022-10-09 12:07:57 -0400 |
commit | ab8341975e62b1f668d8c9779ec8e72d04718a99 (patch) | |
tree | fda9816c44e62592b2b255353a0e3d73bc9a5d97 | |
parent | 694e9bbb9d7114f39311d93e885e010606a88dae (diff) |
render/vulkan: Fix type-punned pointer warning/error
-rw-r--r-- | render/vulkan/renderer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c index 075f76d3..2c78ada0 100644 --- a/render/vulkan/renderer.c +++ b/render/vulkan/renderer.c @@ -1148,14 +1148,14 @@ static bool vulkan_read_pixels(struct wlr_renderer *wlr_renderer, VkSubresourceLayout img_sub_layout; vkGetImageSubresourceLayout(dev, dst_image, &img_sub_res, &img_sub_layout); - const char *d; - res = vkMapMemory(dev, dst_img_memory, 0, VK_WHOLE_SIZE, 0, (void **)&d); + void *v; + res = vkMapMemory(dev, dst_img_memory, 0, VK_WHOLE_SIZE, 0, &v); if (res != VK_SUCCESS) { wlr_vk_error("vkMapMemory", res); goto free_memory; } - d += img_sub_layout.offset; + const char *d = (const char *)v + img_sub_layout.offset; unsigned char *p = (unsigned char *)data + dst_y * stride; uint32_t bpp = pixel_format_info->bpp; uint32_t pack_stride = img_sub_layout.rowPitch; |