WebGPU wrapper wip: remove unnecessary object copying
This commit is contained in:
parent
e8b9d18d05
commit
2d8be7560b
4 changed files with 18 additions and 18 deletions
|
|
@ -33,10 +33,10 @@ namespace psemek::wgpu
|
|||
std::optional<struct timestamp_writes> timestamp_writes = {};
|
||||
};
|
||||
|
||||
void set_bind_group(std::uint32_t group_index, bind_group group, std::vector<std::uint32_t> const & dynamic_offsets);
|
||||
void set_pipeline(compute_pipeline pipeline);
|
||||
void set_bind_group(std::uint32_t group_index, bind_group const & group, std::vector<std::uint32_t> const & dynamic_offsets);
|
||||
void set_pipeline(compute_pipeline const & pipeline);
|
||||
void dispatch_workgroups(geom::vector<std::uint32_t, 3> const & workgroup_count);
|
||||
void dispatch_workgroups_indirect(buffer indirect_buffer, std::uint64_t offset);
|
||||
void dispatch_workgroups_indirect(buffer const & indirect_buffer, std::uint64_t offset);
|
||||
void insert_debug_marker(std::string const & marker_label);
|
||||
void push_debug_group(std::string const & group_label);
|
||||
void pop_debug_group();
|
||||
|
|
|
|||
|
|
@ -77,18 +77,18 @@ namespace psemek::wgpu
|
|||
std::optional<struct timestamp_writes> timestamp_writes = {};
|
||||
};
|
||||
|
||||
void set_pipeline(render_pipeline pipeline);
|
||||
void set_bind_group(std::uint32_t group_index, bind_group group, std::vector<std::uint32_t> const & dynamic_offsets);
|
||||
void set_vertex_buffer(std::uint32_t slot, buffer buffer, std::uint64_t offset, std::uint64_t size);
|
||||
void set_index_buffer(buffer buffer, index_format format, std::uint64_t offset, std::uint64_t size);
|
||||
void set_pipeline(render_pipeline const & pipeline);
|
||||
void set_bind_group(std::uint32_t group_index, bind_group const & group, std::vector<std::uint32_t> const & dynamic_offsets);
|
||||
void set_vertex_buffer(std::uint32_t slot, buffer const & buffer, std::uint64_t offset, std::uint64_t size);
|
||||
void set_index_buffer(buffer const & buffer, index_format format, std::uint64_t offset, std::uint64_t size);
|
||||
void set_viewport(geom::box<float, 3> const & viewport);
|
||||
void set_scissor_rect(geom::box<std::uint32_t, 2> const & rect);
|
||||
void set_blend_constant(geom::vector<double, 4> const & color);
|
||||
void set_stencil_reference(std::uint32_t reference);
|
||||
void draw(std::uint32_t vertex_count, std::uint32_t instance_count, std::uint32_t first_vertex, std::uint32_t first_instance);
|
||||
void draw_indexed(std::uint32_t index_count, std::uint32_t instance_count, std::uint32_t first_index, std::uint32_t base_vertex, std::uint32_t first_instance);
|
||||
void draw_indirect(buffer indirect_buffer, std::uint64_t offset);
|
||||
void draw_indexed_indirect(buffer indirect_buffer, std::uint64_t offset);
|
||||
void draw_indirect(buffer const & indirect_buffer, std::uint64_t offset);
|
||||
void draw_indexed_indirect(buffer const & indirect_buffer, std::uint64_t offset);
|
||||
void execute_bundles(std::vector<render_bundle> const & bundles);
|
||||
void begin_occlusion_query(std::uint32_t query_index);
|
||||
void end_occlusion_query();
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
namespace psemek::wgpu
|
||||
{
|
||||
|
||||
void compute_pass_encoder::set_bind_group(std::uint32_t group_index, bind_group group, std::vector<std::uint32_t> const & dynamic_offsets)
|
||||
void compute_pass_encoder::set_bind_group(std::uint32_t group_index, bind_group const & group, std::vector<std::uint32_t> const & dynamic_offsets)
|
||||
{
|
||||
wgpuComputePassEncoderSetBindGroup((WGPUComputePassEncoder)get(), group_index, (WGPUBindGroup)group.get(), dynamic_offsets.size(), dynamic_offsets.data());
|
||||
}
|
||||
|
||||
void compute_pass_encoder::set_pipeline(compute_pipeline pipeline)
|
||||
void compute_pass_encoder::set_pipeline(compute_pipeline const & pipeline)
|
||||
{
|
||||
wgpuComputePassEncoderSetPipeline((WGPUComputePassEncoder)get(), (WGPUComputePipeline)pipeline.get());
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ namespace psemek::wgpu
|
|||
wgpuComputePassEncoderDispatchWorkgroups((WGPUComputePassEncoder)get(), workgroup_count[0], workgroup_count[1], workgroup_count[2]);
|
||||
}
|
||||
|
||||
void compute_pass_encoder::dispatch_workgroups_indirect(buffer indirect_buffer, std::uint64_t offset)
|
||||
void compute_pass_encoder::dispatch_workgroups_indirect(buffer const & indirect_buffer, std::uint64_t offset)
|
||||
{
|
||||
wgpuComputePassEncoderDispatchWorkgroupsIndirect((WGPUComputePassEncoder)get(), (WGPUBuffer)indirect_buffer.get(), offset);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,22 +4,22 @@
|
|||
namespace psemek::wgpu
|
||||
{
|
||||
|
||||
void render_pass_encoder::set_pipeline(render_pipeline pipeline)
|
||||
void render_pass_encoder::set_pipeline(render_pipeline const & pipeline)
|
||||
{
|
||||
wgpuRenderPassEncoderSetPipeline((WGPURenderPassEncoder)get(), (WGPURenderPipeline)pipeline.get());
|
||||
}
|
||||
|
||||
void render_pass_encoder::set_bind_group(std::uint32_t group_index, bind_group group, std::vector<std::uint32_t> const & dynamic_offsets)
|
||||
void render_pass_encoder::set_bind_group(std::uint32_t group_index, bind_group const & group, std::vector<std::uint32_t> const & dynamic_offsets)
|
||||
{
|
||||
wgpuRenderPassEncoderSetBindGroup((WGPURenderPassEncoder)get(), group_index, (WGPUBindGroup)group.get(), dynamic_offsets.size(), dynamic_offsets.data());
|
||||
}
|
||||
|
||||
void render_pass_encoder::set_vertex_buffer(std::uint32_t slot, buffer buffer, std::uint64_t offset, std::uint64_t size)
|
||||
void render_pass_encoder::set_vertex_buffer(std::uint32_t slot, buffer const & buffer, std::uint64_t offset, std::uint64_t size)
|
||||
{
|
||||
wgpuRenderPassEncoderSetVertexBuffer((WGPURenderPassEncoder)get(), slot, (WGPUBuffer)buffer.get(), offset, size);
|
||||
}
|
||||
|
||||
void render_pass_encoder::set_index_buffer(buffer buffer, index_format format, std::uint64_t offset, std::uint64_t size)
|
||||
void render_pass_encoder::set_index_buffer(buffer const & buffer, index_format format, std::uint64_t offset, std::uint64_t size)
|
||||
{
|
||||
wgpuRenderPassEncoderSetIndexBuffer((WGPURenderPassEncoder)get(), (WGPUBuffer)buffer.get(), (WGPUIndexFormat)format, offset, size);
|
||||
}
|
||||
|
|
@ -55,12 +55,12 @@ namespace psemek::wgpu
|
|||
wgpuRenderPassEncoderDrawIndexed((WGPURenderPassEncoder)get(), index_count, instance_count, first_index, base_vertex, first_instance);
|
||||
}
|
||||
|
||||
void render_pass_encoder::draw_indirect(buffer indirect_buffer, std::uint64_t offset)
|
||||
void render_pass_encoder::draw_indirect(buffer const & indirect_buffer, std::uint64_t offset)
|
||||
{
|
||||
wgpuRenderPassEncoderDrawIndirect((WGPURenderPassEncoder)get(), (WGPUBuffer)indirect_buffer.get(), offset);
|
||||
}
|
||||
|
||||
void render_pass_encoder::draw_indexed_indirect(buffer indirect_buffer, std::uint64_t offset)
|
||||
void render_pass_encoder::draw_indexed_indirect(buffer const & indirect_buffer, std::uint64_t offset)
|
||||
{
|
||||
wgpuRenderPassEncoderDrawIndexedIndirect((WGPURenderPassEncoder)get(), (WGPUBuffer)indirect_buffer.get(), offset);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue