Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase eval branch quota #159

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Conversation

poconn
Copy link
Contributor

@poconn poconn commented Sep 9, 2024

The limit is being hit when enabling core APIs up to 1.3, reproducible with the triangle example:

diff --git a/examples/graphics_context.zig b/examples/graphics_context.zig
index f2d0fef..452de08 100644
--- a/examples/graphics_context.zig
+++ b/examples/graphics_context.zig
@@ -18,6 +18,9 @@ const apis: []const vk.ApiInfo = &.{
     },
     // Or you can add entire feature sets or extensions
     vk.features.version_1_0,
+    vk.features.version_1_1,
+    vk.features.version_1_2,
+    vk.features.version_1_3,
     vk.extensions.khr_surface,
     vk.extensions.khr_swapchain,
 };
$ zig build
install
└─ install triangle
   └─ zig build-exe triangle Debug native 1 errors
/home/poconn/.local/bin/lib/std/meta.zig:553:12: error: evaluation exceeded 100000 backwards branches
    inline for (field_infos, 0..) |field, i| {
    ~~~~~~~^~~
/home/poconn/.local/bin/lib/std/meta.zig:553:12: note: use @setEvalBranchQuota() to raise the branch limit from 100000
.zig-cache/o/d2e9780c6536d8d352b813519c69b0fe/vk.zig:28370:76: note: called from here
                    const field_tag = std.enums.nameCast(std.meta.FieldEnum(DeviceCommandFlags), field.name);
                                                         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
referenced by:
    vk.DeviceWrapper(&.{ .{ ... }, .{ ... }, .{ ... }, .{ ... }, .{ ... }, .{ ... }, .{ ... } }[0..7]): .zig-cache/o/d2e9780c6536d8d352b813519c69b0fe/vk.zig:28346:19
    Wrapper: .zig-cache/o/d2e9780c6536d8d352b813519c69b0fe/vk.zig:28345:12

I see it was already recently increased and so it's surprising that it's necessary again, maybe recent compiler changes?

$ zig version
0.14.0-dev.1511+54b668f8a

@Snektron Snektron merged commit efad55b into Snektron:master Sep 12, 2024
1 check passed
@Snektron
Copy link
Owner

Thanks!

@poconn poconn deleted the increase_branch_quota branch September 12, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants