gpu: implement CommandEncoder.copyTextureToTexture
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
de9cc72c47
commit
5cf71dae3d
2 changed files with 26 additions and 2 deletions
|
|
@ -23,8 +23,7 @@ pub const VTable = struct {
|
||||||
copyBufferToBuffer: fn (ptr: *anyopaque, source: Buffer, source_offset: u64, destination: Buffer, destination_offset: u64, size: u64) void,
|
copyBufferToBuffer: fn (ptr: *anyopaque, source: Buffer, source_offset: u64, destination: Buffer, destination_offset: u64, size: u64) void,
|
||||||
copyBufferToTexture: fn (ptr: *anyopaque, source: *const ImageCopyBuffer, destination: *const ImageCopyTexture, copy_size: *const Extent3D) void,
|
copyBufferToTexture: fn (ptr: *anyopaque, source: *const ImageCopyBuffer, destination: *const ImageCopyTexture, copy_size: *const Extent3D) void,
|
||||||
copyTextureToBuffer: fn (ptr: *anyopaque, source: *const ImageCopyTexture, destination: *const ImageCopyBuffer, copy_size: *const Extent3D) void,
|
copyTextureToBuffer: fn (ptr: *anyopaque, source: *const ImageCopyTexture, destination: *const ImageCopyBuffer, copy_size: *const Extent3D) void,
|
||||||
// copyTextureToTexture: fn (ptr: *anyopaque, source: *const ImageCopyTexture, destination: *const ImageCopyTexture, copy_size: *const Extent3D) void,
|
copyTextureToTexture: fn (ptr: *anyopaque, source: *const ImageCopyTexture, destination: *const ImageCopyTexture, copy_size: *const Extent3D) void,
|
||||||
// WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize);
|
|
||||||
finish: fn (ptr: *anyopaque, descriptor: ?*const CommandBuffer.Descriptor) CommandBuffer,
|
finish: fn (ptr: *anyopaque, descriptor: ?*const CommandBuffer.Descriptor) CommandBuffer,
|
||||||
// injectValidationError: fn (ptr: *anyopaque, message: [*:0]const u8) void,
|
// injectValidationError: fn (ptr: *anyopaque, message: [*:0]const u8) void,
|
||||||
// WGPU_EXPORT void wgpuCommandEncoderInjectValidationError(WGPUCommandEncoder commandEncoder, char const * message);
|
// WGPU_EXPORT void wgpuCommandEncoderInjectValidationError(WGPUCommandEncoder commandEncoder, char const * message);
|
||||||
|
|
@ -88,6 +87,15 @@ pub inline fn copyTextureToBuffer(
|
||||||
enc.vtable.copyTextureToBuffer(enc.ptr, source, destination, copy_size);
|
enc.vtable.copyTextureToBuffer(enc.ptr, source, destination, copy_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub inline fn copyTextureToTexture(
|
||||||
|
enc: CommandEncoder,
|
||||||
|
source: *const ImageCopyTexture,
|
||||||
|
destination: *const ImageCopyTexture,
|
||||||
|
copy_size: *const Extent3D,
|
||||||
|
) void {
|
||||||
|
enc.vtable.copyTextureToTexture(enc.ptr, source, destination, copy_size);
|
||||||
|
}
|
||||||
|
|
||||||
pub inline fn finish(enc: CommandEncoder, descriptor: ?*const CommandBuffer.Descriptor) CommandBuffer {
|
pub inline fn finish(enc: CommandEncoder, descriptor: ?*const CommandBuffer.Descriptor) CommandBuffer {
|
||||||
return enc.vtable.finish(enc.ptr, descriptor);
|
return enc.vtable.finish(enc.ptr, descriptor);
|
||||||
}
|
}
|
||||||
|
|
@ -126,6 +134,7 @@ test {
|
||||||
_ = copyBufferToBuffer;
|
_ = copyBufferToBuffer;
|
||||||
_ = copyBufferToTexture;
|
_ = copyBufferToTexture;
|
||||||
_ = copyTextureToBuffer;
|
_ = copyTextureToBuffer;
|
||||||
|
_ = copyTextureToTexture;
|
||||||
_ = finish;
|
_ = finish;
|
||||||
_ = insertDebugMarker;
|
_ = insertDebugMarker;
|
||||||
_ = popDebugGroup;
|
_ = popDebugGroup;
|
||||||
|
|
|
||||||
|
|
@ -1669,6 +1669,21 @@ const command_encoder_vtable = CommandEncoder.VTable{
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}).copyTextureToBuffer,
|
}).copyTextureToBuffer,
|
||||||
|
.copyTextureToTexture = (struct {
|
||||||
|
pub fn copyTextureToTexture(
|
||||||
|
ptr: *anyopaque,
|
||||||
|
source: *const ImageCopyTexture,
|
||||||
|
destination: *const ImageCopyTexture,
|
||||||
|
copy_size: *const Extent3D,
|
||||||
|
) void {
|
||||||
|
c.wgpuCommandEncoderCopyTextureToTexture(
|
||||||
|
@ptrCast(c.WGPUCommandEncoder, ptr),
|
||||||
|
&convertImageCopyTexture(source),
|
||||||
|
&convertImageCopyTexture(destination),
|
||||||
|
@ptrCast(*const c.WGPUExtent3D, copy_size),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}).copyTextureToTexture,
|
||||||
.popDebugGroup = (struct {
|
.popDebugGroup = (struct {
|
||||||
pub fn popDebugGroup(ptr: *anyopaque) void {
|
pub fn popDebugGroup(ptr: *anyopaque) void {
|
||||||
c.wgpuCommandEncoderPopDebugGroup(@ptrCast(c.WGPUCommandEncoder, ptr));
|
c.wgpuCommandEncoderPopDebugGroup(@ptrCast(c.WGPUCommandEncoder, ptr));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue