Mesa (master): anv/device: initialize the list of enabled extensions properly

Iago Toral Quiroga itoral at kemper.freedesktop.org
Tue Feb 6 06:58:29 UTC 2018


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

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Mon Feb  5 09:49:54 2018 +0100

anv/device: initialize the list of enabled extensions properly

The loop goes through the list of enabled extensions marking them as
enabled in the list, but this relies on every other extension being
initialized to false by default.

This bug would make us, for example, advertise certain device extension
entry points as available even when the corresponding extensions had
not been enabled.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Fixes: abc62282b5c "anv: Add a per-device table of enabled extensions"
Cc: "18.0" <mesa-stable at lists.freedesktop.org>

---

 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 0cba17aa16..86c1bdc1d5 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -1331,7 +1331,7 @@ VkResult anv_CreateDevice(
 
    assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO);
 
-   struct anv_device_extension_table enabled_extensions;
+   struct anv_device_extension_table enabled_extensions = { };
    for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
       int idx;
       for (idx = 0; idx < ANV_DEVICE_EXTENSION_COUNT; idx++) {




More information about the mesa-commit mailing list