gpu: examples: use latest friendlier APIs

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-01 00:52:44 -07:00 committed by Stephen Gutekanst
parent ab71c7fd93
commit f856fccb76
2 changed files with 23 additions and 27 deletions

View file

@ -50,10 +50,9 @@ pub fn main() !void {
\\ }
;
const vs_module = setup.device.createShaderModule(&.{
.next_in_chain = @ptrCast(*const gpu.ChainedStruct, &gpu.ShaderModule.WGSLDescriptor{
.chain = .{ .next = null, .s_type = .shader_module_wgsl_descriptor },
.next_in_chain = .{ .wgsl_descriptor = &.{
.source = vs,
}),
} },
.label = "my vertex shader",
});
@ -63,10 +62,9 @@ pub fn main() !void {
\\ }
;
const fs_module = setup.device.createShaderModule(&.{
.next_in_chain = @ptrCast(*const gpu.ChainedStruct, &gpu.ShaderModule.WGSLDescriptor{
.chain = .{ .next = null, .s_type = .shader_module_wgsl_descriptor },
.next_in_chain = .{ .wgsl_descriptor = &.{
.source = fs,
}),
} },
.label = "my fragment shader",
});