From 01402386ecc9080f0f8e0c4e194958a0868d1027 Mon Sep 17 00:00:00 2001 From: Bob Ellison Date: Tue, 22 Jan 2019 15:32:24 -0700 Subject: [PATCH] issue 126: fix vulkaninfo segfault on 1.0 devices We didn't quite get the check on whether a format can be legally queried on a particular GPU quite right. We were checking against the instance version only. We need to check agains the driver's supported API version as well. --- vulkaninfo/vulkaninfo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vulkaninfo/vulkaninfo.c b/vulkaninfo/vulkaninfo.c index 4fa2acf14..7857d2c31 100644 --- a/vulkaninfo/vulkaninfo.c +++ b/vulkaninfo/vulkaninfo.c @@ -1987,8 +1987,10 @@ static struct FormatRange { // Helper function to determine whether a format range is currently supported. bool FormatRangeSupported(const struct FormatRange *format_range, const struct AppGpu *gpu) { - // True if standard and supported by this instance - if (format_range->minimum_instance_version > 0 && gpu->inst->instance_version >= format_range->minimum_instance_version) { + // True if standard and supported by both this instance and this GPU + if (format_range->minimum_instance_version > 0 && + gpu->inst->instance_version >= format_range->minimum_instance_version && + gpu->props.apiVersion >= format_range->minimum_instance_version) { return true; }