zgpu

git clone git://git.electrosoup.com/zgpu
Log | Files | Refs | Submodules | README

commit 74ccbf67849b247a4c46bb76ba0cce1f09fdfe94
parent ebcb28db0fb23a7e6e145e90d501a54205e4f4c6
Author: Christian Ermann <christianermann@gmail.com>
Date:   Tue,  3 Jun 2025 20:25:02 -0700

Move wgpu bindings into 'wgpu-bindings' module

Diffstat:
Mbuild.zig | 64+++++++++++++---------------------------------------------------
Dsrc/main.zig | 298-------------------------------------------------------------------------------
Dsrc/root.zig | 10----------
Rsrc/adapter.zig -> src/wgpu-bindings/adapter.zig | 0
Rsrc/bind_group_layout.zig -> src/wgpu-bindings/bind_group_layout.zig | 0
Rsrc/c.zig -> src/wgpu-bindings/c.zig | 0
Rsrc/callback.zig -> src/wgpu-bindings/callback.zig | 0
Rsrc/command_buffer.zig -> src/wgpu-bindings/command_buffer.zig | 0
Rsrc/command_encoder.zig -> src/wgpu-bindings/command_encoder.zig | 0
Rsrc/common.zig -> src/wgpu-bindings/common.zig | 0
Rsrc/device.zig -> src/wgpu-bindings/device.zig | 0
Rsrc/instance.zig -> src/wgpu-bindings/instance.zig | 0
Rsrc/logging.zig -> src/wgpu-bindings/logging.zig | 0
Asrc/wgpu-bindings/main.zig | 299+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rsrc/pipeline_layout.zig -> src/wgpu-bindings/pipeline_layout.zig | 0
Rsrc/queue.zig -> src/wgpu-bindings/queue.zig | 0
Rsrc/render_pass.zig -> src/wgpu-bindings/render_pass.zig | 0
Rsrc/render_pipeline.zig -> src/wgpu-bindings/render_pipeline.zig | 0
Asrc/wgpu-bindings/root.zig | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Rsrc/shader_module.zig -> src/wgpu-bindings/shader_module.zig | 0
Rsrc/surface.zig -> src/wgpu-bindings/surface.zig | 0
Rsrc/texture.zig -> src/wgpu-bindings/texture.zig | 0
Rsrc/texture_view.zig -> src/wgpu-bindings/texture_view.zig | 0
23 files changed, 361 insertions(+), 359 deletions(-)

diff --git a/build.zig b/build.zig @@ -15,37 +15,27 @@ pub fn build(b: *std.Build) void { // set a preferred release mode, allowing the user to decide how to optimize. const optimize = b.standardOptimizeOption(.{}); - const lib = b.addStaticLibrary(.{ - .name = "zgpu", - // In this case the main source file is merely a path, however, in more - // complicated build scripts, this could be a generated file. - .root_source_file = b.path("src/root.zig"), - .target = target, - .optimize = optimize, + const glfw = b.addModule("glfw-bindings", .{ + .root_source_file = b.path("src/glfw.zig"), }); - lib.addObjectFile(b.path("lib/libwgpu_native.a")); - lib.addIncludePath(b.path("include")); - lib.linkLibCpp(); + glfw.addIncludePath(b.path("include")); + glfw.addObjectFile(b.path("lib/libglfw3.a")); - // This declares intent for the library to be installed into the standard - // location when the user invokes the "install" step (the default step when - // running `zig build`). - b.installArtifact(lib); + const wgpu = b.addModule("wgpu-bindings", .{ + .root_source_file = b.path("src/wgpu-bindings/root.zig"), + }); + wgpu.addIncludePath(b.path("include")); + wgpu.addObjectFile(b.path("lib/libwgpu_native.a")); const exe = b.addExecutable(.{ - .name = "zgpu", - .root_source_file = b.path("src/main.zig"), + .name = "wgpu-bindings-example", + .root_source_file = b.path("src/wgpu-bindings/main.zig"), .target = target, .optimize = optimize, }); - exe.addObjectFile(b.path("lib/libwgpu_native.a")); - exe.addObjectFile(b.path("lib/libglfw3.a")); - exe.addIncludePath(b.path("include")); + exe.root_module.addImport("glfw", glfw); + exe.root_module.addImport("wgpu", wgpu); exe.linkLibCpp(); - - // This declares intent for the executable to be installed into the - // standard location when the user invokes the "install" step (the default - // step when running `zig build`). b.installArtifact(exe); // This *creates* a Run step in the build graph, to be executed when another @@ -70,32 +60,4 @@ pub fn build(b: *std.Build) void { // This will evaluate the `run` step rather than the default, which is "install". const run_step = b.step("run", "Run the app"); run_step.dependOn(&run_cmd.step); - - // Creates a step for unit testing. This only builds the test executable - // but does not run it. - const lib_unit_tests = b.addTest(.{ - .root_source_file = b.path("src/root.zig"), - .target = target, - .optimize = optimize, - }); - lib_unit_tests.addObjectFile(b.path("lib/libwgpu_native.a")); - lib_unit_tests.addIncludePath(b.path("include")); - lib_unit_tests.linkLibCpp(); - - const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests); - - const exe_unit_tests = b.addTest(.{ - .root_source_file = b.path("src/main.zig"), - .target = target, - .optimize = optimize, - }); - - const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); - - // Similar to creating the run step earlier, this exposes a `test` step to - // the `zig build --help` menu, providing a way for the user to request - // running the unit tests. - const test_step = b.step("test", "Run unit tests"); - test_step.dependOn(&run_lib_unit_tests.step); - test_step.dependOn(&run_exe_unit_tests.step); } diff --git a/src/main.zig b/src/main.zig @@ -1,298 +0,0 @@ -const std = @import("std"); - -const Callback1 = @import("callback.zig").Callback1; -const DeviceCallback = @import("callback.zig").DeviceCallback; -const CommandBuffer = @import("command_buffer.zig").CommandBuffer; -const Device = @import("device.zig"); -const glfw = @import("glfw.zig"); -const Instance = @import("instance.zig").Instance; -const Logging = @import("logging.zig"); -const StringView = @import("common.zig").StringView; - -fn zgpu_log_callback(level: Logging.LogLevel, message: []const u8) void { - switch (level) { - .@"error" => { - std.log.err("[wgpu] {s}", .{message}); - }, - .warn => { - std.log.warn("[wgpu] {s}", .{message}); - }, - .info => { - std.log.debug("[wgpu] {s}", .{message}); - }, - .debug, .trace => { - std.log.debug("[wgpu] {s}", .{message}); - }, - .off => unreachable, - } -} - -fn zgpu_error_callback( - error_type: Device.ErrorType, - message: []const u8, -) void { - std.log.err("[wgpu - {}] {s}", .{ error_type, message }); -} - -fn zgpu_device_lost_callback( - reason: Device.DeviceLostReason, - message: []const u8, -) void { - std.log.err("[wgpu - {}] {s}", .{ reason, message }); -} - -pub fn main() !void { - try glfw.init(); - defer glfw.terminate(); - - glfw.windowHint(.client_api, glfw.ClientApi.no_api); - const window = try glfw.Window.create(640, 480, "Example", null, null); - defer window.destroy(); - const display = try glfw.native.getX11Display(); - const window_id = try glfw.native.getX11Window(window); - - Logging.setLogCallback(Callback1(zgpu_log_callback)); - Logging.setLogLevel(.warn); - - const desc = Instance.Descriptor{ - .next = .{ - .extras = &.{ - .backends = .vulkan, - .flags = .validation, - .dx12_compiler = .undefined, - .gles3_minor_version = .automatic, - .dxil_path = null, - .dxc_path = null, - }, - }, - .features = .{ - .timed_wait_any_enable = false, - .timed_wait_any_max_count = 0, - }, - }; - - const instance = Instance.create(&desc) orelse { - std.log.err("failed to create GPU instance", .{}); - std.process.exit(1); - }; - defer instance.release(); - - const surface = instance.createSurface(&.{ - .next = .{ - .from_xlib_window = &.{ - .window = window_id, - .display = display, - }, - }, - .label = StringView.fromSlice("Example Surface"), - }) orelse { - std.log.err("failed to create GPU surface", .{}); - std.process.exit(1); - }; - defer surface.release(); - - const adapter = try instance.requestAdapter(&.{ - .feature_level = .core, - .power_preference = .high_performance, - .backend_type = .vulkan, - .force_fallback_adapter = false, - .compatible_surface = surface, - }); - defer adapter.release(); - - const device = try adapter.requestDevice(&.{ - .label = StringView.fromSlice("Example Device"), - .required_feature_count = 0, - .required_features = null, - .required_limits = null, - .default_queue = .{ - .label = StringView.fromSlice("Example Default Queue"), - }, - .device_lost_callback_info = .{ - .callback = DeviceCallback(zgpu_device_lost_callback), - .mode = .allow_spontaneous, - .userdata1 = null, - .userdata2 = null, - }, - .uncaptured_error_callback_info = .{ - .callback = DeviceCallback(zgpu_error_callback), - .userdata1 = null, - .userdata2 = null, - }, - }); - defer device.release(); - - const queue = device.getQueue(); - defer queue.release(); - - surface.configure(&.{ - .device = device, - .format = .bgra8_unorm, - .usage = .{ .render_attachment = true }, - .width = 640, - .height = 480, - .view_format_count = 0, - .view_formats = null, - .alpha_mode = .auto, - .present_mode = .fifo, - }); - - const vs = - \\ @vertex fn main( - \\ @builtin(vertex_index) vtx_idx : u32 - \\ ) -> @builtin(position) vec4<f32> { - \\ let x = f32(i32(vtx_idx) - 1); - \\ let y = f32(i32(vtx_idx & 1u) * 2 - 1); - \\ return vec4<f32>(x, y, 0.0, 1.0); - \\ } - ; - const vs_module = device.createShaderModule(&.{ - .next = .{ .wgsl = &.{ .code = StringView.fromSlice(vs) } }, - .label = StringView.fromSlice("Example Vertex Shader"), - }) orelse { - std.log.err("failed to compile vertex shader", .{}); - std.process.exit(1); - }; - defer vs_module.release(); - - const fs = - \\ @fragment fn main() -> @location(0) vec4<f32> { - \\ return vec4<f32>(1.0, 0.0, 0.0, 1.0); - \\ } - ; - const fs_module = device.createShaderModule(&.{ - .next = .{ .wgsl = &.{ .code = StringView.fromSlice(fs) } }, - .label = StringView.fromSlice("Example Fragment Shader"), - }) orelse { - std.log.err("failed to compile fragment shader", .{}); - std.process.exit(1); - }; - defer fs_module.release(); - - const pipeline_layout = device.createPipelineLayout(&.{ - .label = StringView.fromSlice("Example Pipeline Layout"), - .bind_group_layout_count = 0, - .bind_group_layouts = null, - }).?; - defer pipeline_layout.release(); - - const pipeline = device.createRenderPipeline(&.{ - .label = StringView.fromSlice("Example Render Pipeline"), - .layout = pipeline_layout, - .vertex = .{ - .module = vs_module, - .entry_point = StringView.fromSlice("main"), - .constant_count = 0, - .constants = null, - .buffer_count = 0, - .buffers = null, - }, - .primitive = .{ - .topology = .triangle_list, - .strip_index_format = .undefined, - .front_face = .ccw, - .cull_mode = .none, - .unclipped_depth = false, - }, - .depth_stencil = null, - .multisample = .{ - .count = 1, - .mask = 0xFFFFFFFF, - .alpha_to_coverage_enabled = false, - }, - .fragment_state = &.{ - .module = fs_module, - .entry_point = StringView.fromSlice("main"), - .constant_count = 0, - .constants = null, - .target_count = 1, - .targets = &.{ - .{ - .format = .bgra8_unorm, - .blend = &.{ - .color = .{ - .operation = .add, - .src_factor = .one, - .dst_factor = .zero, - }, - .alpha = .{ - .operation = .add, - .src_factor = .one, - .dst_factor = .zero, - }, - }, - .write_mask = .{ - .red = true, - .green = true, - .blue = true, - .alpha = true, - }, - }, - }, - }, - }) orelse { - std.log.err("failed to create render pipeline", .{}); - std.process.exit(1); - }; - defer pipeline.release(); - - while (!window.shouldClose()) { - glfw.pollEvents(); - const current_texture = surface.getCurrentTexture(); - const texture = current_texture.texture; - defer texture.release(); - const view = texture.createView(&.{ - .label = StringView.fromSlice("Example View"), - .format = .bgra8_unorm, - .dimension = .@"2d", - .base_mip_level = 0, - .mip_level_count = 1, - .base_array_layer = 0, - .array_layer_count = 1, - .aspect = .all, - .usage = .{ .render_attachment = true }, - }).?; - defer view.release(); - { - const encoder = device.createCommandEncoder(&.{ - .label = StringView.fromSlice("Example Encoder"), - }).?; - defer encoder.release(); - { - const pass = encoder.beginRenderPass(&.{ - .label = StringView.fromSlice("Example Render Pass"), - .color_attachment_count = 1, - .color_attachments = &.{ - .{ - .view = view, - .resolve_target = null, - .load_op = .clear, - .store_op = .store, - .clear_value = .{ .r = 1, .g = 1, .b = 1, .a = 1 }, - }, - }, - .depth_stencil_attachment = null, - .occlusion_query_set = null, - .timestamp_writes = null, - }); - - pass.setPipeline(pipeline); - pass.draw(3, 1, 0, 0); - - defer pass.release(); - defer pass.end(); - } - { - var command = encoder.finish(&.{ - .label = StringView.fromSlice("Example Command Buffer"), - }).?; - defer command.release(); - queue.submit(&[_]*CommandBuffer{command}); - } - } - switch (surface.present()) { - .success => {}, - .@"error" => std.log.err("surface presentation failed", .{}), - } - } -} diff --git a/src/root.zig b/src/root.zig @@ -1,10 +0,0 @@ -const std = @import("std"); -const testing = std.testing; - -const Instance = @import("instance.zig").Instance; - -test "create instance" { - const instance = Instance.create(null); - try testing.expect(instance != null); - instance.?.release(); -} diff --git a/src/adapter.zig b/src/wgpu-bindings/adapter.zig diff --git a/src/bind_group_layout.zig b/src/wgpu-bindings/bind_group_layout.zig diff --git a/src/c.zig b/src/wgpu-bindings/c.zig diff --git a/src/callback.zig b/src/wgpu-bindings/callback.zig diff --git a/src/command_buffer.zig b/src/wgpu-bindings/command_buffer.zig diff --git a/src/command_encoder.zig b/src/wgpu-bindings/command_encoder.zig diff --git a/src/common.zig b/src/wgpu-bindings/common.zig diff --git a/src/device.zig b/src/wgpu-bindings/device.zig diff --git a/src/instance.zig b/src/wgpu-bindings/instance.zig diff --git a/src/logging.zig b/src/wgpu-bindings/logging.zig diff --git a/src/wgpu-bindings/main.zig b/src/wgpu-bindings/main.zig @@ -0,0 +1,299 @@ +const std = @import("std"); + +const glfw = @import("glfw"); +const wgpu = @import("wgpu"); + +const Callback1 = wgpu.Callback1; +const DeviceCallback = wgpu.DeviceCallback; +const CommandBuffer = wgpu.CommandBuffer; +const Device = wgpu.Device; +const Instance = wgpu.Instance; +const StringView = wgpu.StringView; + +fn zgpu_log_callback(level: wgpu.LogLevel, message: []const u8) void { + switch (level) { + .@"error" => { + std.log.err("[wgpu] {s}", .{message}); + }, + .warn => { + std.log.warn("[wgpu] {s}", .{message}); + }, + .info => { + std.log.debug("[wgpu] {s}", .{message}); + }, + .debug, .trace => { + std.log.debug("[wgpu] {s}", .{message}); + }, + .off => unreachable, + } +} + +fn zgpu_error_callback( + error_type: wgpu.ErrorType, + message: []const u8, +) void { + std.log.err("[wgpu - {}] {s}", .{ error_type, message }); +} + +fn zgpu_device_lost_callback( + reason: wgpu.DeviceLostReason, + message: []const u8, +) void { + std.log.err("[wgpu - {}] {s}", .{ reason, message }); +} + +pub fn main() !void { + try glfw.init(); + defer glfw.terminate(); + + glfw.windowHint(.client_api, glfw.ClientApi.no_api); + const window = try glfw.Window.create(640, 480, "Example", null, null); + defer window.destroy(); + const display = try glfw.native.getX11Display(); + const window_id = try glfw.native.getX11Window(window); + + wgpu.setLogCallback(Callback1(zgpu_log_callback)); + wgpu.setLogLevel(.warn); + + const desc = Instance.Descriptor{ + .next = .{ + .extras = &.{ + .backends = .vulkan, + .flags = .validation, + .dx12_compiler = .undefined, + .gles3_minor_version = .automatic, + .dxil_path = null, + .dxc_path = null, + }, + }, + .features = .{ + .timed_wait_any_enable = false, + .timed_wait_any_max_count = 0, + }, + }; + + const instance = Instance.create(&desc) orelse { + std.log.err("failed to create GPU instance", .{}); + std.process.exit(1); + }; + defer instance.release(); + + const surface = instance.createSurface(&.{ + .next = .{ + .from_xlib_window = &.{ + .window = window_id, + .display = display, + }, + }, + .label = StringView.fromSlice("Example Surface"), + }) orelse { + std.log.err("failed to create GPU surface", .{}); + std.process.exit(1); + }; + defer surface.release(); + + const adapter = try instance.requestAdapter(&.{ + .feature_level = .core, + .power_preference = .high_performance, + .backend_type = .vulkan, + .force_fallback_adapter = false, + .compatible_surface = surface, + }); + defer adapter.release(); + + const device = try adapter.requestDevice(&.{ + .label = StringView.fromSlice("Example Device"), + .required_feature_count = 0, + .required_features = null, + .required_limits = null, + .default_queue = .{ + .label = StringView.fromSlice("Example Default Queue"), + }, + .device_lost_callback_info = .{ + .callback = DeviceCallback(zgpu_device_lost_callback), + .mode = .allow_spontaneous, + .userdata1 = null, + .userdata2 = null, + }, + .uncaptured_error_callback_info = .{ + .callback = DeviceCallback(zgpu_error_callback), + .userdata1 = null, + .userdata2 = null, + }, + }); + defer device.release(); + + const queue = device.getQueue(); + defer queue.release(); + + surface.configure(&.{ + .device = device, + .format = .bgra8_unorm, + .usage = .{ .render_attachment = true }, + .width = 640, + .height = 480, + .view_format_count = 0, + .view_formats = null, + .alpha_mode = .auto, + .present_mode = .fifo, + }); + + const vs = + \\ @vertex fn main( + \\ @builtin(vertex_index) vtx_idx : u32 + \\ ) -> @builtin(position) vec4<f32> { + \\ let x = f32(i32(vtx_idx) - 1); + \\ let y = f32(i32(vtx_idx & 1u) * 2 - 1); + \\ return vec4<f32>(x, y, 0.0, 1.0); + \\ } + ; + const vs_module = device.createShaderModule(&.{ + .next = .{ .wgsl = &.{ .code = StringView.fromSlice(vs) } }, + .label = StringView.fromSlice("Example Vertex Shader"), + }) orelse { + std.log.err("failed to compile vertex shader", .{}); + std.process.exit(1); + }; + defer vs_module.release(); + + const fs = + \\ @fragment fn main() -> @location(0) vec4<f32> { + \\ return vec4<f32>(1.0, 0.0, 0.0, 1.0); + \\ } + ; + const fs_module = device.createShaderModule(&.{ + .next = .{ .wgsl = &.{ .code = StringView.fromSlice(fs) } }, + .label = StringView.fromSlice("Example Fragment Shader"), + }) orelse { + std.log.err("failed to compile fragment shader", .{}); + std.process.exit(1); + }; + defer fs_module.release(); + + const pipeline_layout = device.createPipelineLayout(&.{ + .label = StringView.fromSlice("Example Pipeline Layout"), + .bind_group_layout_count = 0, + .bind_group_layouts = null, + }).?; + defer pipeline_layout.release(); + + const pipeline = device.createRenderPipeline(&.{ + .label = StringView.fromSlice("Example Render Pipeline"), + .layout = pipeline_layout, + .vertex = .{ + .module = vs_module, + .entry_point = StringView.fromSlice("main"), + .constant_count = 0, + .constants = null, + .buffer_count = 0, + .buffers = null, + }, + .primitive = .{ + .topology = .triangle_list, + .strip_index_format = .undefined, + .front_face = .ccw, + .cull_mode = .none, + .unclipped_depth = false, + }, + .depth_stencil = null, + .multisample = .{ + .count = 1, + .mask = 0xFFFFFFFF, + .alpha_to_coverage_enabled = false, + }, + .fragment_state = &.{ + .module = fs_module, + .entry_point = StringView.fromSlice("main"), + .constant_count = 0, + .constants = null, + .target_count = 1, + .targets = &.{ + .{ + .format = .bgra8_unorm, + .blend = &.{ + .color = .{ + .operation = .add, + .src_factor = .one, + .dst_factor = .zero, + }, + .alpha = .{ + .operation = .add, + .src_factor = .one, + .dst_factor = .zero, + }, + }, + .write_mask = .{ + .red = true, + .green = true, + .blue = true, + .alpha = true, + }, + }, + }, + }, + }) orelse { + std.log.err("failed to create render pipeline", .{}); + std.process.exit(1); + }; + defer pipeline.release(); + + while (!window.shouldClose()) { + glfw.pollEvents(); + const current_texture = surface.getCurrentTexture(); + const texture = current_texture.texture; + defer texture.release(); + const view = texture.createView(&.{ + .label = StringView.fromSlice("Example View"), + .format = .bgra8_unorm, + .dimension = .@"2d", + .base_mip_level = 0, + .mip_level_count = 1, + .base_array_layer = 0, + .array_layer_count = 1, + .aspect = .all, + .usage = .{ .render_attachment = true }, + }).?; + defer view.release(); + { + const encoder = device.createCommandEncoder(&.{ + .label = StringView.fromSlice("Example Encoder"), + }).?; + defer encoder.release(); + { + const pass = encoder.beginRenderPass(&.{ + .label = StringView.fromSlice("Example Render Pass"), + .color_attachment_count = 1, + .color_attachments = &.{ + .{ + .view = view, + .resolve_target = null, + .load_op = .clear, + .store_op = .store, + .clear_value = .{ .r = 1, .g = 1, .b = 1, .a = 1 }, + }, + }, + .depth_stencil_attachment = null, + .occlusion_query_set = null, + .timestamp_writes = null, + }); + + pass.setPipeline(pipeline); + pass.draw(3, 1, 0, 0); + + defer pass.release(); + defer pass.end(); + } + { + var command = encoder.finish(&.{ + .label = StringView.fromSlice("Example Command Buffer"), + }).?; + defer command.release(); + queue.submit(&[_]*CommandBuffer{command}); + } + } + switch (surface.present()) { + .success => {}, + .@"error" => std.log.err("surface presentation failed", .{}), + } + } +} diff --git a/src/pipeline_layout.zig b/src/wgpu-bindings/pipeline_layout.zig diff --git a/src/queue.zig b/src/wgpu-bindings/queue.zig diff --git a/src/render_pass.zig b/src/wgpu-bindings/render_pass.zig diff --git a/src/render_pipeline.zig b/src/wgpu-bindings/render_pipeline.zig diff --git a/src/wgpu-bindings/root.zig b/src/wgpu-bindings/root.zig @@ -0,0 +1,49 @@ +const std = @import("std"); + +const c = @import("c.zig"); + +const common = @import("common.zig"); +pub const ChainedStruct = common.ChainedStruct; +pub const Color = common.Color; +pub const CompareFunction = common.CompareFunction; +pub const IndexFormat = common.IndexFormat; +pub const LoadOp = common.LoadOp; +pub const OptionalBool = common.OptionalBool; +pub const Status = common.Status; +pub const StoreOp = common.StoreOp; +pub const StructType = common.StructType; +pub const StringView = common.StringView; + +const callback = @import("callback.zig"); +pub const Callback1 = callback.Callback1; +pub const DeviceCallback = callback.DeviceCallback; + +const device = @import("device.zig"); +pub const Device = device.Device; +pub const DeviceLostReason = device.DeviceLostReason; +pub const ErrorType = device.ErrorType; + +const instance = @import("instance.zig"); +pub const Instance = instance.Instance; +pub const RequestAdapterOptions = instance.RequestAdapterOptions; + +const logging = @import("logging.zig"); +pub const setLogCallback = logging.setLogCallback; +pub const setLogLevel = logging.setLogLevel; +pub const LogLevel = logging.LogLevel; + +const render_pass = @import("render_pass.zig"); +pub const RenderPass = render_pass.RenderPass; +pub const RenderPassEncoder = render_pass.RenderPassEncoder; + +pub const Adapter = @import("adapter.zig").Adapter; +pub const BindGroupLayout = @import("bind_group_layout.zig").BindGroupLayout; +pub const CommandBuffer = @import("command_buffer.zig").CommandBuffer; +pub const CommandEncoder = @import("command_encoder.zig").CommandEncoder; +pub const PipelineLayout = @import("pipeline_layout.zig").PipelineLayout; +pub const Queue = @import("queue.zig").Queue; +pub const RenderPipeline = @import("render_pipeline.zig").RenderPipeline; +pub const ShaderModule = @import("shader_module.zig").ShaderModule; +pub const Surface = @import("surface.zig").Surface; +pub const Texture = @import("texture.zig").Texture; +pub const TextureView = @import("texture_view.zig").TextureView; diff --git a/src/shader_module.zig b/src/wgpu-bindings/shader_module.zig diff --git a/src/surface.zig b/src/wgpu-bindings/surface.zig diff --git a/src/texture.zig b/src/wgpu-bindings/texture.zig diff --git a/src/texture_view.zig b/src/wgpu-bindings/texture_view.zig