From a127378b1980626fe2f51405330b8765d7fbdb60 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Mon, 18 Apr 2022 11:21:22 -0700 Subject: [PATCH] gpu-dawn: update Dawn to latest revision as of 2022-04-18 Effectively a redo of hexops/mach#231 where I messed up the submodule update by accident. Updates Dawn to latest revision as of 2022-04-18 https://github.com/hexops/dawn/commit/c7b7b6def672299ea3094161a83b22e19ed409ff * Followed https://github.com/hexops/dawn/tree/main/mach#updating * The UB issue should now actually get fixed (once CI builds the binary releases.) * Verified example runs on macOS. Helps hexops/mach#221 Signed-off-by: Stephen Gutekanst --- .gitmodules | 2 +- gpu-dawn/.gitmodules | 2 +- gpu-dawn/build.zig | 65 ++++++++++++++++++++------------------------ gpu-dawn/libs/dawn | 2 +- 4 files changed, 32 insertions(+), 39 deletions(-) diff --git a/.gitmodules b/.gitmodules index d9b478ce..81f535cb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,7 +2,7 @@ path = gpu-dawn/libs/dawn url = https://github.com/hexops/dawn.git shallow = true - branch = "generated-2022-04-17" + branch = "generated-2022-04-18" [submodule "gpu-dawn/libs/DirectXShaderCompiler"] path = gpu-dawn/libs/DirectXShaderCompiler url = https://github.com/hexops/DirectXShaderCompiler diff --git a/gpu-dawn/.gitmodules b/gpu-dawn/.gitmodules index 2ed5513b..07c1ae4a 100644 --- a/gpu-dawn/.gitmodules +++ b/gpu-dawn/.gitmodules @@ -2,7 +2,7 @@ path = libs/dawn url = https://github.com/hexops/dawn.git shallow = true - branch = "generated-2022-04-17" + branch = "generated-2022-04-18" [submodule "libs/DirectXShaderCompiler"] path = libs/DirectXShaderCompiler url = https://github.com/hexops/DirectXShaderCompiler diff --git a/gpu-dawn/build.zig b/gpu-dawn/build.zig index edb4e44c..4944a9ed 100644 --- a/gpu-dawn/build.zig +++ b/gpu-dawn/build.zig @@ -662,8 +662,8 @@ fn buildLibDawnNative(b: *Builder, step: *std.build.LibExeObjStep, options: Opti "-DTINT_BUILD_HLSL_WRITER=1", "-DTINT_BUILD_GLSL_WRITER=1", - include("libs/dawn/third_party/tint"), - include("libs/dawn/third_party/tint/include"), + include("libs/dawn/"), + include("libs/dawn/include/tint"), include("libs/dawn/out/Debug/gen/include"), include("libs/dawn/out/Debug/gen/src"), @@ -899,7 +899,7 @@ fn buildLibDawnNative(b: *Builder, step: *std.build.LibExeObjStep, options: Opti return lib; } -// Builds third party tint sources; derived from third_party/tint/src/tint/BUILD.gn +// Builds tint sources; derived from src/tint/BUILD.gn fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) *std.build.LibExeObjStep { const lib = if (!options.separate_libs) step else blk: { var main_abs = std.fs.path.join(b.allocator, &.{ thisDir(), "src/dawn/dummy.zig" }) catch unreachable; @@ -922,9 +922,8 @@ fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * "-DTINT_BUILD_HLSL_WRITER=1", "-DTINT_BUILD_GLSL_WRITER=1", - include("libs/dawn"), - include("libs/dawn/third_party/tint"), - include("libs/dawn/third_party/tint/include"), + include("libs/dawn/"), + include("libs/dawn/include/tint"), // Required for TINT_BUILD_SPV_READER=1 and TINT_BUILD_SPV_WRITER=1, if specified include("libs/dawn/third_party/vulkan-deps"), @@ -938,19 +937,19 @@ fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * // libtint_core_all_src appendLangScannedSources(b, lib, options, .{ .rel_dirs = &.{ - "libs/dawn/third_party/tint/src/tint/ast/", - "libs/dawn/third_party/tint/src/tint/", - "libs/dawn/third_party/tint/src/tint/diagnostic/", - "libs/dawn/third_party/tint/src/tint/inspector/", - "libs/dawn/third_party/tint/src/tint/reader/", - "libs/dawn/third_party/tint/src/tint/resolver/", - "libs/dawn/third_party/tint/src/tint/utils", - "libs/dawn/third_party/tint/src/tint/text/", - "libs/dawn/third_party/tint/src/tint/transform/", - "libs/dawn/third_party/tint/src/tint/transform/utils", - "libs/dawn/third_party/tint/src/tint/writer/", - "libs/dawn/third_party/tint/src/tint/ast/", - "libs/dawn/third_party/tint/src/tint/val/", + "libs/dawn/src/tint/ast/", + "libs/dawn/src/tint", + "libs/dawn/src/tint/diagnostic/", + "libs/dawn/src/tint/inspector/", + "libs/dawn/src/tint/reader/", + "libs/dawn/src/tint/resolver/", + "libs/dawn/src/tint/utils/", + "libs/dawn/src/tint/text/", + "libs/dawn/src/tint/transform/", + "libs/dawn/src/tint/transform/utils", + "libs/dawn/src/tint/writer/", + "libs/dawn/src/tint/ast/", + "libs/dawn/src/tint/val/", }, .flags = flags.items, .excluding_contains = &.{ "test", "bench", "printer_windows", "printer_linux", "printer_other", "glsl.cc" }, @@ -959,15 +958,15 @@ fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * var cpp_sources = std.ArrayList([]const u8).init(b.allocator); const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target; switch (target.os.tag) { - .windows => cpp_sources.append(thisDir() ++ "/libs/dawn/third_party/tint/src/tint/diagnostic/printer_windows.cc") catch unreachable, - .linux => cpp_sources.append(thisDir() ++ "/libs/dawn/third_party/tint/src/tint/diagnostic/printer_linux.cc") catch unreachable, - else => cpp_sources.append(thisDir() ++ "/libs/dawn/third_party/tint/src/tint/diagnostic/printer_other.cc") catch unreachable, + .windows => cpp_sources.append(thisDir() ++ "/libs/dawn/src/tint/diagnostic/printer_windows.cc") catch unreachable, + .linux => cpp_sources.append(thisDir() ++ "/libs/dawn/src/tint/diagnostic/printer_linux.cc") catch unreachable, + else => cpp_sources.append(thisDir() ++ "/libs/dawn/src/tint/diagnostic/printer_other.cc") catch unreachable, } // libtint_sem_src appendLangScannedSources(b, lib, options, .{ .rel_dirs = &.{ - "libs/dawn/third_party/tint/src/tint/sem/", + "libs/dawn/src/tint/sem/", }, .flags = flags.items, .excluding_contains = &.{ "test", "benchmark" }, @@ -976,7 +975,7 @@ fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * // libtint_spv_reader_src appendLangScannedSources(b, lib, options, .{ .rel_dirs = &.{ - "libs/dawn/third_party/tint/src/tint/reader/spirv/", + "libs/dawn/src/tint/reader/spirv/", }, .flags = flags.items, .excluding_contains = &.{ "test", "benchmark" }, @@ -985,7 +984,7 @@ fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * // libtint_spv_writer_src appendLangScannedSources(b, lib, options, .{ .rel_dirs = &.{ - "libs/dawn/third_party/tint/src/tint/writer/spirv/", + "libs/dawn/src/tint/writer/spirv/", }, .flags = flags.items, .excluding_contains = &.{ "test", "bench" }, @@ -995,7 +994,7 @@ fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * // libtint_wgsl_reader_src appendLangScannedSources(b, lib, options, .{ .rel_dirs = &.{ - "libs/dawn/third_party/tint/src/tint/reader/wgsl/", + "libs/dawn/src/tint/reader/wgsl/", }, .flags = flags.items, .excluding_contains = &.{ "test", "bench" }, @@ -1005,7 +1004,7 @@ fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * // libtint_wgsl_writer_src appendLangScannedSources(b, lib, options, .{ .rel_dirs = &.{ - "libs/dawn/third_party/tint/src/tint/writer/wgsl/", + "libs/dawn/src/tint/writer/wgsl/", }, .flags = flags.items, .excluding_contains = &.{ "test", "bench" }, @@ -1015,7 +1014,7 @@ fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * // libtint_msl_writer_src appendLangScannedSources(b, lib, options, .{ .rel_dirs = &.{ - "libs/dawn/third_party/tint/src/tint/writer/msl/", + "libs/dawn/src/tint/writer/msl/", }, .flags = flags.items, .excluding_contains = &.{ "test", "bench" }, @@ -1025,7 +1024,7 @@ fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * // libtint_hlsl_writer_src appendLangScannedSources(b, lib, options, .{ .rel_dirs = &.{ - "libs/dawn/third_party/tint/src/tint/writer/hlsl/", + "libs/dawn/src/tint/writer/hlsl/", }, .flags = flags.items, .excluding_contains = &.{ "test", "bench" }, @@ -1035,17 +1034,11 @@ fn buildLibTint(b: *Builder, step: *std.build.LibExeObjStep, options: Options) * // libtint_glsl_writer_src appendLangScannedSources(b, lib, options, .{ .rel_dirs = &.{ - "libs/dawn/third_party/tint/src/tint/writer/glsl/", + "libs/dawn/src/tint/writer/glsl/", }, .flags = flags.items, .excluding_contains = &.{ "test", "bench" }, }) catch unreachable; - for ([_][]const u8{ - "third_party/tint/src/tint/transform/glsl.cc", - }) |path| { - var abs_path = std.fs.path.join(b.allocator, &.{ thisDir(), "libs/dawn", path }) catch unreachable; - cpp_sources.append(abs_path) catch unreachable; - } var cpp_flags = std.ArrayList([]const u8).init(b.allocator); cpp_flags.appendSlice(flags.items) catch unreachable; diff --git a/gpu-dawn/libs/dawn b/gpu-dawn/libs/dawn index 95bf01cb..25cf9a36 160000 --- a/gpu-dawn/libs/dawn +++ b/gpu-dawn/libs/dawn @@ -1 +1 @@ -Subproject commit 95bf01cbd9e8e73165bc90a96d55232d3a77405e +Subproject commit 25cf9a36abd385b9f4ce9dc8648d27ee549cb817