fixing test and docs

This commit is contained in:
2025-12-17 18:12:53 +01:00
parent 64af182ecc
commit a67660f17b

View File

@@ -15,9 +15,6 @@ comptime {
if (!@hasDecl(root, "VULKAN_VERSION")) { if (!@hasDecl(root, "VULKAN_VERSION")) {
@compileError("Missing VULKAN_VERSION in module root"); @compileError("Missing VULKAN_VERSION in module root");
} }
if (!@hasDecl(root.Instance, "EXTENSIONS")) {
@compileError("Missing EXTENSIONS in Instance's implementation");
}
} }
} }
@@ -63,11 +60,15 @@ pub fn enumerateExtensionProperties(layer_name: ?[]const u8, count: *u32, p_prop
if (layer_name) |_| { if (layer_name) |_| {
return VkError.LayerNotPresent; return VkError.LayerNotPresent;
} }
count.* = root.Instance.EXTENSIONS.len; if (@hasDecl(root, "EXTENSIONS")) {
if (p_properties) |properties| { count.* = root.Instance.EXTENSIONS.len;
for (root.Instance.EXTENSIONS, 0..) |ext, i| { if (p_properties) |properties| {
properties[i] = ext; for (root.Instance.EXTENSIONS, 0..) |ext, i| {
properties[i] = ext;
}
} }
} else {
count.* = 0;
} }
} }