Skip to content

Commit a67660f

Browse files
committed
fixing test and docs
1 parent 64af182 commit a67660f

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/vulkan/Instance.zig

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ comptime {
1515
if (!@hasDecl(root, "VULKAN_VERSION")) {
1616
@compileError("Missing VULKAN_VERSION in module root");
1717
}
18-
if (!@hasDecl(root.Instance, "EXTENSIONS")) {
19-
@compileError("Missing EXTENSIONS in Instance's implementation");
20-
}
2118
}
2219
}
2320

@@ -63,11 +60,15 @@ pub fn enumerateExtensionProperties(layer_name: ?[]const u8, count: *u32, p_prop
6360
if (layer_name) |_| {
6461
return VkError.LayerNotPresent;
6562
}
66-
count.* = root.Instance.EXTENSIONS.len;
67-
if (p_properties) |properties| {
68-
for (root.Instance.EXTENSIONS, 0..) |ext, i| {
69-
properties[i] = ext;
63+
if (@hasDecl(root, "EXTENSIONS")) {
64+
count.* = root.Instance.EXTENSIONS.len;
65+
if (p_properties) |properties| {
66+
for (root.Instance.EXTENSIONS, 0..) |ext, i| {
67+
properties[i] = ext;
68+
}
7069
}
70+
} else {
71+
count.* = 0;
7172
}
7273
}
7374

0 commit comments

Comments
 (0)