vulkan: Fix 32-bit build for the new overlay layer
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 22 Feb 2019 03:07:29 +0000 (19:07 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 22 Feb 2019 16:56:54 +0000 (08:56 -0800)
vulkan_core.h defines non-dispatchable handles as (struct object *)
on 64-bit systems, but uint64_t on 32-bit systems.  The former can be
implicitly cast to void *, but the latter requires an explicit cast.

While here, %lu is the wrong format specifier for uint64_t on 32-bit
systems, so use PRIu64, fixing a warning.

Reported-by: Mike Lothian <mike@fireburn.co.uk>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/vulkan/overlay-layer/overlay.cpp

index f3678198b00ccf541857fc11b296295c16d3e33d..04ee2833730d8c06f561761fc9b9e02b4a01d6af 100644 (file)
@@ -382,13 +382,13 @@ static struct swapchain_data *new_swapchain_data(VkSwapchainKHR swapchain,
    data->device = device_data;
    data->swapchain = swapchain;
    data->window_size = ImVec2(300, 300);
-   map_object(data->swapchain, data);
+   map_object((void *) data->swapchain, data);
    return data;
 }
 
 static void destroy_swapchain_data(struct swapchain_data *data)
 {
-   unmap_object(data->swapchain);
+   unmap_object((void *) data->swapchain);
    ralloc_free(data);
 }
 
@@ -490,7 +490,7 @@ static void compute_swapchain_display(struct swapchain_data *data)
    const char *format_name = vk_Format_to_str(data->format);
    format_name = format_name ? (format_name + strlen("VK_FORMAT_")) : "unknown";
    ImGui::Text("Swapchain format: %s", format_name);
-   ImGui::Text("Frames: %lu", data->n_frames);
+   ImGui::Text("Frames: %" PRIu64, data->n_frames);
 
    {
       double min_time = FLT_MAX, max_time = 0.0f;