GPUComputePassEncoder
- class wgpu.GPUComputePassEncoder
Bases:
GPUCommandsMixin,GPUDebugCommandsMixin,GPUBindingCommandsMixin,GPUObjectBaseObject to records commands for a compute pass.
Create a compute pass encoder using GPUCommandEncoder.begin_compute_pass().
- dispatch_workgroups(workgroup_count_x: int | None = None, workgroup_count_y: int = 1, workgroup_count_z: int = 1) None
Run the compute shader.
- Parameters:
x (int) – The number of cycles in index x.
y (int) – The number of cycles in index y. Default 1.
z (int) – The number of cycles in index z. Default 1.
- dispatch_workgroups_indirect(indirect_buffer: GPUBuffer | None = None, indirect_offset: int | None = None) None
Like
dispatch_workgroups(), but the function arguments are in a buffer.- Parameters:
indirect_buffer (
GPUBuffer) – The buffer that contains the arguments.indirect_offset (int) – The byte offset at which the arguments are.
- end() None
Record the end of the compute pass.
- set_pipeline(pipeline: GPUComputePipeline | None = None) None
Set the pipeline for this compute pass.
- Parameters:
pipeline (
GPUComputePipeline) – The pipeline to use.