Skip to content

Commit

Permalink
gpu-dawn: update to latest Dawn + windows patches
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Gutekanst <[email protected]>
  • Loading branch information
emidoots committed Mar 5, 2022
1 parent 9fd2c0a commit 5769ddc
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
path = libs/dawn
url = https://github.com/hexops/dawn.git
shallow = true
branch = "generated-2022-02-17"
branch = "generated-2022-03-04"
[submodule "libs/DirectXShaderCompiler"]
path = libs/DirectXShaderCompiler
url = https://github.com/hexops/DirectXShaderCompiler
Expand Down
52 changes: 26 additions & 26 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ fn buildLibDawnNative(b: *Builder, step: *std.build.LibExeObjStep, options: Opti
return lib;
}

// Builds third party tint sources; derived from third_party/tint/src/BUILD.gn
// Builds third party tint sources; derived from third_party/tint/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;
Expand Down Expand Up @@ -879,19 +879,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/ast/",
"libs/dawn/third_party/tint/src/",
"libs/dawn/third_party/tint/src/diagnostic/",
"libs/dawn/third_party/tint/src/inspector/",
"libs/dawn/third_party/tint/src/reader/",
"libs/dawn/third_party/tint/src/resolver/",
"libs/dawn/third_party/tint/src/utils",
"libs/dawn/third_party/tint/src/text/",
"libs/dawn/third_party/tint/src/transform/",
"libs/dawn/third_party/tint/src/transform/utils",
"libs/dawn/third_party/tint/src/writer/",
"libs/dawn/third_party/tint/src/ast/",
"libs/dawn/third_party/tint/src/val/",
"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/",
},
.flags = flags.items,
.excluding_contains = &.{ "test", "bench", "printer_windows", "printer_linux", "printer_other", "glsl.cc" },
Expand All @@ -900,15 +900,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/diagnostic/printer_windows.cc") catch unreachable,
.linux => cpp_sources.append(thisDir() ++ "/libs/dawn/third_party/tint/src/diagnostic/printer_linux.cc") catch unreachable,
else => cpp_sources.append(thisDir() ++ "/libs/dawn/third_party/tint/src/diagnostic/printer_other.cc") catch unreachable,
.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,
}

// libtint_sem_src
appendLangScannedSources(b, lib, options, .{
.rel_dirs = &.{
"libs/dawn/third_party/tint/src/sem/",
"libs/dawn/third_party/tint/src/tint/sem/",
},
.flags = flags.items,
.excluding_contains = &.{ "test", "benchmark" },
Expand All @@ -917,7 +917,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/reader/spirv/",
"libs/dawn/third_party/tint/src/tint/reader/spirv/",
},
.flags = flags.items,
.excluding_contains = &.{ "test", "benchmark" },
Expand All @@ -926,7 +926,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/writer/spirv/",
"libs/dawn/third_party/tint/src/tint/writer/spirv/",
},
.flags = flags.items,
.excluding_contains = &.{ "test", "bench" },
Expand All @@ -936,7 +936,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/reader/wgsl/",
"libs/dawn/third_party/tint/src/tint/reader/wgsl/",
},
.flags = flags.items,
.excluding_contains = &.{ "test", "bench" },
Expand All @@ -946,7 +946,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/writer/wgsl/",
"libs/dawn/third_party/tint/src/tint/writer/wgsl/",
},
.flags = flags.items,
.excluding_contains = &.{ "test", "bench" },
Expand All @@ -956,7 +956,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/writer/msl/",
"libs/dawn/third_party/tint/src/tint/writer/msl/",
},
.flags = flags.items,
.excluding_contains = &.{ "test", "bench" },
Expand All @@ -966,7 +966,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/writer/hlsl/",
"libs/dawn/third_party/tint/src/tint/writer/hlsl/",
},
.flags = flags.items,
.excluding_contains = &.{ "test", "bench" },
Expand All @@ -976,13 +976,13 @@ 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/writer/glsl/",
"libs/dawn/third_party/tint/src/tint/writer/glsl/",
},
.flags = flags.items,
.excluding_contains = &.{ "test", "bench" },
}) catch unreachable;
for ([_][]const u8{
"third_party/tint/src/transform/glsl.cc",
"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;
Expand Down
2 changes: 1 addition & 1 deletion libs/DirectXShaderCompiler
2 changes: 1 addition & 1 deletion libs/dawn
Submodule dawn updated from bd58e4 to 79ce7c
2 changes: 1 addition & 1 deletion src/dawn/hello_triangle.zig
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ fn frame(params: FrameParams) !void {
var color_attachment = std.mem.zeroes(c.WGPURenderPassColorAttachment);
color_attachment.view = back_buffer_view;
color_attachment.resolveTarget = null;
color_attachment.clearColor = c.WGPUColor{ .r = 0.0, .g = 0.0, .b = 0.0, .a = 0.0 };
color_attachment.clearValue = c.WGPUColor{ .r = 0.0, .g = 0.0, .b = 0.0, .a = 0.0 };
color_attachment.loadOp = c.WGPULoadOp_Clear;
color_attachment.storeOp = c.WGPUStoreOp_Store;
render_pass_info.colorAttachmentCount = 1;
Expand Down

0 comments on commit 5769ddc

Please sign in to comment.