Skip to content

Commit 0140238

Browse files
committed
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.
1 parent 927e74e commit 0140238

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vulkaninfo/vulkaninfo.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,8 +1987,10 @@ static struct FormatRange {
19871987

19881988
// Helper function to determine whether a format range is currently supported.
19891989
bool FormatRangeSupported(const struct FormatRange *format_range, const struct AppGpu *gpu) {
1990-
// True if standard and supported by this instance
1991-
if (format_range->minimum_instance_version > 0 && gpu->inst->instance_version >= format_range->minimum_instance_version) {
1990+
// True if standard and supported by both this instance and this GPU
1991+
if (format_range->minimum_instance_version > 0 &&
1992+
gpu->inst->instance_version >= format_range->minimum_instance_version &&
1993+
gpu->props.apiVersion >= format_range->minimum_instance_version) {
19921994
return true;
19931995
}
19941996

0 commit comments

Comments
 (0)