zink: Fix 32-bit compilation
authorJoshua Ashton <joshua@froggi.es>
Sat, 8 Aug 2020 06:24:56 +0000 (07:24 +0100)
committerJoshua Ashton <joshua@froggi.es>
Sat, 8 Aug 2020 11:46:51 +0000 (12:46 +0100)
`sizeof(void*) != sizeof(VkShaderModule)` on x86 hence this fails with `-Werror=int-conversion`

Fixes: 0f059d550bd "zink: split up creating zink_shader objects and VkShaderModule objects"

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6239>

src/gallium/drivers/zink/zink_compiler.c

index 55451ad..b9d1b66 100644 (file)
@@ -217,7 +217,7 @@ update_so_info(struct zink_shader *sh,
 VkShaderModule
 zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs)
 {
-   VkShaderModule mod = NULL;
+   VkShaderModule mod = VK_NULL_HANDLE;
    void *streamout = zs->streamout.so_info_slots ? &zs->streamout : NULL;
    struct spirv_shader *spirv = nir_to_spirv(zs->nir, streamout);
    assert(spirv);
@@ -240,7 +240,7 @@ zink_shader_compile(struct zink_screen *screen, struct zink_shader *zs)
    smci.pCode = spirv->words;
 
    if (vkCreateShaderModule(screen->dev, &smci, NULL, &mod) != VK_SUCCESS)
-      mod = NULL;
+      mod = VK_NULL_HANDLE;
 
    /* TODO: determine if there's any reason to cache spirv output? */
    free(spirv->words);