remove Zig example in favor of mach/gpu one

`mach/gpu` has an example of how to use the bindings: https://github.com/hexops/mach/tree/main/gpu/examples

The example here is largely duplicative of that, and doesn't currently build. It would need to be updated
to reflect the latest Dawn example code.

Instead, let's keep `mach/gpu-dawn` just scoped to building Dawn with Zig. `mach/gpu` will deal with using it.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-06 01:46:19 -07:00
parent 0e68ba36eb
commit fbfd2f336b
6 changed files with 10 additions and 535 deletions

View file

@ -11,29 +11,15 @@ pub fn build(b: *Builder) void {
.from_source = b.option(bool, "dawn-from-source", "Build Dawn from source") orelse false,
};
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&testStep(b, mode, target).step);
const dawn_example = b.addExecutable("dawn-example", "src/dawn/hello_triangle.zig");
dawn_example.setBuildMode(mode);
dawn_example.setTarget(target);
link(b, dawn_example, options);
glfw.link(b, dawn_example, .{ .system_sdk = .{ .set_sysroot = false } });
dawn_example.addPackagePath("glfw", "libs/mach-glfw/src/main.zig");
dawn_example.install();
const dawn_example_run_cmd = dawn_example.run();
dawn_example_run_cmd.step.dependOn(b.getInstallStep());
const dawn_example_run_step = b.step("run-dawn-example", "Run the dawn example");
dawn_example_run_step.dependOn(&dawn_example_run_cmd.step);
}
pub fn testStep(b: *std.build.Builder, mode: std.builtin.Mode, target: std.zig.CrossTarget) *std.build.RunStep {
const main_tests = b.addTestExe("gpu-dawn-tests", thisDir() ++ "/src/main.zig");
main_tests.setBuildMode(mode);
main_tests.setTarget(target);
main_tests.install();
return main_tests.run();
// Just to demonstrate/test linking. This is not a functional example, see the mach/gpu examples
// or Dawn C++ examples for functional example code.
const example = b.addExecutable("dawn-example", "src/dawn/dummy.zig");
example.setBuildMode(mode);
example.setTarget(target);
link(b, example, options);
glfw.link(b, example, .{ .system_sdk = .{ .set_sysroot = false } });
example.addPackage(glfw.pkg);
example.install();
}
pub const LinuxWindowManager = enum {