From db511f7555a4c3968b583d9e975e53d51b19e0a6 Mon Sep 17 00:00:00 2001 From: Chris Heyes <22148308+hazeycode@users.noreply.github.com> Date: Sat, 19 Apr 2025 01:54:45 +0100 Subject: [PATCH 1/6] Upgrade to Zig 0.14.0 --- .zigversion | 2 +- build.zig.zon | 135 +++++++++++++++--------------- dev.build.zig.zon | 54 ++++++------ libs/system_sdk | 2 +- libs/zaudio | 2 +- libs/zbullet | 2 +- libs/zemscripten | 2 +- libs/zflecs | 2 +- libs/zglfw | 2 +- libs/zgpu | 2 +- libs/zgui | 2 +- libs/zjobs | 2 +- libs/zmath | 2 +- libs/zmesh | 2 +- libs/znoise | 2 +- libs/zopengl | 2 +- libs/zopenvr | 2 +- libs/zphysics | 2 +- libs/zpix | 2 +- libs/zpool | 2 +- libs/zsdl | 2 +- libs/zstbi | 2 +- libs/ztracy | 2 +- libs/zwindows | 2 +- samples/monolith/src/monolith.zig | 6 +- samples/sdl2_demo/build.zig | 5 +- 26 files changed, 124 insertions(+), 120 deletions(-) diff --git a/.zigversion b/.zigversion index 27af068ae..a803cc227 100644 --- a/.zigversion +++ b/.zigversion @@ -1 +1 @@ -0.14.0-dev.2577+271452d22 +0.14.0 diff --git a/build.zig.zon b/build.zig.zon index 95b8219ba..b5713ef8b 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,6 +1,7 @@ .{ - .name = "zig-gamedev", - .version = "0.6.0", + .name = .zig_gamedev, + .fingerprint = 0xe02dab6801fee8e4, + .version = "0.7.0", .minimum_zig_version = "0.14.0", .paths = .{ "build.zig", @@ -13,28 +14,28 @@ }, .dependencies = .{ .system_sdk = .{ - .url = "https://github.com/zig-gamedev/system_sdk/archive/d1e724748d15cfcbf50c45ec7c7019688d45b16a.tar.gz", - .hash = "122047a9298c4c9dd43389d418d6826d469b192246ba0944102964cdc57f94c562df", + .url = "https://github.com/zig-gamedev/system_sdk/archive/c0dbf11cdc17da5904ea8a17eadc54dee26567ec.tar.gz", + .hash = "system_sdk-0.3.0-dev-alwUNnYaaAJAtIdE2fg4NQfDqEKs7QCXy_qYukAOBfmF", }, .zaudio = .{ - .url = "https://github.com/zig-gamedev/zaudio/archive/1d55b813e090271d2774a7637ec3c077a2847c43.tar.gz", - .hash = "1220b4c7d7a2e6f0ac3a6bf5cd52d2adf73b18d131c9290290f7fb380d54ad12ee61", + .url = "https://github.com/zig-gamedev/zaudio/archive/fda144641276dd54ddabe2b77f5807fff7eda036.tar.gz", + .hash = "zaudio-0.11.0-dev-_M-91iBkPwDaOhCWkRhekq9IxJ_hM70TWQRru1vCitlC", }, .zbullet = .{ - .url = "https://github.com/zig-gamedev/zbullet/archive/4b9982c339f9c037e7f21e8551ffbfc01bdd771c.tar.gz", - .hash = "1220b67a8c68334fb1c0dc13cbc1b72777a5abb81640a9639f58017e520a48deb325", + .url = "https://github.com/zig-gamedev/zbullet/archive/42019948cbc1576f21e160b5d63dd48e0794af04.tar.gz", + .hash = "zbullet-0.4.0-dev-7gkXj56UQAAWBrQKXS05ruNttSLBPv1w5IbIxkcZmgH0", }, .zflecs = .{ - .url = "https://github.com/zig-gamedev/zflecs/archive/fcde2da35ea43c289bc731c9a244417c176192d0.tar.gz", - .hash = "12201bcd78d8301929e3f1a029c6f418340b4f540b885c685fde51e4b34ead27a4a5", + .url = "https://github.com/zig-gamedev/zflecs/archive/34f6cc3f6d11fa13a44ae759e9ed6bec3a455fa4.tar.gz", + .hash = "zflecs-0.2.0-dev-1PN3yuhMNQDj3J57z74E3AIGM8bmVg3FhAd6XZKb_A9W", }, .zemscripten = .{ - .url = "https://github.com/zig-gamedev/zemscripten/archive/66088f8317fa546b14b1119cb1a7d68973905130.tar.gz", - .hash = "12205235fca69823cc458a358846c7bd05ed33a854148ab95526b7c133e5e7a9aefb", + .url = "https://github.com/zig-gamedev/zemscripten/archive/cac24b72f87432ce607c02abcfad7822b702aad9.tar.gz", + .hash = "zemscripten-0.2.0-dev-sRlDqBtLAADUk3IZprWI0srnchHAXRSQu1n4wZiRvXmr", }, .emsdk = .{ .url = "https://github.com/emscripten-core/emsdk/archive/refs/tags/4.0.3.tar.gz", @@ -42,138 +43,138 @@ }, .zglfw = .{ - .url = "https://github.com/zig-gamedev/zglfw/archive/e9bd486903b5904b6d4e27b8b3771b138a667ef1.tar.gz", - .hash = "12209fb981e7aab58c2f9062ab526bd43df3d7953aa41e131a173c37ad35d10b1132", + .url = "https://github.com/zig-gamedev/zglfw/archive/30b29eee8047852708e79aadf0425494e6d7c5b5.tar.gz", + .hash = "zglfw-0.10.0-dev-zgVDNG2cIQAiAC_gLYmbML-NQklPW5B_AELV_fAQc2Jg", }, .zgpu = .{ - .url = "https://github.com/zig-gamedev/zgpu/archive/bc10f874cf9c93e347c1298efba87be4f001fc9d.tar.gz", - .hash = "122020a116e18cad9f4ea905ca63a1505a47d680feb6edc9ebcf34795bf338f5868b", + .url = "https://github.com/zig-gamedev/zgpu/archive/3ae4a71af16df3a7dfa95023bba1a1e6a0bfb80d.tar.gz", + .hash = "zgpu-0.12.0-dev-nqFT5BCgCADqzg95ZvomJREp6oIl3NTubfyiUNHc18Pr", }, .dawn_x86_64_windows_gnu = .{ .url = "https://github.com/michal-z/webgpu_dawn-x86_64-windows-gnu/archive/d3a68014e6b6b53fd330a0ccba99e4dcfffddae5.tar.gz", - .hash = "1220f9448cde02ef3cd51bde2e0850d4489daa0541571d748154e89c6eb46c76a267", + .hash = "N-V-__8AAGsYnAT5RIzeAu881RveLghQ1EidqgVBVx10gVTo", .lazy = true, }, .dawn_x86_64_linux_gnu = .{ .url = "https://github.com/michal-z/webgpu_dawn-x86_64-linux-gnu/archive/7d70db023bf254546024629cbec5ee6113e12a42.tar.gz", - .hash = "12204a3519efd49ea2d7cf63b544492a3a771d37eda320f86380813376801e4cfa73", + .hash = "N-V-__8AAK7XUQNKNRnv1J6i189jtURJKjp3HTftoyD4Y4CB", .lazy = true, }, .dawn_aarch64_linux_gnu = .{ .url = "https://github.com/michal-z/webgpu_dawn-aarch64-linux-gnu/archive/c1f55e740a62f6942ff046e709ecd509a005dbeb.tar.gz", - .hash = "12205cd13f6849f94ef7688ee88c6b74c7918a5dfb514f8a403fcc2929a0aa342627", + .hash = "N-V-__8AAJ-wTwNc0T9oSflO92iO6IxrdMeRil37UU-KQD_M", .lazy = true, }, .dawn_aarch64_macos = .{ .url = "https://github.com/michal-z/webgpu_dawn-aarch64-macos/archive/d2360cdfff0cf4a780cb77aa47c57aca03cc6dfe.tar.gz", - .hash = "12201fe677e9c7cfb8984a36446b329d5af23d03dc1e4f79a853399529e523a007fa", + .hash = "N-V-__8AALVIRAIf5nfpx8-4mEo2RGsynVryPQPcHk95qFM5", .lazy = true, }, .dawn_x86_64_macos = .{ .url = "https://github.com/michal-z/webgpu_dawn-x86_64-macos/archive/901716b10b31ce3e0d3fe479326b41e91d59c661.tar.gz", - .hash = "1220b1f02f2f7edd98a078c64e3100907d90311d94880a3cc5927e1ac009d002667a", + .hash = "N-V-__8AAIz1QAKx8C8vft2YoHjGTjEAkH2QMR2UiAo8xZJ-", .lazy = true, }, .zgui = .{ - .url = "https://github.com/zig-gamedev/zgui/archive/655a123f5da273f5e745d587d42ac652b3ca441e.tar.gz", - .hash = "1220d4d6e539b6c60ae448ac3b2c724cccdf9e53eb889a16a5a3dc9689feca4e8c7e", + .url = "https://github.com/zig-gamedev/zgui/archive/0f2e9c7b50b2b5f36243ac8028f38adfe289303b.tar.gz", + .hash = "zgui-0.6.0-dev--L6sZJWZaAAJXsX2Alyo89zyb0El4LV37XxEhPz1H9ql", }, .zjobs = .{ - .url = "https://github.com/zig-gamedev/zjobs/archive/19743327b06209a8041f7840ec13a9b794767d32.tar.gz", - .hash = "12203322a6cbf36b797c78833fae7391b736f3808ee59d7ce092981d02bbde941a07", + .url = "https://github.com/zig-gamedev/zjobs/archive/dfdb734e8084f7dc5010a4ded30bc8e04b6d4393.tar.gz", + .hash = "zjobs-0.3.0-dev-59uaZmTQAABLe7t30aW2PD5P3VxjWbAoL1XXnhgs2Ymd", }, .zmath = .{ - .url = "https://github.com/zig-gamedev/zmath/archive/24cdd20f9da09bd1ce7b552907eeaba9bafea59d.tar.gz", - .hash = "1220081d55b58b968d953db1afc2fb01b2f5733929144e69522461ce25fa6450d84e", + .url = "https://github.com/zig-gamedev/zmath/archive/ccf7297ef6c01e21b2d51ad81b5b6ce929e86a00.tar.gz", + .hash = "zmath-0.11.0-dev-wjwivZY1AwDO7yxNmZ5HWoU03f9mFBet8LN9-oYc3i29", }, .zmesh = .{ - .url = "https://github.com/zig-gamedev/zmesh/archive/1fc267af7c8bd00cb2d79de12b3e0512a3b787cf.tar.gz", - .hash = "1220791c58e1f2e911d5b776efe8893c64684a56d9196b98d95b59ee45b3624b048d", + .url = "https://github.com/zig-gamedev/zmesh/archive/f8f528128704ae879a16ddb0a3470c5e0a144a20.tar.gz", + .hash = "zmesh-0.11.0-dev-oO3A5gx7CgCBPHsGeuNzwzXAyEvs57u39AD5EUZTScli", }, .znoise = .{ - .url = "https://github.com/zig-gamedev/znoise/archive/b6e7a24c9bfa4bae63521664e191a728b5b18805.tar.gz", - .hash = "12208e16c80366e2a2f8bd3f1c676b09bf47c157f4d0f0d6440555f9b74d8a9d79f7", + .url = "https://github.com/zig-gamedev/znoise/archive/96f9458c2da975a8bf1cdf95e819c7b070965198.tar.gz", + .hash = "znoise-0.3.0-dev-gK1op-mjAQAvffA1EcRD0GekpVpgN7Km5rquofgZ0bq7", }, .zopengl = .{ - .url = "https://github.com/zig-gamedev/zopengl/archive/c9c293a9af388478bca0ad52007a72372ef71747.tar.gz", - .hash = "1220c030f5e33e09bd80fe7a7b064b65e1fc02e9bbf603ba04716866c9f1ca16f8ce", + .url = "https://github.com/zig-gamedev/zopengl/archive/fe574e10bc096983631d9f18b363e7a88247eef4.tar.gz", + .hash = "zopengl-0.6.0-dev-5-tnz0tUCAAecmfZHeJBAGiwU9ofrlLHJEGt2CXwnmF9", }, .zopenvr = .{ - .url = "https://github.com/zig-gamedev/zopenvr/archive/f7c4696c9be9eaf75e9b878e11392e707194bded.tar.gz", - .hash = "1220cf39bd5b439ed552517c32b2b5ac28e28beb245aa8537e9b95019b7c5cac708c", + .url = "https://github.com/zig-gamedev/zopenvr/archive/9e1fb62ab054bd914911870d255f4a458621f2ec.tar.gz", + .hash = "zopenvr-0.1.0-dev-FvPTqnNtlwD_Ju7h6tdRiNZuxJsd4EApZyAiQIWPudOe", }, .zphysics = .{ - .url = "https://github.com/zig-gamedev/zphysics/archive/e5d77a1f25c456786d8981eb287857cff0869c30.tar.gz", - .hash = "1220631e6b4ac819aedd854cfa68af37e2513ffd7f363243ae30bdfadadf46aac509", + .url = "https://github.com/zig-gamedev/zphysics/archive/0c60c1a0f2a2393c3c226dabd0bd7315f155f3ef.tar.gz", + .hash = "zphysics-0.2.0-dev-nZDEAHKiPwDIup82Bua4nZKs18EEpgWCLuEjWNAlmuau", }, .zpix = .{ - .url = "https://github.com/zig-gamedev/zpix/archive/b69194be5edc653cd250c81ff592d205787d0f8e.tar.gz", - .hash = "12208392e8408979936c9ae229ef49a68128d00744b4081d740beff79a65b914b9cf", + .url = "https://github.com/zig-gamedev/zpix/archive/e1f5f72d2a64ac1c459a14be40df63bef07bb97e.tar.gz", + .hash = "zpix-0.11.0-dev-T9TIVqU4AACjM3XmezXEkVGWHwvTAnz5VLtHh7kn6u-l", }, .zpool = .{ - .url = "https://github.com/zig-gamedev/zpool/archive/820e0e59dc415d9784004464a6cf52223fbce126.tar.gz", - .hash = "1220e600a92d73dc8c3b5303351dcc67352114c975e59ae55de11b637ec173e75455", + .url = "https://github.com/zig-gamedev/zpool/archive/99a4c74ec26b1f327209782565b4adaf1c1d610f.tar.gz", + .hash = "zpool-0.11.0-dev-bG692eY7AQDLTkjTbgnbg_-qgjmxUCg8hNpN1kZRrIlW", }, .zsdl = .{ - .url = "https://github.com/zig-gamedev/zsdl/archive/9635e2f996e86cd46ce939752b7a8c47f9883b9e.tar.gz", - .hash = "1220a5251c77af0d18c54ab1754fb0a296b9e4894b544b365c3e3da3c661b3b6f2aa", + .url = "https://github.com/zig-gamedev/zsdl/archive/680fc9614d01173168c8ecb5b2256b7f1de73c41.tar.gz", + .hash = "zsdl-0.4.0-dev-rFpjE6pXWQC9EXxkkH2zO6MUh9JCDgteTDAIPt-mSQm2", }, - .@"sdl2-prebuilt-macos" = .{ - .url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/f14773fa3de719b3a399b854c31eb4139d63842f.tar.gz", - .hash = "12205cb2da6fb4a7fcf28b9cd27b60aaf12f4d4a55be0260b1ae36eaf93ca5a99f03", + .sdl2_prebuilt_macos = .{ + .url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/7bc0fa9101342c019eed252d43f490660dfa411b.tar.gz", + .hash = "sdl2_prebuilt_macos-0.2.0-dev-DaOxP5Eq2QBpNBkpXn2qjyI6_s0gINcbdUMpqI1KshaH", .lazy = true, }, - .@"sdl2-prebuilt-x86_64-windows-gnu" = .{ - .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-windows-gnu/archive/8143e2a5c28dbace399cbff14c3e8749a1afd418.tar.gz", - .hash = "1220ade6b84d06d73bf83cef22c73ec4abc21a6d50b9f48875f348b7942c80dde11b", + .sdl2_prebuilt_x86_64_windows_gnu = .{ + .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-windows-gnu/archive/8de1512cedfa1fb3ab17ecf295af8cabd7f231f1.tar.gz", + .hash = "sdl2_prebuilt_x86_64_windows_gnu-0.2.0-dev-HPeIhv2VaQBOWF4Fjtr7Vb9bA852pUtwUuQKdvNvkA98", .lazy = true, }, - .@"sdl2-prebuilt-x86_64-linux-gnu" = .{ - .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu/archive/2eccc574ad909b0d00b694b10c217a95145c47af.tar.gz", - .hash = "12200ecb91c0596d0356ff39d573af83abcd44fecb27943589f11c2cd172763fea39", + .sdl2_prebuilt_x86_64_linux_gnu = .{ + .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu/archive/ce2b511c052c3fdc35c286ade8235d2830a50992.tar.gz", + .hash = "sdl2_prebuilt_x86_64_linux_gnu-0.2.0-dev-NHZ_xrzSHwDJDoAxuVi000OEq428znS1fDRRJE8PlXHu", .lazy = true, }, - .@"sdl3-prebuilt-macos" = .{ - .url = "https://github.com/zig-gamedev/sdl3-prebuilt-macos/archive/07985b3c3eb79277ae11a3dcf2b17d68bfe8276f.tar.gz", - .hash = "1220f4a00b613878775ad71299fff1964f3c6e7e21add7a9e82f5f25897c7ac2368e", + .sdl3_prebuilt_macos = .{ + .url = "https://github.com/zig-gamedev/sdl3-prebuilt-macos/archive/e89207914a0f0163c0fb543da4f530f645ef5969.tar.gz", + .hash = "sdl3_prebuilt_macos-0.2.0-dev-A1UBS1aUdwCWfplgS5fNorbstvDxSi3LOHnSPzjmWZhl", .lazy = true, }, - .@"sdl3-prebuilt-x86_64-windows-gnu" = .{ - .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-windows-gnu/archive/bd506c7cf80c4bb4876a169f77ecaa0f12824c5.tar.gz", - .hash = "122073ccc1be25223aed7eb9590e81eed67835901cd18ebf2314eb9cfe5bbef595cf", + .sdl3_prebuilt_x86_64_windows_gnu = .{ + .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-windows-gnu/archive/8f5dc1a9c9450ac578286e90d4667fc3aa1b23e2.tar.gz", + .hash = "sdl3_prebuilt_x86_64_windows_gnu-0.2.0-dev-AAAAAI_mJADlsRyMxRFKobQJEbfs1p-37A9mmYEj7DW-", .lazy = true, }, - .@"sdl3-prebuilt-x86_64-linux-gnu" = .{ - .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-linux-gnu/archive/183871b80747c77cfd467555ac7921fc828438ee.tar.gz", - .hash = "1220457c9927ab54acd80f67b372b50399dfe1716fdb97865423b1ae86876a95ca81", + .sdl3_prebuilt_x86_64_linux_gnu = .{ + .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-linux-gnu/archive/b19959ed3aa87d8393640d7ba3aec142ae85487b.tar.gz", + .hash = "sdl3_prebuilt_x86_64_linux_gnu-0.2.0-dev-qpwWsmyVNwBHzXjgC9Z-U02SXoUVMMxvCnI7XKocDcDn", .lazy = true, }, .zstbi = .{ - .url = "https://github.com/zig-gamedev/zstbi/archive/4fce0ee7ca94bd42536c136d9a369e647bc55b14.tar.gz", - .hash = "122080418650eec7bd891749529fd13c99a118181fac8715035fdcfd8f76d65b2b0f", + .url = "https://github.com/zig-gamedev/zstbi/archive/094c4bba5cdbec167d3f6aaa98cccccd5c99145f.tar.gz", + .hash = "zstbi-0.11.0-dev-L0Ea_-eVBwCl8RYA98PhLDw3Fhw5k7FJOHSMDKWDOvqx", }, .ztracy = .{ - .url = "https://github.com/zig-gamedev/ztracy/archive/5af60074f355ecda6114d08dcc8c931c3d163c94.tar.gz", - .hash = "1220293b509e9238e43828b00ee18e38eeace190ef844b74bf54e3db6e7da7398f4b", + .url = "https://github.com/zig-gamedev/ztracy/archive/be3d003f29d59d72e68e493ab531374ab474a795.tar.gz", + .hash = "ztracy-0.14.0-dev-zHJSq1oQFwCAq2LhbqsBUmZAipMzsD8UfKL5Etc_OJMb", }, .zwindows = .{ - .url = "https://github.com/zig-gamedev/zwindows/archive/4c4e0ea8222978fe482cf8ba62e24c2486bd0b9f.tar.gz", - .hash = "12204948283efd34140a20dfdc36b2bcd57fc1d52e18d37ca7d5ef7077142d768d02", + .url = "https://github.com/zig-gamedev/zwindows/archive/a6330ff75e2f68c469bf205be93b9093e6d592b8.tar.gz", + .hash = "zwindows-0.2.0-dev-xMZ1u_NkyQYcX_gtNQIQuecZ3IAWCUfTPaouYXUs3_Rw", }, }, } diff --git a/dev.build.zig.zon b/dev.build.zig.zon index 51b9c22cf..09880d41a 100644 --- a/dev.build.zig.zon +++ b/dev.build.zig.zon @@ -1,6 +1,7 @@ .{ - .name = "zig-gamedev", - .version = "0.6.0", + .name = .zig_gamedev, + .fingerprint = 0xe02dab6801fee8e4, + .version = "0.7.0", .minimum_zig_version = "0.14.0", .paths = .{ "build.zig", @@ -31,27 +32,27 @@ .zgpu = .{ .path = "libs/zgpu" }, .dawn_x86_64_windows_gnu = .{ .url = "https://github.com/michal-z/webgpu_dawn-x86_64-windows-gnu/archive/d3a68014e6b6b53fd330a0ccba99e4dcfffddae5.tar.gz", - .hash = "1220f9448cde02ef3cd51bde2e0850d4489daa0541571d748154e89c6eb46c76a267", + .hash = "N-V-__8AAGsYnAT5RIzeAu881RveLghQ1EidqgVBVx10gVTo", .lazy = true, }, .dawn_x86_64_linux_gnu = .{ .url = "https://github.com/michal-z/webgpu_dawn-x86_64-linux-gnu/archive/7d70db023bf254546024629cbec5ee6113e12a42.tar.gz", - .hash = "12204a3519efd49ea2d7cf63b544492a3a771d37eda320f86380813376801e4cfa73", + .hash = "N-V-__8AAK7XUQNKNRnv1J6i189jtURJKjp3HTftoyD4Y4CB", .lazy = true, }, .dawn_aarch64_linux_gnu = .{ .url = "https://github.com/michal-z/webgpu_dawn-aarch64-linux-gnu/archive/c1f55e740a62f6942ff046e709ecd509a005dbeb.tar.gz", - .hash = "12205cd13f6849f94ef7688ee88c6b74c7918a5dfb514f8a403fcc2929a0aa342627", + .hash = "N-V-__8AAJ-wTwNc0T9oSflO92iO6IxrdMeRil37UU-KQD_M", .lazy = true, }, .dawn_aarch64_macos = .{ .url = "https://github.com/michal-z/webgpu_dawn-aarch64-macos/archive/d2360cdfff0cf4a780cb77aa47c57aca03cc6dfe.tar.gz", - .hash = "12201fe677e9c7cfb8984a36446b329d5af23d03dc1e4f79a853399529e523a007fa", + .hash = "N-V-__8AALVIRAIf5nfpx8-4mEo2RGsynVryPQPcHk95qFM5", .lazy = true, }, .dawn_x86_64_macos = .{ .url = "https://github.com/michal-z/webgpu_dawn-x86_64-macos/archive/901716b10b31ce3e0d3fe479326b41e91d59c661.tar.gz", - .hash = "1220b1f02f2f7edd98a078c64e3100907d90311d94880a3cc5927e1ac009d002667a", + .hash = "N-V-__8AAIz1QAKx8C8vft2YoHjGTjEAkH2QMR2UiAo8xZJ-", .lazy = true, }, @@ -76,42 +77,41 @@ .zpool = .{ .path = "libs/zpool" }, .zsdl = .{ .path = "libs/zsdl" }, - .@"sdl2-prebuilt-macos" = .{ - .url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/f14773fa3de719b3a399b854c31eb4139d63842f.tar.gz", - .hash = "12205cb2da6fb4a7fcf28b9cd27b60aaf12f4d4a55be0260b1ae36eaf93ca5a99f03", + .sdl2_prebuilt_macos = .{ + .url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/7bc0fa9101342c019eed252d43f490660dfa411b.tar.gz", + .hash = "sdl2_prebuilt_macos-0.2.0-dev-DaOxP5Eq2QBpNBkpXn2qjyI6_s0gINcbdUMpqI1KshaH", .lazy = true, }, - .@"sdl2-prebuilt-x86_64-windows-gnu" = .{ - .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-windows-gnu/archive/8143e2a5c28dbace399cbff14c3e8749a1afd418.tar.gz", - .hash = "1220ade6b84d06d73bf83cef22c73ec4abc21a6d50b9f48875f348b7942c80dde11b", + .sdl2_prebuilt_x86_64_windows_gnu = .{ + .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-windows-gnu/archive/8de1512cedfa1fb3ab17ecf295af8cabd7f231f1.tar.gz", + .hash = "sdl2_prebuilt_x86_64_windows_gnu-0.2.0-dev-HPeIhv2VaQBOWF4Fjtr7Vb9bA852pUtwUuQKdvNvkA98", .lazy = true, }, - .@"sdl2-prebuilt-x86_64-linux-gnu" = .{ - .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu/archive/2eccc574ad909b0d00b694b10c217a95145c47af.tar.gz", - .hash = "12200ecb91c0596d0356ff39d573af83abcd44fecb27943589f11c2cd172763fea39", + .sdl2_prebuilt_x86_64_linux_gnu = .{ + .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu/archive/ce2b511c052c3fdc35c286ade8235d2830a50992.tar.gz", + .hash = "sdl2_prebuilt_x86_64_linux_gnu-0.2.0-dev-NHZ_xrzSHwDJDoAxuVi000OEq428znS1fDRRJE8PlXHu", .lazy = true, }, - .@"sdl3-prebuilt-macos" = .{ - .url = "https://github.com/zig-gamedev/sdl3-prebuilt-macos/archive/07985b3c3eb79277ae11a3dcf2b17d68bfe8276f.tar.gz", - .hash = "1220f4a00b613878775ad71299fff1964f3c6e7e21add7a9e82f5f25897c7ac2368e", + .sdl3_prebuilt_macos = .{ + .url = "https://github.com/zig-gamedev/sdl3-prebuilt-macos/archive/e89207914a0f0163c0fb543da4f530f645ef5969.tar.gz", + .hash = "sdl3_prebuilt_macos-0.2.0-dev-A1UBS1aUdwCWfplgS5fNorbstvDxSi3LOHnSPzjmWZhl", .lazy = true, }, - .@"sdl3-prebuilt-x86_64-windows-gnu" = .{ - .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-windows-gnu/archive/bd506c7cf80c4bb4876a169f77ecaa0f12824c5.tar.gz", - .hash = "122073ccc1be25223aed7eb9590e81eed67835901cd18ebf2314eb9cfe5bbef595cf", + .sdl3_prebuilt_x86_64_windows_gnu = .{ + .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-windows-gnu/archive/8f5dc1a9c9450ac578286e90d4667fc3aa1b23e2.tar.gz", + .hash = "sdl3_prebuilt_x86_64_windows_gnu-0.2.0-dev-AAAAAI_mJADlsRyMxRFKobQJEbfs1p-37A9mmYEj7DW-", .lazy = true, }, - .@"sdl3-prebuilt-x86_64-linux-gnu" = .{ - .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-linux-gnu/archive/183871b80747c77cfd467555ac7921fc828438ee.tar.gz", - .hash = "1220457c9927ab54acd80f67b372b50399dfe1716fdb97865423b1ae86876a95ca81", + .sdl3_prebuilt_x86_64_linux_gnu = .{ + .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-linux-gnu/archive/b19959ed3aa87d8393640d7ba3aec142ae85487b.tar.gz", + .hash = "sdl3_prebuilt_x86_64_linux_gnu-0.2.0-dev-qpwWsmyVNwBHzXjgC9Z-U02SXoUVMMxvCnI7XKocDcDn", .lazy = true, }, - .zstbi = .{ .path = "libs/zstbi" }, .ztracy = .{ .path = "libs/ztracy" }, - + .zwindows = .{ .path = "libs/zwindows" }, }, } diff --git a/libs/system_sdk b/libs/system_sdk index bf49d627a..c0dbf11cd 160000 --- a/libs/system_sdk +++ b/libs/system_sdk @@ -1 +1 @@ -Subproject commit bf49d627a191e339f70e72668c8333717fb969b0 +Subproject commit c0dbf11cdc17da5904ea8a17eadc54dee26567ec diff --git a/libs/zaudio b/libs/zaudio index 1d55b813e..fda144641 160000 --- a/libs/zaudio +++ b/libs/zaudio @@ -1 +1 @@ -Subproject commit 1d55b813e090271d2774a7637ec3c077a2847c43 +Subproject commit fda144641276dd54ddabe2b77f5807fff7eda036 diff --git a/libs/zbullet b/libs/zbullet index 4b9982c33..42019948c 160000 --- a/libs/zbullet +++ b/libs/zbullet @@ -1 +1 @@ -Subproject commit 4b9982c339f9c037e7f21e8551ffbfc01bdd771c +Subproject commit 42019948cbc1576f21e160b5d63dd48e0794af04 diff --git a/libs/zemscripten b/libs/zemscripten index 2c5c40b45..cac24b72f 160000 --- a/libs/zemscripten +++ b/libs/zemscripten @@ -1 +1 @@ -Subproject commit 2c5c40b451a09df46a41c8f50cd2d21ec678018c +Subproject commit cac24b72f87432ce607c02abcfad7822b702aad9 diff --git a/libs/zflecs b/libs/zflecs index fcde2da35..34f6cc3f6 160000 --- a/libs/zflecs +++ b/libs/zflecs @@ -1 +1 @@ -Subproject commit fcde2da35ea43c289bc731c9a244417c176192d0 +Subproject commit 34f6cc3f6d11fa13a44ae759e9ed6bec3a455fa4 diff --git a/libs/zglfw b/libs/zglfw index e9bd48690..30b29eee8 160000 --- a/libs/zglfw +++ b/libs/zglfw @@ -1 +1 @@ -Subproject commit e9bd486903b5904b6d4e27b8b3771b138a667ef1 +Subproject commit 30b29eee8047852708e79aadf0425494e6d7c5b5 diff --git a/libs/zgpu b/libs/zgpu index bc10f874c..3ae4a71af 160000 --- a/libs/zgpu +++ b/libs/zgpu @@ -1 +1 @@ -Subproject commit bc10f874cf9c93e347c1298efba87be4f001fc9d +Subproject commit 3ae4a71af16df3a7dfa95023bba1a1e6a0bfb80d diff --git a/libs/zgui b/libs/zgui index 655a123f5..0f2e9c7b5 160000 --- a/libs/zgui +++ b/libs/zgui @@ -1 +1 @@ -Subproject commit 655a123f5da273f5e745d587d42ac652b3ca441e +Subproject commit 0f2e9c7b50b2b5f36243ac8028f38adfe289303b diff --git a/libs/zjobs b/libs/zjobs index 19743327b..dfdb734e8 160000 --- a/libs/zjobs +++ b/libs/zjobs @@ -1 +1 @@ -Subproject commit 19743327b06209a8041f7840ec13a9b794767d32 +Subproject commit dfdb734e8084f7dc5010a4ded30bc8e04b6d4393 diff --git a/libs/zmath b/libs/zmath index 24cdd20f9..ccf7297ef 160000 --- a/libs/zmath +++ b/libs/zmath @@ -1 +1 @@ -Subproject commit 24cdd20f9da09bd1ce7b552907eeaba9bafea59d +Subproject commit ccf7297ef6c01e21b2d51ad81b5b6ce929e86a00 diff --git a/libs/zmesh b/libs/zmesh index 1fc267af7..f8f528128 160000 --- a/libs/zmesh +++ b/libs/zmesh @@ -1 +1 @@ -Subproject commit 1fc267af7c8bd00cb2d79de12b3e0512a3b787cf +Subproject commit f8f528128704ae879a16ddb0a3470c5e0a144a20 diff --git a/libs/znoise b/libs/znoise index b6e7a24c9..96f9458c2 160000 --- a/libs/znoise +++ b/libs/znoise @@ -1 +1 @@ -Subproject commit b6e7a24c9bfa4bae63521664e191a728b5b18805 +Subproject commit 96f9458c2da975a8bf1cdf95e819c7b070965198 diff --git a/libs/zopengl b/libs/zopengl index c9c293a9a..fe574e10b 160000 --- a/libs/zopengl +++ b/libs/zopengl @@ -1 +1 @@ -Subproject commit c9c293a9af388478bca0ad52007a72372ef71747 +Subproject commit fe574e10bc096983631d9f18b363e7a88247eef4 diff --git a/libs/zopenvr b/libs/zopenvr index f7c4696c9..9e1fb62ab 160000 --- a/libs/zopenvr +++ b/libs/zopenvr @@ -1 +1 @@ -Subproject commit f7c4696c9be9eaf75e9b878e11392e707194bded +Subproject commit 9e1fb62ab054bd914911870d255f4a458621f2ec diff --git a/libs/zphysics b/libs/zphysics index e5d77a1f2..0c60c1a0f 160000 --- a/libs/zphysics +++ b/libs/zphysics @@ -1 +1 @@ -Subproject commit e5d77a1f25c456786d8981eb287857cff0869c30 +Subproject commit 0c60c1a0f2a2393c3c226dabd0bd7315f155f3ef diff --git a/libs/zpix b/libs/zpix index b69194be5..e1f5f72d2 160000 --- a/libs/zpix +++ b/libs/zpix @@ -1 +1 @@ -Subproject commit b69194be5edc653cd250c81ff592d205787d0f8e +Subproject commit e1f5f72d2a64ac1c459a14be40df63bef07bb97e diff --git a/libs/zpool b/libs/zpool index 820e0e59d..99a4c74ec 160000 --- a/libs/zpool +++ b/libs/zpool @@ -1 +1 @@ -Subproject commit 820e0e59dc415d9784004464a6cf52223fbce126 +Subproject commit 99a4c74ec26b1f327209782565b4adaf1c1d610f diff --git a/libs/zsdl b/libs/zsdl index 9635e2f99..680fc9614 160000 --- a/libs/zsdl +++ b/libs/zsdl @@ -1 +1 @@ -Subproject commit 9635e2f996e86cd46ce939752b7a8c47f9883b9e +Subproject commit 680fc9614d01173168c8ecb5b2256b7f1de73c41 diff --git a/libs/zstbi b/libs/zstbi index 4fce0ee7c..094c4bba5 160000 --- a/libs/zstbi +++ b/libs/zstbi @@ -1 +1 @@ -Subproject commit 4fce0ee7ca94bd42536c136d9a369e647bc55b14 +Subproject commit 094c4bba5cdbec167d3f6aaa98cccccd5c99145f diff --git a/libs/ztracy b/libs/ztracy index 5af60074f..be3d003f2 160000 --- a/libs/ztracy +++ b/libs/ztracy @@ -1 +1 @@ -Subproject commit 5af60074f355ecda6114d08dcc8c931c3d163c94 +Subproject commit be3d003f29d59d72e68e493ab531374ab474a795 diff --git a/libs/zwindows b/libs/zwindows index e4217edae..a6330ff75 160000 --- a/libs/zwindows +++ b/libs/zwindows @@ -1 +1 @@ -Subproject commit e4217edae23ce580f00e7354b5823f50b50bf6d7 +Subproject commit a6330ff75e2f68c469bf205be93b9093e6d592b8 diff --git a/samples/monolith/src/monolith.zig b/samples/monolith/src/monolith.zig index 581a95c6c..22f254e8b 100644 --- a/samples/monolith/src/monolith.zig +++ b/samples/monolith/src/monolith.zig @@ -153,7 +153,7 @@ const ContactListener = extern struct { }; __v: *const zphy.ContactListener.VTable = &vtable, - bodies_touching_sensors: [9]SensorContacts = .{.{}} ** 9, + bodies_touching_sensors: [9]SensorContacts = .{SensorContacts{}} ** 9, const vtable = zphy.ContactListener.VTable{ .onContactValidate = _onContactValidate, @@ -248,8 +248,8 @@ const DebugRenderer = struct { usingnamespace zphy.DebugRenderer.Methods(@This()); __v: *const zphy.DebugRenderer.VTable(@This()) = &vtable, - primitives: [max_prims]Primitive = .{.{}} ** max_prims, - vertices: [max_verts]DebugVertex = .{.{}} ** max_verts, + primitives: [max_prims]Primitive = .{Primitive{}} ** max_prims, + vertices: [max_verts]DebugVertex = .{DebugVertex{}} ** max_verts, indices: [max_indcs]u16 = .{std.math.maxInt(u16)} ** max_indcs, heads: struct { prim: usize = 0, diff --git a/samples/sdl2_demo/build.zig b/samples/sdl2_demo/build.zig index 217f77fe7..11c9aadf1 100644 --- a/samples/sdl2_demo/build.zig +++ b/samples/sdl2_demo/build.zig @@ -57,7 +57,10 @@ pub fn buildWeb(b: *std.Build, options: anytype) *std.Build.Step { wasm.root_module.addImport("zemscripten", b.dependency("zemscripten", .{}).module("root")); - const emcc_flags = zemscripten.emccDefaultFlags(b.allocator, options.optimize); + const emcc_flags = zemscripten.emccDefaultFlags(b.allocator, .{ + .optimize = options.optimize, + .fsanitize = true, + }); var emcc_settings = zemscripten.emccDefaultSettings(b.allocator, .{ .optimize = options.optimize, From 155f95d55725933033b1d12cdb1f77ed90116af9 Mon Sep 17 00:00:00 2001 From: Chris Heyes <22148308+hazeycode@users.noreply.github.com> Date: Sat, 19 Apr 2025 16:56:28 +0100 Subject: [PATCH 2/6] Update libs --- build.zig.zon | 74 +++++++++++++++++++++++++-------------------------- libs/zaudio | 2 +- libs/zbullet | 2 +- libs/zglfw | 2 +- libs/zgui | 2 +- libs/zopenvr | 2 +- libs/zwindows | 2 +- 7 files changed, 43 insertions(+), 43 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index b5713ef8b..5a5612ab1 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -14,27 +14,27 @@ }, .dependencies = .{ .system_sdk = .{ - .url = "https://github.com/zig-gamedev/system_sdk/archive/c0dbf11cdc17da5904ea8a17eadc54dee26567ec.tar.gz", + .url = "git+https://github.com/zig-gamedev/system_sdk#c0dbf11cdc17da5904ea8a17eadc54dee26567ec", .hash = "system_sdk-0.3.0-dev-alwUNnYaaAJAtIdE2fg4NQfDqEKs7QCXy_qYukAOBfmF", }, .zaudio = .{ - .url = "https://github.com/zig-gamedev/zaudio/archive/fda144641276dd54ddabe2b77f5807fff7eda036.tar.gz", - .hash = "zaudio-0.11.0-dev-_M-91iBkPwDaOhCWkRhekq9IxJ_hM70TWQRru1vCitlC", + .url = "git+https://github.com/zig-gamedev/zaudio#b03ad083bcd1594c099f5841f62c2dccea634f86", + .hash = "zaudio-0.11.0-dev-_M-91jdkPwCWTlVfjKjXZWbHdXjKmYDcbCn99w3c9yOu", }, .zbullet = .{ - .url = "https://github.com/zig-gamedev/zbullet/archive/42019948cbc1576f21e160b5d63dd48e0794af04.tar.gz", - .hash = "zbullet-0.4.0-dev-7gkXj56UQAAWBrQKXS05ruNttSLBPv1w5IbIxkcZmgH0", + .url = "git+https://github.com/zig-gamedev/zbullet#9a686d95f5e05cd6bb4a1f34fd59ee8e7ee2cc9d", + .hash = "zbullet-0.4.0-dev-7gkXj7GUQAAkp5CZT20veGkT9f0f8Qeloh6ok4dv1bSs", }, .zflecs = .{ - .url = "https://github.com/zig-gamedev/zflecs/archive/34f6cc3f6d11fa13a44ae759e9ed6bec3a455fa4.tar.gz", + .url = "git+https://github.com/zig-gamedev/zflecs#34f6cc3f6d11fa13a44ae759e9ed6bec3a455fa4", .hash = "zflecs-0.2.0-dev-1PN3yuhMNQDj3J57z74E3AIGM8bmVg3FhAd6XZKb_A9W", }, .zemscripten = .{ - .url = "https://github.com/zig-gamedev/zemscripten/archive/cac24b72f87432ce607c02abcfad7822b702aad9.tar.gz", + .url = "git+https://github.com/zig-gamedev/zemscripten#cac24b72f87432ce607c02abcfad7822b702aad9", .hash = "zemscripten-0.2.0-dev-sRlDqBtLAADUk3IZprWI0srnchHAXRSQu1n4wZiRvXmr", }, .emsdk = .{ @@ -43,138 +43,138 @@ }, .zglfw = .{ - .url = "https://github.com/zig-gamedev/zglfw/archive/30b29eee8047852708e79aadf0425494e6d7c5b5.tar.gz", + .url = "git+https://github.com/zig-gamedev/zglfw#30b29eee8047852708e79aadf0425494e6d7c5b5", .hash = "zglfw-0.10.0-dev-zgVDNG2cIQAiAC_gLYmbML-NQklPW5B_AELV_fAQc2Jg", }, .zgpu = .{ - .url = "https://github.com/zig-gamedev/zgpu/archive/3ae4a71af16df3a7dfa95023bba1a1e6a0bfb80d.tar.gz", + .url = "git+https://github.com/zig-gamedev/zgpu#3ae4a71af16df3a7dfa95023bba1a1e6a0bfb80d", .hash = "zgpu-0.12.0-dev-nqFT5BCgCADqzg95ZvomJREp6oIl3NTubfyiUNHc18Pr", }, .dawn_x86_64_windows_gnu = .{ - .url = "https://github.com/michal-z/webgpu_dawn-x86_64-windows-gnu/archive/d3a68014e6b6b53fd330a0ccba99e4dcfffddae5.tar.gz", + .url = "git+https://github.com/michal-z/webgpu_dawn-x86_64-windows-gnu#d3a68014e6b6b53fd330a0ccba99e4dcfffddae5", .hash = "N-V-__8AAGsYnAT5RIzeAu881RveLghQ1EidqgVBVx10gVTo", .lazy = true, }, .dawn_x86_64_linux_gnu = .{ - .url = "https://github.com/michal-z/webgpu_dawn-x86_64-linux-gnu/archive/7d70db023bf254546024629cbec5ee6113e12a42.tar.gz", + .url = "git+https://github.com/michal-z/webgpu_dawn-x86_64-linux-gnu#7d70db023bf254546024629cbec5ee6113e12a42", .hash = "N-V-__8AAK7XUQNKNRnv1J6i189jtURJKjp3HTftoyD4Y4CB", .lazy = true, }, .dawn_aarch64_linux_gnu = .{ - .url = "https://github.com/michal-z/webgpu_dawn-aarch64-linux-gnu/archive/c1f55e740a62f6942ff046e709ecd509a005dbeb.tar.gz", + .url = "git+https://github.com/michal-z/webgpu_dawn-aarch64-linux-gnu#c1f55e740a62f6942ff046e709ecd509a005dbeb", .hash = "N-V-__8AAJ-wTwNc0T9oSflO92iO6IxrdMeRil37UU-KQD_M", .lazy = true, }, .dawn_aarch64_macos = .{ - .url = "https://github.com/michal-z/webgpu_dawn-aarch64-macos/archive/d2360cdfff0cf4a780cb77aa47c57aca03cc6dfe.tar.gz", + .url = "git+https://github.com/michal-z/webgpu_dawn-aarch64-macos#d2360cdfff0cf4a780cb77aa47c57aca03cc6dfe", .hash = "N-V-__8AALVIRAIf5nfpx8-4mEo2RGsynVryPQPcHk95qFM5", .lazy = true, }, .dawn_x86_64_macos = .{ - .url = "https://github.com/michal-z/webgpu_dawn-x86_64-macos/archive/901716b10b31ce3e0d3fe479326b41e91d59c661.tar.gz", + .url = "git+https://github.com/michal-z/webgpu_dawn-x86_64-macos#901716b10b31ce3e0d3fe479326b41e91d59c661", .hash = "N-V-__8AAIz1QAKx8C8vft2YoHjGTjEAkH2QMR2UiAo8xZJ-", .lazy = true, }, .zgui = .{ - .url = "https://github.com/zig-gamedev/zgui/archive/0f2e9c7b50b2b5f36243ac8028f38adfe289303b.tar.gz", - .hash = "zgui-0.6.0-dev--L6sZJWZaAAJXsX2Alyo89zyb0El4LV37XxEhPz1H9ql", + .url = "git+https://github.com/zig-gamedev/zgui#7ac0630658ee2d285893603aca3945461d181beb", + .hash = "zgui-0.6.0-dev--L6sZG-baABjJ9Gcf2XU_VpTLmn4nNwq7alHKDRT_BW9", }, .zjobs = .{ - .url = "https://github.com/zig-gamedev/zjobs/archive/dfdb734e8084f7dc5010a4ded30bc8e04b6d4393.tar.gz", + .url = "git+https://github.com/zig-gamedev/zjobs#dfdb734e8084f7dc5010a4ded30bc8e04b6d4393", .hash = "zjobs-0.3.0-dev-59uaZmTQAABLe7t30aW2PD5P3VxjWbAoL1XXnhgs2Ymd", }, .zmath = .{ - .url = "https://github.com/zig-gamedev/zmath/archive/ccf7297ef6c01e21b2d51ad81b5b6ce929e86a00.tar.gz", + .url = "git+https://github.com/zig-gamedev/zmath#ccf7297ef6c01e21b2d51ad81b5b6ce929e86a00", .hash = "zmath-0.11.0-dev-wjwivZY1AwDO7yxNmZ5HWoU03f9mFBet8LN9-oYc3i29", }, .zmesh = .{ - .url = "https://github.com/zig-gamedev/zmesh/archive/f8f528128704ae879a16ddb0a3470c5e0a144a20.tar.gz", + .url = "git+https://github.com/zig-gamedev/zmesh#f8f528128704ae879a16ddb0a3470c5e0a144a20", .hash = "zmesh-0.11.0-dev-oO3A5gx7CgCBPHsGeuNzwzXAyEvs57u39AD5EUZTScli", }, .znoise = .{ - .url = "https://github.com/zig-gamedev/znoise/archive/96f9458c2da975a8bf1cdf95e819c7b070965198.tar.gz", + .url = "git+https://github.com/zig-gamedev/znoise#96f9458c2da975a8bf1cdf95e819c7b070965198", .hash = "znoise-0.3.0-dev-gK1op-mjAQAvffA1EcRD0GekpVpgN7Km5rquofgZ0bq7", }, .zopengl = .{ - .url = "https://github.com/zig-gamedev/zopengl/archive/fe574e10bc096983631d9f18b363e7a88247eef4.tar.gz", + .url = "git+https://github.com/zig-gamedev/zopengl#fe574e10bc096983631d9f18b363e7a88247eef4", .hash = "zopengl-0.6.0-dev-5-tnz0tUCAAecmfZHeJBAGiwU9ofrlLHJEGt2CXwnmF9", }, .zopenvr = .{ - .url = "https://github.com/zig-gamedev/zopenvr/archive/9e1fb62ab054bd914911870d255f4a458621f2ec.tar.gz", - .hash = "zopenvr-0.1.0-dev-FvPTqnNtlwD_Ju7h6tdRiNZuxJsd4EApZyAiQIWPudOe", + .url = "https://github.com/zig-gamedev/zopenvr/archive/89043db24aa8db9f46f125659952902cba636b57.tar.gz", + .hash = "zopenvr-0.1.0-dev-FvPTqpptlwCcTA7ZRnkHkFV7YSvv-ukvKyNVLWDEUynr", }, .zphysics = .{ - .url = "https://github.com/zig-gamedev/zphysics/archive/0c60c1a0f2a2393c3c226dabd0bd7315f155f3ef.tar.gz", + .url = "git+https://github.com/zig-gamedev/zphysics#0c60c1a0f2a2393c3c226dabd0bd7315f155f3ef", .hash = "zphysics-0.2.0-dev-nZDEAHKiPwDIup82Bua4nZKs18EEpgWCLuEjWNAlmuau", }, .zpix = .{ - .url = "https://github.com/zig-gamedev/zpix/archive/e1f5f72d2a64ac1c459a14be40df63bef07bb97e.tar.gz", + .url = "git+https://github.com/zig-gamedev/zpix#e1f5f72d2a64ac1c459a14be40df63bef07bb97e", .hash = "zpix-0.11.0-dev-T9TIVqU4AACjM3XmezXEkVGWHwvTAnz5VLtHh7kn6u-l", }, .zpool = .{ - .url = "https://github.com/zig-gamedev/zpool/archive/99a4c74ec26b1f327209782565b4adaf1c1d610f.tar.gz", + .url = "git+https://github.com/zig-gamedev/zpool#99a4c74ec26b1f327209782565b4adaf1c1d610f", .hash = "zpool-0.11.0-dev-bG692eY7AQDLTkjTbgnbg_-qgjmxUCg8hNpN1kZRrIlW", }, .zsdl = .{ - .url = "https://github.com/zig-gamedev/zsdl/archive/680fc9614d01173168c8ecb5b2256b7f1de73c41.tar.gz", + .url = "git+https://github.com/zig-gamedev/zsdl#680fc9614d01173168c8ecb5b2256b7f1de73c41", .hash = "zsdl-0.4.0-dev-rFpjE6pXWQC9EXxkkH2zO6MUh9JCDgteTDAIPt-mSQm2", }, .sdl2_prebuilt_macos = .{ - .url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/7bc0fa9101342c019eed252d43f490660dfa411b.tar.gz", + .url = "git+https://github.com/zig-gamedev/sdl2-prebuilt-macos#7bc0fa9101342c019eed252d43f490660dfa411b", .hash = "sdl2_prebuilt_macos-0.2.0-dev-DaOxP5Eq2QBpNBkpXn2qjyI6_s0gINcbdUMpqI1KshaH", .lazy = true, }, .sdl2_prebuilt_x86_64_windows_gnu = .{ - .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-windows-gnu/archive/8de1512cedfa1fb3ab17ecf295af8cabd7f231f1.tar.gz", + .url = "git+https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-windows-gnu#8de1512cedfa1fb3ab17ecf295af8cabd7f231f1", .hash = "sdl2_prebuilt_x86_64_windows_gnu-0.2.0-dev-HPeIhv2VaQBOWF4Fjtr7Vb9bA852pUtwUuQKdvNvkA98", .lazy = true, }, .sdl2_prebuilt_x86_64_linux_gnu = .{ - .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu/archive/ce2b511c052c3fdc35c286ade8235d2830a50992.tar.gz", + .url = "git+https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu#ce2b511c052c3fdc35c286ade8235d2830a50992", .hash = "sdl2_prebuilt_x86_64_linux_gnu-0.2.0-dev-NHZ_xrzSHwDJDoAxuVi000OEq428znS1fDRRJE8PlXHu", .lazy = true, }, .sdl3_prebuilt_macos = .{ - .url = "https://github.com/zig-gamedev/sdl3-prebuilt-macos/archive/e89207914a0f0163c0fb543da4f530f645ef5969.tar.gz", + .url = "git+https://github.com/zig-gamedev/sdl3-prebuilt-macos#e89207914a0f0163c0fb543da4f530f645ef5969", .hash = "sdl3_prebuilt_macos-0.2.0-dev-A1UBS1aUdwCWfplgS5fNorbstvDxSi3LOHnSPzjmWZhl", .lazy = true, }, .sdl3_prebuilt_x86_64_windows_gnu = .{ - .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-windows-gnu/archive/8f5dc1a9c9450ac578286e90d4667fc3aa1b23e2.tar.gz", + .url = "git+https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-windows-gnu#8f5dc1a9c9450ac578286e90d4667fc3aa1b23e2", .hash = "sdl3_prebuilt_x86_64_windows_gnu-0.2.0-dev-AAAAAI_mJADlsRyMxRFKobQJEbfs1p-37A9mmYEj7DW-", .lazy = true, }, .sdl3_prebuilt_x86_64_linux_gnu = .{ - .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-linux-gnu/archive/b19959ed3aa87d8393640d7ba3aec142ae85487b.tar.gz", + .url = "git+https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-linux-gnu#b19959ed3aa87d8393640d7ba3aec142ae85487b", .hash = "sdl3_prebuilt_x86_64_linux_gnu-0.2.0-dev-qpwWsmyVNwBHzXjgC9Z-U02SXoUVMMxvCnI7XKocDcDn", .lazy = true, }, .zstbi = .{ - .url = "https://github.com/zig-gamedev/zstbi/archive/094c4bba5cdbec167d3f6aaa98cccccd5c99145f.tar.gz", + .url = "git+https://github.com/zig-gamedev/zstbi#094c4bba5cdbec167d3f6aaa98cccccd5c99145f", .hash = "zstbi-0.11.0-dev-L0Ea_-eVBwCl8RYA98PhLDw3Fhw5k7FJOHSMDKWDOvqx", }, .ztracy = .{ - .url = "https://github.com/zig-gamedev/ztracy/archive/be3d003f29d59d72e68e493ab531374ab474a795.tar.gz", + .url = "git+https://github.com/zig-gamedev/ztracy#be3d003f29d59d72e68e493ab531374ab474a795", .hash = "ztracy-0.14.0-dev-zHJSq1oQFwCAq2LhbqsBUmZAipMzsD8UfKL5Etc_OJMb", }, .zwindows = .{ - .url = "https://github.com/zig-gamedev/zwindows/archive/a6330ff75e2f68c469bf205be93b9093e6d592b8.tar.gz", - .hash = "zwindows-0.2.0-dev-xMZ1u_NkyQYcX_gtNQIQuecZ3IAWCUfTPaouYXUs3_Rw", + .url = "https://github.com/zig-gamedev/zwindows/archive/c29e0fec072c282a8c6234c5837db071af42a11f.tar.gz", + .hash = "zwindows-0.2.0-dev-xMZ1uyZpyQZsF6AeAjn_SJM69htI2MKkskHJ-83XzISl", }, }, } diff --git a/libs/zaudio b/libs/zaudio index fda144641..029a91b00 160000 --- a/libs/zaudio +++ b/libs/zaudio @@ -1 +1 @@ -Subproject commit fda144641276dd54ddabe2b77f5807fff7eda036 +Subproject commit 029a91b002a576befdef70d81859e90c5ab98583 diff --git a/libs/zbullet b/libs/zbullet index 42019948c..9a686d95f 160000 --- a/libs/zbullet +++ b/libs/zbullet @@ -1 +1 @@ -Subproject commit 42019948cbc1576f21e160b5d63dd48e0794af04 +Subproject commit 9a686d95f5e05cd6bb4a1f34fd59ee8e7ee2cc9d diff --git a/libs/zglfw b/libs/zglfw index 30b29eee8..fa12b5754 160000 --- a/libs/zglfw +++ b/libs/zglfw @@ -1 +1 @@ -Subproject commit 30b29eee8047852708e79aadf0425494e6d7c5b5 +Subproject commit fa12b57541976561358c850337af8d08647879d6 diff --git a/libs/zgui b/libs/zgui index 0f2e9c7b5..7ac063065 160000 --- a/libs/zgui +++ b/libs/zgui @@ -1 +1 @@ -Subproject commit 0f2e9c7b50b2b5f36243ac8028f38adfe289303b +Subproject commit 7ac0630658ee2d285893603aca3945461d181beb diff --git a/libs/zopenvr b/libs/zopenvr index 9e1fb62ab..89043db24 160000 --- a/libs/zopenvr +++ b/libs/zopenvr @@ -1 +1 @@ -Subproject commit 9e1fb62ab054bd914911870d255f4a458621f2ec +Subproject commit 89043db24aa8db9f46f125659952902cba636b57 diff --git a/libs/zwindows b/libs/zwindows index a6330ff75..c29e0fec0 160000 --- a/libs/zwindows +++ b/libs/zwindows @@ -1 +1 @@ -Subproject commit a6330ff75e2f68c469bf205be93b9093e6d592b8 +Subproject commit c29e0fec072c282a8c6234c5837db071af42a11f From 3973c40c7e5491a7fa57abe8e6a3195bc57f608f Mon Sep 17 00:00:00 2001 From: Chris Heyes <22148308+hazeycode@users.noreply.github.com> Date: Sat, 19 Apr 2025 18:18:40 +0100 Subject: [PATCH 3/6] Zig 0.14.0 fixups --- samples/common/src/GuiRenderer.zig | 4 ++-- samples/gamepad_wgpu/src/gamepad_wgpu.zig | 2 +- samples/openvr_test/src/ui.zig | 6 +++--- samples/simple_openvr/src/simple_openvr.zig | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/common/src/GuiRenderer.zig b/samples/common/src/GuiRenderer.zig index 0906b8f43..9ffbd4001 100644 --- a/samples/common/src/GuiRenderer.zig +++ b/samples/common/src/GuiRenderer.zig @@ -96,8 +96,8 @@ pub fn init( .font = font, .font_srv = font_srv, .pipeline = pipeline, - .vb = .{.{}} ** zd3d12.GraphicsContext.max_num_buffered_frames, - .ib = .{.{}} ** zd3d12.GraphicsContext.max_num_buffered_frames, + .vb = .{zd3d12.ResourceHandle{}} ** zd3d12.GraphicsContext.max_num_buffered_frames, + .ib = .{zd3d12.ResourceHandle{}} ** zd3d12.GraphicsContext.max_num_buffered_frames, .vb_cpu_addr = [_][]align(8) u8{&.{}} ** zd3d12.GraphicsContext.max_num_buffered_frames, .ib_cpu_addr = [_][]align(8) u8{&.{}} ** zd3d12.GraphicsContext.max_num_buffered_frames, }; diff --git a/samples/gamepad_wgpu/src/gamepad_wgpu.zig b/samples/gamepad_wgpu/src/gamepad_wgpu.zig index 508d297f9..f721d2aec 100644 --- a/samples/gamepad_wgpu/src/gamepad_wgpu.zig +++ b/samples/gamepad_wgpu/src/gamepad_wgpu.zig @@ -137,7 +137,7 @@ fn update(allocator: std.mem.Allocator, demo: *DemoState) !void { _ = zgui.beginTabBar("Joystick picker", .{}); defer zgui.endTabBar(); - for (0 .. zglfw.Joystick.maximum_supported) |jid| { + for (0..zglfw.Joystick.maximum_supported) |jid| { const joystick: zglfw.Joystick = @enumFromInt(jid); const tab_title = try std.fmt.allocPrintZ(arena.allocator(), "Joystick {}", .{jid + 1}); diff --git a/samples/openvr_test/src/ui.zig b/samples/openvr_test/src/ui.zig index 2c103697f..8b8edc736 100644 --- a/samples/openvr_test/src/ui.zig +++ b/samples/openvr_test/src/ui.zig @@ -952,7 +952,7 @@ pub fn readOnlyHexdump(allocator: std.mem.Allocator, bytes: []const u8) !void { fn renderResult(allocator: ?std.mem.Allocator, comptime Return: type, result: Return) !void { switch (@typeInfo(Return)) { .pointer => |pointer| { - if (pointer.size == .Slice and pointer.child != u8) { + if (pointer.size == .slice and pointer.child != u8) { if (result.len > 0) { for (result, 0..) |v, i| { zgui.pushIntId(@intCast(i)); @@ -1361,8 +1361,8 @@ fn fillArgs(comptime arg_ptrs_info: std.builtin.Type.Struct, arg_ptrs: anytype, const arg_ptr = @field(arg_ptrs, field.name); args[i + offset] = switch (@typeInfo(field.type)) { .pointer => |pointer| switch (pointer.size) { - .Slice => arg_ptr, - .One => switch (@typeInfo(pointer.child)) { + .slice => arg_ptr, + .one => switch (@typeInfo(pointer.child)) { .array => std.mem.sliceTo(arg_ptr, 0), else => switch (field.type) { *std.ArrayList(OpenVR.AppOverrideKeys), diff --git a/samples/simple_openvr/src/simple_openvr.zig b/samples/simple_openvr/src/simple_openvr.zig index b9622d8de..c4b7a132e 100644 --- a/samples/simple_openvr/src/simple_openvr.zig +++ b/samples/simple_openvr/src/simple_openvr.zig @@ -1118,8 +1118,8 @@ pub fn main() !void { for (eye_descs) |eye_desc| { const dx12_texture = OpenVR.D3D12TextureData{ - .resource = gctx.lookupResource(eye_desc.texture).?, - .command_queue = gctx.cmdqueue, + .resource = @ptrCast(gctx.lookupResource(eye_desc.texture).?), + .command_queue = @ptrCast(gctx.cmdqueue), .node_mask = 0, }; app.compositor.submit(eye_desc.eye, &.{ From 009bf74c1bbc02165c3b6a02aa1064ea67d2be3e Mon Sep 17 00:00:00 2001 From: Chris Heyes <22148308+hazeycode@users.noreply.github.com> Date: Sat, 19 Apr 2025 01:56:05 +0100 Subject: [PATCH 4/6] Update README --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e10b22465..fc61a11be 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,22 @@ The original repo spawned in July 2021 by [Michal Ziulek](https://github.com/michal-z). This is the main development repo for the [zig-gamedev libraries](https://github.com/zig-gamedev#libraries) and [sample applications](#sample-applications-native-wgpu). -Zig is still in development. Our main branch aims to track zig nightly-ish. See [.zigversion](./.zigversion) for the last known compatible Zig version for any revision. - Libraries now live in their own repositories and are consumed using Zig's package manager. Git submodules are also included in this repo for developer convenience but are not required to build. Users that wish to use the submodules instead of remote packages can replace build.zig.zon with dev.build.zig.zon. -### Build and run the [Samples](#sample-applications-native-wgpu) +## Getting Started -To get started on Windows/Linux/macOS try out [physically based rendering (wgpu)](https://github.com/zig-gamedev/zig-gamedev/tree/main/samples/physically_based_rendering_wgpu) sample: -``` +- Download and install [Git LFS](https://git-lfs.com) +- Download and install [anyzig](https://github.com/marler8997/anyzig) (recommended) or get a Zig compiler by some other means. +- Clone this repo `git clone git@github.com:zig-gamedev/zig-gamedev.git && cd zig-gamedev` +- (Optional) Get the submodules and use them instead of the package manager `git submodule update --init && mv build.zig.zon backup.build.zig.zon && mv dev.build.zig.zon build.zig.zon` + +Build and run a sample app: +```sh zig build physically_based_rendering_wgpu-run ``` -To get a list of all available build steps: -``` +Get a list of all available build steps: +```sh zig build -l ``` From 4ce4b63605cec197eeea1bc9551a2506e6e6022f Mon Sep 17 00:00:00 2001 From: Chris Heyes <22148308+hazeycode@users.noreply.github.com> Date: Tue, 22 Apr 2025 23:06:26 +0100 Subject: [PATCH 5/6] build.zig improvements --- build.zig | 318 +++++++++--------- samples/audio_experiments/build.zig | 4 +- samples/audio_experiments_wgpu/build.zig | 4 +- samples/audio_playback_test/build.zig | 4 +- samples/bindless/build.zig | 4 +- samples/bullet_physics_test_wgpu/build.zig | 4 +- samples/directml_convolution_test/build.zig | 5 +- samples/frame_pacing_wgpu/build.zig | 4 +- samples/gamepad_wgpu/build.zig | 4 +- samples/gui_test_wgpu/build.zig | 4 +- samples/instanced_pills_wgpu/build.zig | 4 +- samples/layers_wgpu/build.zig | 4 +- samples/mesh_shader_test/build.zig | 4 +- samples/minimal_d3d12/build.zig | 8 +- samples/minimal_glfw_d3d12/build.zig | 4 +- samples/minimal_glfw_gl/build.zig | 2 +- samples/minimal_sdl_gl/build.zig | 2 +- samples/minimal_zgpu_zgui/build.zig | 4 +- samples/minimal_zgui_glfw_d3d12/build.zig | 4 +- samples/minimal_zgui_glfw_gl/build.zig | 4 +- samples/minimal_zgui_win32_d3d12/build.zig | 4 +- samples/monolith/build.zig | 4 +- samples/openvr_test/build.zig | 4 +- .../physically_based_rendering_wgpu/build.zig | 4 +- samples/physics_test_wgpu/build.zig | 4 +- samples/procedural_mesh_wgpu/build.zig | 4 +- samples/rasterization/build.zig | 4 +- samples/sdl2_demo/build.zig | 4 +- samples/simple_openvr/build.zig | 4 +- samples/textured_quad/build.zig | 4 +- samples/textured_quad_wgpu/build.zig | 4 +- samples/triangle/build.zig | 4 +- samples/triangle_wgpu/build.zig | 4 +- samples/vector_graphics_test/build.zig | 2 +- .../zphysics_instanced_cubes_d3d12/build.zig | 4 +- 35 files changed, 229 insertions(+), 224 deletions(-) diff --git a/build.zig b/build.zig index 79bbcca8d..65646cf8c 100644 --- a/build.zig +++ b/build.zig @@ -1,16 +1,7 @@ const builtin = @import("builtin"); const std = @import("std"); -pub const min_zig_version = std.SemanticVersion{ - .major = 0, - .minor = 14, - .patch = 0, - .pre = "dev.1911", -}; - pub fn build(b: *std.Build) void { - ensureZigVersion() catch return; - if (checkGitLfsContent() == false) { ensureGit(b.allocator) catch return; ensureGitLfs(b.allocator, "install") catch return; @@ -64,21 +55,31 @@ pub fn build(b: *std.Build) void { ) orelse if (zpix_enable) @panic("PIX path is required when enabled") else "", }; + if (target.result.os.tag == .windows) { + if (builtin.target.os.tag == .windows or builtin.target.os.tag == .linux) { + const activate_zwindows = @import("zwindows").activateSdk(b, b.dependency("zwindows", .{})); + b.default_step.dependOn(activate_zwindows); + + samples.build(b, options, activate_zwindows, samples.windows_linux_cross); + + if (builtin.target.os.tag == .windows) { + // TODO: Try to upgrade these to windows_linux_cross + samples.build(b, options, activate_zwindows, samples.windows_only); + } + } else @panic("Unsupported host OS for Windows target"); + } + if (target.result.os.tag == .emscripten) { - buildAndInstallSamplesWeb(b, .{ + const activate_emsdk = @import("zemscripten").activateEmsdkStep(b); + b.default_step.dependOn(activate_emsdk); + + const web_options = .{ .optimize = optimize, .target = target, - }); + }; + samples.buildWeb(b, web_options, activate_emsdk); } else { - buildAndInstallSamples(b, options, samples_cross_platform); - if (target.result.os.tag == .windows) { - if (builtin.os.tag == .windows or builtin.os.tag == .linux) { - buildAndInstallSamples(b, options, samples_windows_linux); - if (builtin.os.tag == .windows) { - buildAndInstallSamples(b, options, samples_windows); - } - } - } + samples.build(b, options, null, samples.crossplatform); } // Install prebuilt SDL2 libs in bin output dir @@ -103,160 +104,159 @@ pub fn build(b: *std.Build) void { } } -pub const samples_windows = struct { - pub const audio_experiments = @import("samples/audio_experiments/build.zig"); - pub const audio_playback_test = @import("samples/audio_playback_test/build.zig"); - pub const directml_convolution_test = @import("samples/directml_convolution_test/build.zig"); - pub const vector_graphics_test = @import("samples/vector_graphics_test/build.zig"); -}; - -pub const samples_windows_linux = struct { - pub const bindless = @import("samples/bindless/build.zig"); - pub const mesh_shader_test = @import("samples/mesh_shader_test/build.zig"); - pub const minimal_d3d12 = @import("samples/minimal_d3d12/build.zig"); - pub const minimal_glfw_d3d12 = @import("samples/minimal_glfw_d3d12/build.zig"); - pub const minimal_zgui_glfw_d3d12 = @import("samples/minimal_zgui_glfw_d3d12/build.zig"); - pub const minimal_zgui_win32_d3d12 = @import("samples/minimal_zgui_win32_d3d12/build.zig"); - pub const openvr_test = @import("samples/openvr_test/build.zig"); - pub const simple_openvr = @import("samples/simple_openvr/build.zig"); - pub const rasterization = @import("samples/rasterization/build.zig"); - // TODO: get simple raytracer working again - //pub const simple_raytracer = @import("samples/simple_raytracer/build.zig"); - pub const textured_quad = @import("samples/textured_quad/build.zig"); - pub const triangle = @import("samples/triangle/build.zig"); - pub const zphysics_instanced_cubes_d3d12 = @import("samples/zphysics_instanced_cubes_d3d12/build.zig"); -}; - -pub const samples_cross_platform = struct { - pub const sdl2_demo = @import("samples/sdl2_demo/build.zig"); - - // OpenGL samples - pub const minimal_glfw_gl = @import("samples/minimal_glfw_gl/build.zig"); - pub const minimal_sdl_gl = @import("samples/minimal_sdl_gl/build.zig"); - pub const minimal_zgui_glfw_gl = @import("samples/minimal_zgui_glfw_gl/build.zig"); - - // WebGPU samples - pub const audio_experiments_wgpu = @import("samples/audio_experiments_wgpu/build.zig"); - pub const bullet_physics_test_wgpu = @import("samples/bullet_physics_test_wgpu/build.zig"); - pub const frame_pacing_wgpu = @import("samples/frame_pacing_wgpu/build.zig"); - pub const gamepad_wgpu = @import("samples/gamepad_wgpu/build.zig"); - pub const gui_test_wgpu = @import("samples/gui_test_wgpu/build.zig"); - pub const instanced_pills_wgpu = @import("samples/instanced_pills_wgpu/build.zig"); - pub const layers_wgpu = @import("samples/layers_wgpu/build.zig"); - pub const minimal_zgpu_zgui = @import("samples/minimal_zgpu_zgui/build.zig"); - pub const monolith = @import("samples/monolith/build.zig"); - pub const physically_based_rendering_wgpu = @import("samples/physically_based_rendering_wgpu/build.zig"); - pub const physics_test_wgpu = @import("samples/physics_test_wgpu/build.zig"); - pub const procedural_mesh_wgpu = @import("samples/procedural_mesh_wgpu/build.zig"); - pub const textured_quad_wgpu = @import("samples/textured_quad_wgpu/build.zig"); - pub const triangle_wgpu = @import("samples/triangle_wgpu/build.zig"); -}; +pub const samples = struct { + /// Windows sample apps that can only be build using Windows. Try to move these to `windows_linux_cross`... + pub const windows_only = struct { + pub const audio_experiments = @import("samples/audio_experiments/build.zig"); + pub const audio_playback_test = @import("samples/audio_playback_test/build.zig"); + pub const directml_convolution_test = @import("samples/directml_convolution_test/build.zig"); + pub const vector_graphics_test = @import("samples/vector_graphics_test/build.zig"); + }; -pub const samples_web = struct { - pub const sdl2_demo = samples_cross_platform.sdl2_demo; - - // TODO: WebGL samples - // pub const minimal_glfw_gl = samples_cross_platform.minimal_glfw_gl; - // pub const minimal_sdl_gl = samples_cross_platform.minimal_sdl_gl; - // pub const minimal_zgui_glfw_gl = samples_cross_platform.minimal_zgui_glfw_gl; - - // TODO: WebGPU samples - // pub const audio_experiments_wgpu = samples_cross_platform.audio_experiments_wgpu; - // pub const bullet_physics_test_wgpu = samples_cross_platform.bullet_physics_test_wgpu; - // pub const gamepad_wgpu = samples_cross_platform.gamepad_wgpu; - // pub const gui_test_wgpu = samples_cross_platform.gui_test_wgpu; - // pub const instanced_pills_wgpu = samples_cross_platform.instanced_pills_wgpu; - // pub const layers_wgpu = samples_cross_platform.layers_wgpu; - // pub const minimal_zgpu_zgui = samples_cross_platform.minimal_zgpu_zgui; - // pub const monolith = samples_cross_platform.monolith; - // pub const physically_based_rendering_wgpu = samples_cross_platform.physically_based_rendering_wgpu; - // pub const physics_test_wgpu = samples_cross_platform.physics_test_wgpu; - // pub const procedural_mesh_wgpu = samples_cross_platform.procedural_mesh_wgpu; - // pub const textured_quad_wgpu = samples_cross_platform.textured_quad_wgpu; - // pub const triangle_wgpu = samples_cross_platform.triangle_wgpu; -}; + /// Windows sample apps that can be cross-compiled from Linux. + pub const windows_linux_cross = struct { + pub const bindless = @import("samples/bindless/build.zig"); + pub const mesh_shader_test = @import("samples/mesh_shader_test/build.zig"); + pub const minimal_d3d12 = @import("samples/minimal_d3d12/build.zig"); + pub const minimal_glfw_d3d12 = @import("samples/minimal_glfw_d3d12/build.zig"); + pub const minimal_zgui_glfw_d3d12 = @import("samples/minimal_zgui_glfw_d3d12/build.zig"); + pub const minimal_zgui_win32_d3d12 = @import("samples/minimal_zgui_win32_d3d12/build.zig"); + pub const openvr_test = @import("samples/openvr_test/build.zig"); + pub const simple_openvr = @import("samples/simple_openvr/build.zig"); + pub const rasterization = @import("samples/rasterization/build.zig"); + // TODO: get simple raytracer working again + //pub const simple_raytracer = @import("samples/simple_raytracer/build.zig"); + pub const textured_quad = @import("samples/textured_quad/build.zig"); + pub const triangle = @import("samples/triangle/build.zig"); + pub const zphysics_instanced_cubes_d3d12 = @import("samples/zphysics_instanced_cubes_d3d12/build.zig"); + }; -fn buildAndInstallSamples(b: *std.Build, options: anytype, comptime samples: anytype) void { - inline for (comptime std.meta.declarations(samples)) |d| { - const exe = @field(samples, d.name).build(b, options); + /// Sample apps that can build and run on Windows, macOS and Linux. Cross-compilation should also work. + pub const crossplatform = struct { + pub const sdl2_demo = @import("samples/sdl2_demo/build.zig"); + + // OpenGL samples + pub const minimal_glfw_gl = @import("samples/minimal_glfw_gl/build.zig"); + pub const minimal_sdl_gl = @import("samples/minimal_sdl_gl/build.zig"); + pub const minimal_zgui_glfw_gl = @import("samples/minimal_zgui_glfw_gl/build.zig"); + + // WebGPU samples + pub const audio_experiments_wgpu = @import("samples/audio_experiments_wgpu/build.zig"); + pub const bullet_physics_test_wgpu = @import("samples/bullet_physics_test_wgpu/build.zig"); + pub const frame_pacing_wgpu = @import("samples/frame_pacing_wgpu/build.zig"); + pub const gamepad_wgpu = @import("samples/gamepad_wgpu/build.zig"); + pub const gui_test_wgpu = @import("samples/gui_test_wgpu/build.zig"); + pub const instanced_pills_wgpu = @import("samples/instanced_pills_wgpu/build.zig"); + pub const layers_wgpu = @import("samples/layers_wgpu/build.zig"); + pub const minimal_zgpu_zgui = @import("samples/minimal_zgpu_zgui/build.zig"); + pub const monolith = @import("samples/monolith/build.zig"); + pub const physically_based_rendering_wgpu = @import("samples/physically_based_rendering_wgpu/build.zig"); + pub const physics_test_wgpu = @import("samples/physics_test_wgpu/build.zig"); + pub const procedural_mesh_wgpu = @import("samples/procedural_mesh_wgpu/build.zig"); + pub const textured_quad_wgpu = @import("samples/textured_quad_wgpu/build.zig"); + pub const triangle_wgpu = @import("samples/triangle_wgpu/build.zig"); + }; - // TODO: Problems with LTO on Windows. - if (exe.rootModuleTarget().os.tag == .windows) { - exe.want_lto = false; - } + /// Sample apps that can be built as web applications using zemscripten. + pub const web = struct { + pub const sdl2_demo = samples.crossplatform.sdl2_demo; + + // TODO: WebGL samples + // pub const minimal_glfw_gl = samples.crossplatform.minimal_glfw_gl; + // pub const minimal_sdl_gl = samples.crossplatform.minimal_sdl_gl; + // pub const minimal_zgui_glfw_gl = samples.crossplatform.minimal_zgui_glfw_gl; + + // TODO: WebGPU samples + // pub const audio_experiments_wgpu = samples.crossplatform.audio_experiments_wgpu; + // pub const bullet_physics_test_wgpu = samples.crossplatform.bullet_physics_test_wgpu; + // pub const gamepad_wgpu = samples.crossplatform.gamepad_wgpu; + // pub const gui_test_wgpu = samples.crossplatform.gui_test_wgpu; + // pub const instanced_pills_wgpu = samples.crossplatform.instanced_pills_wgpu; + // pub const layers_wgpu = samples.crossplatform.layers_wgpu; + // pub const minimal_zgpu_zgui = samples.crossplatform.minimal_zgpu_zgui; + // pub const monolith = samples.crossplatform.monolith; + // pub const physically_based_rendering_wgpu = samples.crossplatform.physically_based_rendering_wgpu; + // pub const physics_test_wgpu = samples.crossplatform.physics_test_wgpu; + // pub const procedural_mesh_wgpu = samples.crossplatform.procedural_mesh_wgpu; + // pub const textured_quad_wgpu = samples.crossplatform.textured_quad_wgpu; + // pub const triangle_wgpu = samples.crossplatform.triangle_wgpu; + }; - if (exe.root_module.optimize != .Debug) { - exe.root_module.strip = true; + fn build( + b: *std.Build, + options: anytype, + maybe_depend_step: ?*std.Build.Step, + comptime apps: anytype, + ) void { + inline for (comptime std.meta.declarations(apps)) |d| { + const exe = buildExe(b, options, @field(apps, d.name)); + if (maybe_depend_step) |step| { + exe.step.dependOn(step); + } } - - const install_exe = b.addInstallArtifact(exe, .{}); - b.getInstallStep().dependOn(&install_exe.step); - b.step(d.name, "Build '" ++ d.name ++ "' demo").dependOn(&install_exe.step); - - const run_cmd = b.addRunArtifact(exe); - run_cmd.step.dependOn(&install_exe.step); - b.step(d.name ++ "-run", "Run '" ++ d.name ++ "' demo").dependOn(&run_cmd.step); } -} -fn buildAndInstallSamplesWeb(b: *std.Build, options: anytype) void { - const zemscripten = @import("zemscripten"); + fn buildWeb( + b: *std.Build, + options: anytype, + maybe_depend_step: ?*std.Build.Step, + ) void { + inline for (comptime std.meta.declarations(samples.web)) |d| { + const build_web_app_step = @field(samples.web, d.name).buildWeb(b, options); - const activate_emsdk_step = zemscripten.activateEmsdkStep(b); + if (maybe_depend_step) |step| { + build_web_app_step.dependOn(step); + } - inline for (comptime std.meta.declarations(samples_web)) |d| { - const build_web_app_step = @field(samples_web, d.name).buildWeb(b, options); - build_web_app_step.dependOn(activate_emsdk_step); + b.getInstallStep().dependOn(build_web_app_step); + + const html_filename = std.fmt.allocPrint( + b.allocator, + "{s}.html", + .{d.name}, + ) catch unreachable; + + const emrun_step = @import("zemscripten").emrunStep( + b, + b.getInstallPath(.{ .custom = "web" }, html_filename), + &.{}, + ); + emrun_step.dependOn(build_web_app_step); + + b.step( + d.name, + "Build '" ++ d.name ++ "' sample as a web app", + ).dependOn(build_web_app_step); + + b.step( + d.name ++ "-emrun", + "Build '" ++ d.name ++ "' sample as a web app and serve locally using `emrun`", + ).dependOn(emrun_step); + } + } +}; - b.getInstallStep().dependOn(build_web_app_step); +fn buildExe(b: *std.Build, options: anytype, sample: anytype) *std.Build.Step.Compile { + const exe = sample.build(b, options); - const html_filename = std.fmt.allocPrint( - b.allocator, - "{s}.html", - .{d.name}, - ) catch unreachable; + if (exe.rootModuleTarget().os.tag == .windows) { + // TODO: Problems with LTO on Windows. + exe.want_lto = false; + } - const emrun_step = zemscripten.emrunStep( - b, - b.getInstallPath(.{ .custom = "web" }, html_filename), - &.{}, - ); - emrun_step.dependOn(build_web_app_step); + if (exe.root_module.optimize != .Debug) { + exe.root_module.strip = true; + } - b.step( - d.name, - "Build '" ++ d.name ++ "' sample as a web app", - ).dependOn(build_web_app_step); + const install_exe = b.addInstallArtifact(exe, .{}); + b.getInstallStep().dependOn(&install_exe.step); + b.step(sample.demo_name, "Build '" ++ sample.demo_name ++ "' demo").dependOn(&install_exe.step); - b.step( - d.name ++ "-emrun", - "Build '" ++ d.name ++ "' sample as a web app and serve locally using `emrun`", - ).dependOn(emrun_step); - } -} + const run_cmd = b.addRunArtifact(exe); + run_cmd.step.dependOn(&install_exe.step); + b.step(sample.demo_name ++ "-run", "Run '" ++ sample.demo_name ++ "' demo").dependOn(&run_cmd.step); -// TODO: Delete this once Zig checks minimum_zig_version in build.zig.zon -fn ensureZigVersion() !void { - var installed_ver = builtin.zig_version; - installed_ver.build = null; - - if (installed_ver.order(min_zig_version) == .lt) { - std.log.err("\n" ++ - \\--------------------------------------------------------------------------- - \\ - \\Installed Zig compiler version is too old. - \\ - \\Min. required version: {any} - \\Installed version: {any} - \\ - \\Please install newer version and try again. - \\Latest version can be found here: https://ziglang.org/download/ - \\ - \\--------------------------------------------------------------------------- - \\ - , .{ min_zig_version, installed_ver }); - return error.ZigIsTooOld; - } + return exe; } fn ensureGit(allocator: std.mem.Allocator) !void { diff --git a/samples/audio_experiments/build.zig b/samples/audio_experiments/build.zig index 07dc660dd..d6e27d69b 100644 --- a/samples/audio_experiments/build.zig +++ b/samples/audio_experiments/build.zig @@ -1,8 +1,8 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "audio_experiments"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "audio_experiments"; +pub const content_dir = demo_name ++ "_content/"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { diff --git a/samples/audio_experiments_wgpu/build.zig b/samples/audio_experiments_wgpu/build.zig index 3e9aafe77..42f33576c 100644 --- a/samples/audio_experiments_wgpu/build.zig +++ b/samples/audio_experiments_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "audio_experiments_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "audio_experiments_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/audio_playback_test/build.zig b/samples/audio_playback_test/build.zig index dfa066f47..54ba45add 100644 --- a/samples/audio_playback_test/build.zig +++ b/samples/audio_playback_test/build.zig @@ -1,8 +1,8 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "audio_playback_test"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "audio_playback_test"; +pub const content_dir = demo_name ++ "_content/"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { diff --git a/samples/bindless/build.zig b/samples/bindless/build.zig index 15a056c34..9cce6a0be 100644 --- a/samples/bindless/build.zig +++ b/samples/bindless/build.zig @@ -1,8 +1,8 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "bindless"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "bindless"; +pub const content_dir = demo_name ++ "_content/"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { diff --git a/samples/bullet_physics_test_wgpu/build.zig b/samples/bullet_physics_test_wgpu/build.zig index 1aa881220..71edd3bb1 100644 --- a/samples/bullet_physics_test_wgpu/build.zig +++ b/samples/bullet_physics_test_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "bullet_physics_test_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "bullet_physics_test_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/directml_convolution_test/build.zig b/samples/directml_convolution_test/build.zig index ebd9530d5..cf54abe84 100644 --- a/samples/directml_convolution_test/build.zig +++ b/samples/directml_convolution_test/build.zig @@ -1,13 +1,14 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "directml_convolution_test"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "directml_convolution_test"; +pub const content_dir = demo_name ++ "_content/"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { return std.fs.path.resolve(b.allocator, paths) catch @panic("OOM"); } + pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); const src_path = b.pathJoin(&.{ cwd_path, "src" }); diff --git a/samples/frame_pacing_wgpu/build.zig b/samples/frame_pacing_wgpu/build.zig index dee45c5cf..670e3dca6 100644 --- a/samples/frame_pacing_wgpu/build.zig +++ b/samples/frame_pacing_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "frame_pacing_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "frame_pacing_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/gamepad_wgpu/build.zig b/samples/gamepad_wgpu/build.zig index 73da52de7..c93509ce7 100644 --- a/samples/gamepad_wgpu/build.zig +++ b/samples/gamepad_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "gamepad_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "gamepad_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/gui_test_wgpu/build.zig b/samples/gui_test_wgpu/build.zig index bdbc44bd1..264875c0a 100644 --- a/samples/gui_test_wgpu/build.zig +++ b/samples/gui_test_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "gui_test_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "gui_test_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/instanced_pills_wgpu/build.zig b/samples/instanced_pills_wgpu/build.zig index 945633fbe..f72f529ea 100644 --- a/samples/instanced_pills_wgpu/build.zig +++ b/samples/instanced_pills_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "instanced_pills_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "instanced_pills_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/layers_wgpu/build.zig b/samples/layers_wgpu/build.zig index ce5c1a70c..b12a10ab4 100644 --- a/samples/layers_wgpu/build.zig +++ b/samples/layers_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "layers_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "layers_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/mesh_shader_test/build.zig b/samples/mesh_shader_test/build.zig index b6853b5c3..f8c679f8b 100644 --- a/samples/mesh_shader_test/build.zig +++ b/samples/mesh_shader_test/build.zig @@ -1,8 +1,8 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "mesh_shader_test"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "mesh_shader_test"; +pub const content_dir = demo_name ++ "_content/"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { diff --git a/samples/minimal_d3d12/build.zig b/samples/minimal_d3d12/build.zig index b9b7ae42b..51671a4b7 100644 --- a/samples/minimal_d3d12/build.zig +++ b/samples/minimal_d3d12/build.zig @@ -1,7 +1,7 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "minimal_d3d12"; +pub const demo_name = "minimal_d3d12"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { @@ -18,7 +18,11 @@ pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { .optimize = options.optimize, }); - const zwindows = b.dependency("zwindows", .{}); + const zwindows = b.dependency("zwindows", .{ + .zxaudio2_debug_layer = options.zxaudio2_debug_layer, + .zd3d12_debug_layer = options.zd3d12_debug_layer, + .zd3d12_gbv = options.zd3d12_gbv, + }); exe.root_module.addImport("zwindows", zwindows.module("zwindows")); if (builtin.os.tag == .windows or builtin.os.tag == .linux) { diff --git a/samples/minimal_glfw_d3d12/build.zig b/samples/minimal_glfw_d3d12/build.zig index 5689f177a..163d35c66 100644 --- a/samples/minimal_glfw_d3d12/build.zig +++ b/samples/minimal_glfw_d3d12/build.zig @@ -1,8 +1,8 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "minimal_glfw_d3d12"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "minimal_glfw_d3d12"; +pub const content_dir = demo_name ++ "_content/"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { diff --git a/samples/minimal_glfw_gl/build.zig b/samples/minimal_glfw_gl/build.zig index a881b6987..dd42ce3ad 100644 --- a/samples/minimal_glfw_gl/build.zig +++ b/samples/minimal_glfw_gl/build.zig @@ -1,6 +1,6 @@ const std = @import("std"); -const demo_name = "minimal_glfw_gl"; +pub const demo_name = "minimal_glfw_gl"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/minimal_sdl_gl/build.zig b/samples/minimal_sdl_gl/build.zig index ecb8568f4..cef3186bb 100644 --- a/samples/minimal_sdl_gl/build.zig +++ b/samples/minimal_sdl_gl/build.zig @@ -1,6 +1,6 @@ const std = @import("std"); -const demo_name = "minimal_sdl_gl"; +pub const demo_name = "minimal_sdl_gl"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/minimal_zgpu_zgui/build.zig b/samples/minimal_zgpu_zgui/build.zig index aa6246aaf..d2c2fdf7d 100644 --- a/samples/minimal_zgpu_zgui/build.zig +++ b/samples/minimal_zgpu_zgui/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "minimal_zgpu_zgui"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "minimal_zgpu_zgui"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/minimal_zgui_glfw_d3d12/build.zig b/samples/minimal_zgui_glfw_d3d12/build.zig index f912d8472..0c52d3b41 100644 --- a/samples/minimal_zgui_glfw_d3d12/build.zig +++ b/samples/minimal_zgui_glfw_d3d12/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "minimal_zgui_glfw_d3d12"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "minimal_zgui_glfw_d3d12"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/minimal_zgui_glfw_gl/build.zig b/samples/minimal_zgui_glfw_gl/build.zig index a68f5e155..c5282219c 100644 --- a/samples/minimal_zgui_glfw_gl/build.zig +++ b/samples/minimal_zgui_glfw_gl/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "minimal_zgui_glfw_gl"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "minimal_zgui_glfw_gl"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/minimal_zgui_win32_d3d12/build.zig b/samples/minimal_zgui_win32_d3d12/build.zig index 7ab86aed8..6332116be 100644 --- a/samples/minimal_zgui_win32_d3d12/build.zig +++ b/samples/minimal_zgui_win32_d3d12/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "minimal_zgui_win32_d3d12"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "minimal_zgui_win32_d3d12"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/monolith/build.zig b/samples/monolith/build.zig index cfa460041..c568b53f0 100644 --- a/samples/monolith/build.zig +++ b/samples/monolith/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "monolith"; -const content_dir = "monolith_content/"; +pub const demo_name = "monolith"; +pub const content_dir = "monolith_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/openvr_test/build.zig b/samples/openvr_test/build.zig index 7a46680a4..a24c62d73 100644 --- a/samples/openvr_test/build.zig +++ b/samples/openvr_test/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "openvr_test"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "openvr_test"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/physically_based_rendering_wgpu/build.zig b/samples/physically_based_rendering_wgpu/build.zig index 0a0c59154..da941e910 100644 --- a/samples/physically_based_rendering_wgpu/build.zig +++ b/samples/physically_based_rendering_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "physically_based_rendering_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "physically_based_rendering_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/physics_test_wgpu/build.zig b/samples/physics_test_wgpu/build.zig index 9ae6561d2..9a412213d 100644 --- a/samples/physics_test_wgpu/build.zig +++ b/samples/physics_test_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "physics_test_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "physics_test_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/procedural_mesh_wgpu/build.zig b/samples/procedural_mesh_wgpu/build.zig index 4f30b707b..e5b40b4c6 100644 --- a/samples/procedural_mesh_wgpu/build.zig +++ b/samples/procedural_mesh_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "procedural_mesh_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "procedural_mesh_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/rasterization/build.zig b/samples/rasterization/build.zig index 7be7787de..a5ffdb295 100644 --- a/samples/rasterization/build.zig +++ b/samples/rasterization/build.zig @@ -1,8 +1,8 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "rasterization"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "rasterization"; +pub const content_dir = demo_name ++ "_content/"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { diff --git a/samples/sdl2_demo/build.zig b/samples/sdl2_demo/build.zig index 11c9aadf1..126f2bc8f 100644 --- a/samples/sdl2_demo/build.zig +++ b/samples/sdl2_demo/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "sdl2_demo"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "sdl2_demo"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/simple_openvr/build.zig b/samples/simple_openvr/build.zig index bd488b5bf..a52f7efcf 100644 --- a/samples/simple_openvr/build.zig +++ b/samples/simple_openvr/build.zig @@ -1,8 +1,8 @@ const std = @import("std"); const builtin = @import("builtin"); -const demo_name = "simple_openvr"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "simple_openvr"; +pub const content_dir = demo_name ++ "_content/"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { diff --git a/samples/textured_quad/build.zig b/samples/textured_quad/build.zig index 9c12991e3..c2eeb5b06 100644 --- a/samples/textured_quad/build.zig +++ b/samples/textured_quad/build.zig @@ -1,8 +1,8 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "textured_quad"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "textured_quad"; +pub const content_dir = demo_name ++ "_content/"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { diff --git a/samples/textured_quad_wgpu/build.zig b/samples/textured_quad_wgpu/build.zig index 7d8c6cfa6..93d5b1bbd 100644 --- a/samples/textured_quad_wgpu/build.zig +++ b/samples/textured_quad_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "textured_quad_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "textured_quad_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/triangle/build.zig b/samples/triangle/build.zig index d2e3fa24e..eb3d4ef79 100644 --- a/samples/triangle/build.zig +++ b/samples/triangle/build.zig @@ -1,8 +1,8 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "triangle"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "triangle"; +pub const content_dir = demo_name ++ "_content/"; // in future zig version e342433 pub fn pathResolve(b: *std.Build, paths: []const []const u8) []u8 { diff --git a/samples/triangle_wgpu/build.zig b/samples/triangle_wgpu/build.zig index ec34d87b9..642ba30ec 100644 --- a/samples/triangle_wgpu/build.zig +++ b/samples/triangle_wgpu/build.zig @@ -1,7 +1,7 @@ const std = @import("std"); -const demo_name = "triangle_wgpu"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "triangle_wgpu"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/vector_graphics_test/build.zig b/samples/vector_graphics_test/build.zig index ea81a726c..07a911ce0 100644 --- a/samples/vector_graphics_test/build.zig +++ b/samples/vector_graphics_test/build.zig @@ -1,6 +1,6 @@ const std = @import("std"); -const demo_name = "vector_graphics_test"; +pub const demo_name = "vector_graphics_test"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); diff --git a/samples/zphysics_instanced_cubes_d3d12/build.zig b/samples/zphysics_instanced_cubes_d3d12/build.zig index ce26012c7..5ebc40ce4 100644 --- a/samples/zphysics_instanced_cubes_d3d12/build.zig +++ b/samples/zphysics_instanced_cubes_d3d12/build.zig @@ -1,8 +1,8 @@ const builtin = @import("builtin"); const std = @import("std"); -const demo_name = "zphysics_instanced_cubes_d3d12"; -const content_dir = demo_name ++ "_content/"; +pub const demo_name = "zphysics_instanced_cubes_d3d12"; +pub const content_dir = demo_name ++ "_content/"; pub fn build(b: *std.Build, options: anytype) *std.Build.Step.Compile { const cwd_path = b.pathJoin(&.{ "samples", demo_name }); From cf52135d777792f1805de78043cacd8b5432716b Mon Sep 17 00:00:00 2001 From: Chris Heyes <22148308+hazeycode@users.noreply.github.com> Date: Tue, 22 Apr 2025 23:23:37 +0100 Subject: [PATCH 6/6] Use GitHub archive URLs so that LFS content is included --- build.zig.zon | 60 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 5a5612ab1..919ba1cd9 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -14,27 +14,27 @@ }, .dependencies = .{ .system_sdk = .{ - .url = "git+https://github.com/zig-gamedev/system_sdk#c0dbf11cdc17da5904ea8a17eadc54dee26567ec", + .url = "https://github.com/zig-gamedev/system_sdk/archive/c0dbf11cdc17da5904ea8a17eadc54dee26567ec.tar.gz", .hash = "system_sdk-0.3.0-dev-alwUNnYaaAJAtIdE2fg4NQfDqEKs7QCXy_qYukAOBfmF", }, .zaudio = .{ - .url = "git+https://github.com/zig-gamedev/zaudio#b03ad083bcd1594c099f5841f62c2dccea634f86", + .url = "https://github.com/zig-gamedev/zaudio/archive/b03ad083bcd1594c099f5841f62c2dccea634f86.tar.gz", .hash = "zaudio-0.11.0-dev-_M-91jdkPwCWTlVfjKjXZWbHdXjKmYDcbCn99w3c9yOu", }, .zbullet = .{ - .url = "git+https://github.com/zig-gamedev/zbullet#9a686d95f5e05cd6bb4a1f34fd59ee8e7ee2cc9d", + .url = "https://github.com/zig-gamedev/zbullet/archive/9a686d95f5e05cd6bb4a1f34fd59ee8e7ee2cc9d.tar.gz", .hash = "zbullet-0.4.0-dev-7gkXj7GUQAAkp5CZT20veGkT9f0f8Qeloh6ok4dv1bSs", }, .zflecs = .{ - .url = "git+https://github.com/zig-gamedev/zflecs#34f6cc3f6d11fa13a44ae759e9ed6bec3a455fa4", + .url = "https://github.com/zig-gamedev/zflecs/archive/34f6cc3f6d11fa13a44ae759e9ed6bec3a455fa4.tar.gz", .hash = "zflecs-0.2.0-dev-1PN3yuhMNQDj3J57z74E3AIGM8bmVg3FhAd6XZKb_A9W", }, .zemscripten = .{ - .url = "git+https://github.com/zig-gamedev/zemscripten#cac24b72f87432ce607c02abcfad7822b702aad9", + .url = "https://github.com/zig-gamedev/zemscripten/archive/cac24b72f87432ce607c02abcfad7822b702aad9.tar.gz", .hash = "zemscripten-0.2.0-dev-sRlDqBtLAADUk3IZprWI0srnchHAXRSQu1n4wZiRvXmr", }, .emsdk = .{ @@ -43,67 +43,67 @@ }, .zglfw = .{ - .url = "git+https://github.com/zig-gamedev/zglfw#30b29eee8047852708e79aadf0425494e6d7c5b5", + .url = "https://github.com/zig-gamedev/zglfw/archive/30b29eee8047852708e79aadf0425494e6d7c5b5.tar.gz", .hash = "zglfw-0.10.0-dev-zgVDNG2cIQAiAC_gLYmbML-NQklPW5B_AELV_fAQc2Jg", }, .zgpu = .{ - .url = "git+https://github.com/zig-gamedev/zgpu#3ae4a71af16df3a7dfa95023bba1a1e6a0bfb80d", + .url = "https://github.com/zig-gamedev/zgpu/archive/3ae4a71af16df3a7dfa95023bba1a1e6a0bfb80d.tar.gz", .hash = "zgpu-0.12.0-dev-nqFT5BCgCADqzg95ZvomJREp6oIl3NTubfyiUNHc18Pr", }, .dawn_x86_64_windows_gnu = .{ - .url = "git+https://github.com/michal-z/webgpu_dawn-x86_64-windows-gnu#d3a68014e6b6b53fd330a0ccba99e4dcfffddae5", + .url = "https://github.com/michal-z/webgpu_dawn-x86_64-windows-gnu/archive/d3a68014e6b6b53fd330a0ccba99e4dcfffddae5.tar.gz", .hash = "N-V-__8AAGsYnAT5RIzeAu881RveLghQ1EidqgVBVx10gVTo", .lazy = true, }, .dawn_x86_64_linux_gnu = .{ - .url = "git+https://github.com/michal-z/webgpu_dawn-x86_64-linux-gnu#7d70db023bf254546024629cbec5ee6113e12a42", + .url = "https://github.com/michal-z/webgpu_dawn-x86_64-linux-gnu/archive/7d70db023bf254546024629cbec5ee6113e12a42.tar.gz", .hash = "N-V-__8AAK7XUQNKNRnv1J6i189jtURJKjp3HTftoyD4Y4CB", .lazy = true, }, .dawn_aarch64_linux_gnu = .{ - .url = "git+https://github.com/michal-z/webgpu_dawn-aarch64-linux-gnu#c1f55e740a62f6942ff046e709ecd509a005dbeb", + .url = "https://github.com/michal-z/webgpu_dawn-aarch64-linux-gnu/archive/c1f55e740a62f6942ff046e709ecd509a005dbeb.tar.gz", .hash = "N-V-__8AAJ-wTwNc0T9oSflO92iO6IxrdMeRil37UU-KQD_M", .lazy = true, }, .dawn_aarch64_macos = .{ - .url = "git+https://github.com/michal-z/webgpu_dawn-aarch64-macos#d2360cdfff0cf4a780cb77aa47c57aca03cc6dfe", + .url = "https://github.com/michal-z/webgpu_dawn-aarch64-macos/archive/d2360cdfff0cf4a780cb77aa47c57aca03cc6dfe.tar.gz", .hash = "N-V-__8AALVIRAIf5nfpx8-4mEo2RGsynVryPQPcHk95qFM5", .lazy = true, }, .dawn_x86_64_macos = .{ - .url = "git+https://github.com/michal-z/webgpu_dawn-x86_64-macos#901716b10b31ce3e0d3fe479326b41e91d59c661", + .url = "https://github.com/michal-z/webgpu_dawn-x86_64-macos/archive/901716b10b31ce3e0d3fe479326b41e91d59c661.tar.gz", .hash = "N-V-__8AAIz1QAKx8C8vft2YoHjGTjEAkH2QMR2UiAo8xZJ-", .lazy = true, }, .zgui = .{ - .url = "git+https://github.com/zig-gamedev/zgui#7ac0630658ee2d285893603aca3945461d181beb", + .url = "https://github.com/zig-gamedev/zgui/archive/7ac0630658ee2d285893603aca3945461d181beb.tar.gz", .hash = "zgui-0.6.0-dev--L6sZG-baABjJ9Gcf2XU_VpTLmn4nNwq7alHKDRT_BW9", }, .zjobs = .{ - .url = "git+https://github.com/zig-gamedev/zjobs#dfdb734e8084f7dc5010a4ded30bc8e04b6d4393", + .url = "https://github.com/zig-gamedev/zjobs/archive/dfdb734e8084f7dc5010a4ded30bc8e04b6d4393.tar.gz", .hash = "zjobs-0.3.0-dev-59uaZmTQAABLe7t30aW2PD5P3VxjWbAoL1XXnhgs2Ymd", }, .zmath = .{ - .url = "git+https://github.com/zig-gamedev/zmath#ccf7297ef6c01e21b2d51ad81b5b6ce929e86a00", + .url = "https://github.com/zig-gamedev/zmath/archive/ccf7297ef6c01e21b2d51ad81b5b6ce929e86a00.tar.gz", .hash = "zmath-0.11.0-dev-wjwivZY1AwDO7yxNmZ5HWoU03f9mFBet8LN9-oYc3i29", }, .zmesh = .{ - .url = "git+https://github.com/zig-gamedev/zmesh#f8f528128704ae879a16ddb0a3470c5e0a144a20", + .url = "https://github.com/zig-gamedev/zmesh/archive/f8f528128704ae879a16ddb0a3470c5e0a144a20.tar.gz", .hash = "zmesh-0.11.0-dev-oO3A5gx7CgCBPHsGeuNzwzXAyEvs57u39AD5EUZTScli", }, .znoise = .{ - .url = "git+https://github.com/zig-gamedev/znoise#96f9458c2da975a8bf1cdf95e819c7b070965198", + .url = "https://github.com/zig-gamedev/znoise/archive/96f9458c2da975a8bf1cdf95e819c7b070965198.tar.gz", .hash = "znoise-0.3.0-dev-gK1op-mjAQAvffA1EcRD0GekpVpgN7Km5rquofgZ0bq7", }, .zopengl = .{ - .url = "git+https://github.com/zig-gamedev/zopengl#fe574e10bc096983631d9f18b363e7a88247eef4", + .url = "https://github.com/zig-gamedev/zopengl/archive/fe574e10bc096983631d9f18b363e7a88247eef4.tar.gz", .hash = "zopengl-0.6.0-dev-5-tnz0tUCAAecmfZHeJBAGiwU9ofrlLHJEGt2CXwnmF9", }, @@ -113,62 +113,62 @@ }, .zphysics = .{ - .url = "git+https://github.com/zig-gamedev/zphysics#0c60c1a0f2a2393c3c226dabd0bd7315f155f3ef", + .url = "https://github.com/zig-gamedev/zphysics/archive/0c60c1a0f2a2393c3c226dabd0bd7315f155f3ef.tar.gz", .hash = "zphysics-0.2.0-dev-nZDEAHKiPwDIup82Bua4nZKs18EEpgWCLuEjWNAlmuau", }, .zpix = .{ - .url = "git+https://github.com/zig-gamedev/zpix#e1f5f72d2a64ac1c459a14be40df63bef07bb97e", + .url = "https://github.com/zig-gamedev/zpix/archive/e1f5f72d2a64ac1c459a14be40df63bef07bb97e.tar.gz", .hash = "zpix-0.11.0-dev-T9TIVqU4AACjM3XmezXEkVGWHwvTAnz5VLtHh7kn6u-l", }, .zpool = .{ - .url = "git+https://github.com/zig-gamedev/zpool#99a4c74ec26b1f327209782565b4adaf1c1d610f", + .url = "https://github.com/zig-gamedev/zpool/archive/99a4c74ec26b1f327209782565b4adaf1c1d610f.tar.gz", .hash = "zpool-0.11.0-dev-bG692eY7AQDLTkjTbgnbg_-qgjmxUCg8hNpN1kZRrIlW", }, .zsdl = .{ - .url = "git+https://github.com/zig-gamedev/zsdl#680fc9614d01173168c8ecb5b2256b7f1de73c41", + .url = "https://github.com/zig-gamedev/zsdl/archive/680fc9614d01173168c8ecb5b2256b7f1de73c41.tar.gz", .hash = "zsdl-0.4.0-dev-rFpjE6pXWQC9EXxkkH2zO6MUh9JCDgteTDAIPt-mSQm2", }, .sdl2_prebuilt_macos = .{ - .url = "git+https://github.com/zig-gamedev/sdl2-prebuilt-macos#7bc0fa9101342c019eed252d43f490660dfa411b", + .url = "https://github.com/zig-gamedev/sdl2-prebuilt-macos/archive/7bc0fa9101342c019eed252d43f490660dfa411b.tar.gz", .hash = "sdl2_prebuilt_macos-0.2.0-dev-DaOxP5Eq2QBpNBkpXn2qjyI6_s0gINcbdUMpqI1KshaH", .lazy = true, }, .sdl2_prebuilt_x86_64_windows_gnu = .{ - .url = "git+https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-windows-gnu#8de1512cedfa1fb3ab17ecf295af8cabd7f231f1", + .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-windows-gnu/archive/8de1512cedfa1fb3ab17ecf295af8cabd7f231f1.tar.gz", .hash = "sdl2_prebuilt_x86_64_windows_gnu-0.2.0-dev-HPeIhv2VaQBOWF4Fjtr7Vb9bA852pUtwUuQKdvNvkA98", .lazy = true, }, .sdl2_prebuilt_x86_64_linux_gnu = .{ - .url = "git+https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu#ce2b511c052c3fdc35c286ade8235d2830a50992", + .url = "https://github.com/zig-gamedev/sdl2-prebuilt-x86_64-linux-gnu/archive/ce2b511c052c3fdc35c286ade8235d2830a50992.tar.gz", .hash = "sdl2_prebuilt_x86_64_linux_gnu-0.2.0-dev-NHZ_xrzSHwDJDoAxuVi000OEq428znS1fDRRJE8PlXHu", .lazy = true, }, .sdl3_prebuilt_macos = .{ - .url = "git+https://github.com/zig-gamedev/sdl3-prebuilt-macos#e89207914a0f0163c0fb543da4f530f645ef5969", + .url = "https://github.com/zig-gamedev/sdl3-prebuilt-macos/archive/e89207914a0f0163c0fb543da4f530f645ef5969.tar.gz", .hash = "sdl3_prebuilt_macos-0.2.0-dev-A1UBS1aUdwCWfplgS5fNorbstvDxSi3LOHnSPzjmWZhl", .lazy = true, }, .sdl3_prebuilt_x86_64_windows_gnu = .{ - .url = "git+https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-windows-gnu#8f5dc1a9c9450ac578286e90d4667fc3aa1b23e2", + .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-windows-gnu/archive/8f5dc1a9c9450ac578286e90d4667fc3aa1b23e2.tar.gz", .hash = "sdl3_prebuilt_x86_64_windows_gnu-0.2.0-dev-AAAAAI_mJADlsRyMxRFKobQJEbfs1p-37A9mmYEj7DW-", .lazy = true, }, .sdl3_prebuilt_x86_64_linux_gnu = .{ - .url = "git+https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-linux-gnu#b19959ed3aa87d8393640d7ba3aec142ae85487b", + .url = "https://github.com/zig-gamedev/sdl3-prebuilt-x86_64-linux-gnu/archive/b19959ed3aa87d8393640d7ba3aec142ae85487b.tar.gz", .hash = "sdl3_prebuilt_x86_64_linux_gnu-0.2.0-dev-qpwWsmyVNwBHzXjgC9Z-U02SXoUVMMxvCnI7XKocDcDn", .lazy = true, }, .zstbi = .{ - .url = "git+https://github.com/zig-gamedev/zstbi#094c4bba5cdbec167d3f6aaa98cccccd5c99145f", + .url = "https://github.com/zig-gamedev/zstbi/archive/094c4bba5cdbec167d3f6aaa98cccccd5c99145f.tar.gz", .hash = "zstbi-0.11.0-dev-L0Ea_-eVBwCl8RYA98PhLDw3Fhw5k7FJOHSMDKWDOvqx", }, .ztracy = .{ - .url = "git+https://github.com/zig-gamedev/ztracy#be3d003f29d59d72e68e493ab531374ab474a795", + .url = "https://github.com/zig-gamedev/ztracy/archive/be3d003f29d59d72e68e493ab531374ab474a795.tar.gz", .hash = "ztracy-0.14.0-dev-zHJSq1oQFwCAq2LhbqsBUmZAipMzsD8UfKL5Etc_OJMb", },