hexops / mach

zig game engine & graphics toolkit
https://machengine.org
Other
3.31k stars 157 forks source link

panic: api error, error.OutOfDateKHR #1236

Open glyh opened 2 months ago

glyh commented 2 months ago

Environment Info

Reproduce

rm zig-out .zig-cache -rf 
zig build run-triangle -Dcore_platform=wayland

Error log

info(mach): found Vulkan backend on Discrete GPU adapter: NVIDIA GeForce RTX 4060 Laptop GPU, Vulkan driver version 43.232.128

VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-06211(ERROR / SPEC): msgNum: 301859828 - Validation Error: [ VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-06211 ] Object 0: handle = 0x18f77e70, type = VK_OBJECT_TYPE_PHYSICAL_DEVICE; | MessageID = 0x11fe03f4 | vkGetPhysicalDeviceSurfaceCapabilitiesKHR():  surface is not supported by the physicalDevice. The Vulkan spec states: surface must be supported by physicalDevice, as reported by vkGetPhysicalDeviceSurfaceSupportKHR or an equivalent platform-specific mechanism (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkGetPhysicalDeviceSurfaceCapabilitiesKHR-surface-06211)
    Objects: 1
        [0] 0x18f77e70, type: 2, name: NULL
VUID-VkSwapchainCreateInfoKHR-surface-01270(ERROR / SPEC): msgNum: -1585220531 - Validation Error: [ VUID-VkSwapchainCreateInfoKHR-surface-01270 ] Object 0: handle = 0xfd5b260000000001, type = VK_OBJECT_TYPE_SURFACE_KHR; | MessageID = 0xa183744d | vkCreateSwapchainKHR(): pCreateInfo->surface is not supported for presentation by this device. The Vulkan spec states: surface must be a surface that is supported by the device as determined using vkGetPhysicalDeviceSurfaceSupportKHR (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-surface-01270)
    Objects: 1
        [0] 0xfd5b260000000001, type: 1000000000, name: NULL
thread 309610 panic: api error
/home/lyh/.cache/zig/p/1220d2b6789b71a94e692cb2f060bff4ffa4edfe196216cd573da68e74ab884eb34e/vk.zig:30693:55: 0x10d94e0 in createSwapchainKHR (core-triangle)
                Result.error_initialization_failed => return error.InitializationFailed,
                                                      ^
/home/lyh/Documents/Knowledge/CS/Editors/mach/src/sysgpu/vulkan.zig:1024:30: 0x10d7b6d in init (core-triangle)
        const vk_swapchain = try vkd.createSwapchainKHR(vk_device, &.{
                             ^
/home/lyh/Documents/Knowledge/CS/Editors/mach/src/sysgpu/vulkan.zig:690:9: 0x10dab6e in createSwapChain (core-triangle)
        return SwapChain.init(device, surface, desc);
        ^
/home/lyh/Documents/Knowledge/CS/Editors/mach/src/sysgpu/main.zig:570:77: 0x10dcd25 in init (core-triangle)
        const swapchain = device.createSwapChain(surface, descriptor) catch @panic("api error");
                                                                            ^
/home/lyh/Documents/Knowledge/CS/Editors/mach/src/module/module.zig:422:32: 0x1137dd6 in dispatchInternal__anon_13496 (core-triangle)
                .ErrorUnion => try @call(.auto, handler, args),
                               ^
/home/lyh/Documents/Knowledge/CS/Editors/mach/src/module/module.zig:338:38: 0x1139e7f in dispatch (core-triangle)
            return m.dispatchInternal(stack_space, options, injectable);
                                     ^
/home/lyh/Documents/Knowledge/CS/Editors/mach/src/main.zig:77:34: 0x113a1f8 in run (core-triangle)
            try app.mods.dispatch(&stack_space, .{});
                                 ^
/home/lyh/Documents/Knowledge/CS/Editors/mach/examples/core/triangle/main.zig:17:16: 0x113a648 in main (core-triangle)
    try app.run(.{ .allocator = allocator });
               ^
/home/lyh/.zig/0.13.0-dev.351+64ef45eb0/files/lib/std/start.zig:524:37: 0x113ac2e in main (core-triangle)
            const result = root.main() catch |err| {
                                    ^
???:?:?: 0x7c325fad4e07 in ??? (libc.so.6)
Unwind information for `libc.so.6:0x7c325fad4e07` was not available, trace may be incomplete

???:?:?: 0x7c325fad4ecb in ??? (libc.so.6)
???:?:?: 0x10b7254 in ??? (???)
run-triangle
└─ run core-triangle failure
error: the following command terminated unexpectedly:
/home/lyh/Documents/Knowledge/CS/Editors/mach/zig-out/bin/core-triangle 
Build Summary: 53/55 steps succeeded; 1 failed (disable with --summary none)
run-triangle transitive failure
└─ run core-triangle failure
error: the following build command failed with exit code 1:
/home/lyh/Documents/Knowledge/CS/Editors/mach/.zig-cache/o/5644413977b2f935c73dcf220f1e6d1f/build /home/lyh/.zig/0.13.0-dev.351+64ef45eb0/files/zig /home/lyh/Documents/Knowledge/CS/Editors/mach /home/lyh/Documents/Knowledge/CS/Editors/mach/.zig-cache /home/lyh/.cache/zig --seed 0xa45d3d9c -Z185f5e01f7ae506c run-triangle -Dcore_platform=wayland
glyh commented 2 months ago

checking out to 0.4 and omitting all the -D params it seems to work for me now.

glyh commented 2 months ago

Still not sure should I have this closed or not.