Mesa (master): anv: Silence warning about heap_size.

Eric Anholt anholt at kemper.freedesktop.org
Fri Mar 16 22:18:53 UTC 2018


Module: Mesa
Branch: master
Commit: 7db1c09d12bac50d66feaf981ff52b319091dd2d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7db1c09d12bac50d66feaf981ff52b319091dd2d

Author: Eric Anholt <eric at anholt.net>
Date:   Sat Feb 10 11:25:48 2018 +0000

anv: Silence warning about heap_size.

We only get VK_SUCCESS if it was initialized, but apparently my compiler
doesn't track that far.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

---

 src/intel/vulkan/anv_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 82b237e76d..4cacba9343 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -110,7 +110,7 @@ anv_physical_device_init_heaps(struct anv_physical_device *device, int fd)
    device->supports_48bit_addresses =
       (device->info.gen >= 8) && anv_gem_supports_48b_addresses(fd);
 
-   uint64_t heap_size;
+   uint64_t heap_size = 0;
    VkResult result = anv_compute_heap_size(fd, &heap_size);
    if (result != VK_SUCCESS)
       return result;




More information about the mesa-commit mailing list