gpu: implement CommandEncoder.finish
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
071100a61e
commit
143567e1c0
2 changed files with 15 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
const RenderPassEncoder = @import("RenderPassEncoder.zig");
|
||||
const CommandBuffer = @import("CommandBuffer.zig");
|
||||
|
||||
const CommandEncoder = @This();
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ pub const VTable = struct {
|
|||
// WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize);
|
||||
// WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize);
|
||||
// WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTextureInternal(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize);
|
||||
// WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPUCommandBufferDescriptor const * descriptor);
|
||||
finish: fn (ptr: *anyopaque, descriptor: ?*const CommandBuffer.Descriptor) CommandBuffer,
|
||||
// WGPU_EXPORT void wgpuCommandEncoderInjectValidationError(WGPUCommandEncoder commandEncoder, char const * message);
|
||||
// WGPU_EXPORT void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, char const * markerLabel);
|
||||
// WGPU_EXPORT void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder);
|
||||
|
|
@ -38,6 +39,10 @@ pub inline fn release(enc: CommandEncoder) void {
|
|||
enc.vtable.release(enc.ptr);
|
||||
}
|
||||
|
||||
pub inline fn finish(enc: CommandEncoder, descriptor: ?*const CommandBuffer.Descriptor) CommandBuffer {
|
||||
return enc.vtable.finish(enc.ptr, descriptor);
|
||||
}
|
||||
|
||||
pub inline fn setLabel(enc: CommandEncoder, label: [:0]const u8) void {
|
||||
enc.vtable.setLabel(enc.ptr, label);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1006,6 +1006,15 @@ const command_encoder_vtable = CommandEncoder.VTable{
|
|||
c.wgpuCommandEncoderRelease(@ptrCast(c.WGPUCommandEncoder, ptr));
|
||||
}
|
||||
}).release,
|
||||
.finish = (struct {
|
||||
pub fn finish(ptr: *anyopaque, descriptor: ?*const CommandBuffer.Descriptor) CommandBuffer {
|
||||
const desc: ?*c.WGPUCommandBufferDescriptor = if (descriptor) |d| &.{
|
||||
.nextInChain = null,
|
||||
.label = if (d.label) |l| l else "",
|
||||
} else null;
|
||||
return wrapCommandBuffer(c.wgpuCommandEncoderFinish(@ptrCast(c.WGPUCommandEncoder, ptr), desc));
|
||||
}
|
||||
}).finish,
|
||||
.setLabel = (struct {
|
||||
pub fn setLabel(ptr: *anyopaque, label: [:0]const u8) void {
|
||||
c.wgpuCommandEncoderSetLabel(@ptrCast(c.WGPUCommandEncoder, ptr), label);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue