Fix a whole bunch of issues exposed by ziglang/zig#9191

This also includes a workaround for the fact that @"type" refers to the builtin
and not to a variable called "type". See ziglang/zig#2897.
This commit is contained in:
Robin Voetter
2021-06-24 02:11:36 +02:00
parent de0a048f45
commit 79d901a3e0
10 changed files with 82 additions and 75 deletions

View File

@@ -123,7 +123,7 @@ pub const GraphicsContext = struct {
self.vki = try InstanceDispatch.load(self.instance, c.glfwGetInstanceProcAddress);
errdefer self.vki.destroyInstance(self.instance, null);
self.surface = try createSurface(self.vki, self.instance, window);
self.surface = try createSurface(self.instance, window);
errdefer self.vki.destroySurfaceKHR(self.instance, self.surface, null);
const candidate = try pickPhysicalDevice(self.vki, self.instance, allocator, self.surface);
@@ -182,7 +182,7 @@ pub const Queue = struct {
}
};
fn createSurface(vki: InstanceDispatch, instance: vk.Instance, window: *c.GLFWwindow) !vk.SurfaceKHR {
fn createSurface(instance: vk.Instance, window: *c.GLFWwindow) !vk.SurfaceKHR {
var surface: vk.SurfaceKHR = undefined;
if (c.glfwCreateWindowSurface(instance, window, null, &surface) != .success) {
return error.SurfaceInitFailed;