gpu: implement RenderPassEncoder.setViewport
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
1db208d2df
commit
d707d7e2e2
2 changed files with 34 additions and 31 deletions
|
|
@ -1062,22 +1062,27 @@ const render_pass_encoder_vtable = RenderPassEncoder.VTable{
|
|||
);
|
||||
}
|
||||
}).setVertexBuffer,
|
||||
// .setViewport = (struct {
|
||||
// pub fn setViewport(
|
||||
// ptr: *anyopaque,
|
||||
// x: f32,
|
||||
// y: f32,
|
||||
// width: f32,
|
||||
// height: f32,
|
||||
// min_depth: f32,
|
||||
// max_depth: f32,
|
||||
// ) void {
|
||||
// c.wgpuRenderPassEncoderSetViewport(
|
||||
// @ptrCast(c.WGPURenderPassEncoder, ptr),
|
||||
// x, y, width, height, min_depth, max_depth,
|
||||
// );
|
||||
// }
|
||||
// }).setViewport,
|
||||
.setViewport = (struct {
|
||||
pub fn setViewport(
|
||||
ptr: *anyopaque,
|
||||
x: f32,
|
||||
y: f32,
|
||||
width: f32,
|
||||
height: f32,
|
||||
min_depth: f32,
|
||||
max_depth: f32,
|
||||
) void {
|
||||
c.wgpuRenderPassEncoderSetViewport(
|
||||
@ptrCast(c.WGPURenderPassEncoder, ptr),
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height,
|
||||
min_depth,
|
||||
max_depth,
|
||||
);
|
||||
}
|
||||
}).setViewport,
|
||||
// .writeTimestamp = (struct {
|
||||
// pub fn writeTimestamp(ptr: *anyopaque, query_set: QuerySet, query_index: u32) void {
|
||||
// c.wgpuRenderPassEncoderWriteTimestamp(
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ pub const VTable = struct {
|
|||
setScissorRect: fn (ptr: *anyopaque, x: u32, y: u32, width: u32, height: u32) void,
|
||||
setStencilReference: fn (ptr: *anyopaque, reference: u32) void,
|
||||
setVertexBuffer: fn (ptr: *anyopaque, slot: u32, buffer: Buffer, offset: u64, size: u64) void,
|
||||
// setViewport: fn (ptr: *anyopaque, x: f32, y: f32, width: f32, height: f32, min_depth: f32, max_depth: f32) void,
|
||||
setViewport: fn (ptr: *anyopaque, x: f32, y: f32, width: f32, height: f32, min_depth: f32, max_depth: f32) void,
|
||||
// writeTimestamp: fn (ptr: *anyopaque, query_set: QuerySet, query_index: u32) void,
|
||||
};
|
||||
|
||||
|
|
@ -163,19 +163,17 @@ pub inline fn setVertexBuffer(
|
|||
pass.vtable.setVertexBuffer(pass.ptr, slot, buffer, offset, size);
|
||||
}
|
||||
|
||||
// pub inline fn setViewport(
|
||||
// pass: RenderPassEncoder,
|
||||
// x: f32,
|
||||
// y: f32,
|
||||
// width: f32,
|
||||
// height: f32,
|
||||
// min_depth: f32,
|
||||
// max_depth: f32,
|
||||
// ) void {
|
||||
// pass.vtable.setViewport(pass.ptr, x, y, width, height, min_depth, max_depth);
|
||||
// }
|
||||
// // setViewport: fn (ptr: *anyopaque, x: f32, y: f32, width: f32, height: f32, min_depth: f32, max_depth: f32) void,
|
||||
// // WGPU_EXPORT void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth);
|
||||
pub inline fn setViewport(
|
||||
pass: RenderPassEncoder,
|
||||
x: f32,
|
||||
y: f32,
|
||||
width: f32,
|
||||
height: f32,
|
||||
min_depth: f32,
|
||||
max_depth: f32,
|
||||
) void {
|
||||
pass.vtable.setViewport(pass.ptr, x, y, width, height, min_depth, max_depth);
|
||||
}
|
||||
|
||||
// pub inline fn writeTimestamp(pass: RenderPassEncoder, query_set: QuerySet, query_index: u32) void {
|
||||
// pass.vtable.writeTimestamp(pass.ptr, query_set, query_index);
|
||||
|
|
@ -214,7 +212,7 @@ test {
|
|||
_ = setPipeline;
|
||||
_ = setStencilReference;
|
||||
_ = setVertexBuffer;
|
||||
// _ = setViewport;
|
||||
_ = setViewport;
|
||||
// _ = writeTimestamp;
|
||||
_ = Descriptor;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue