Only dispatch each workgroup not pixel

This commit is contained in:
Dennis Kobert
2023-06-26 21:08:43 +02:00
committed by Keavon Chambers
parent 215589ff49
commit edb33e0c82
8 changed files with 1076 additions and 75 deletions

View File

@@ -357,12 +357,23 @@ where
/// A struct representing a compute pipeline.
pub struct PipelineLayout<E: GpuExecutor + ?Sized> {
pub shader: E::ShaderHandle,
pub shader: Arc<E::ShaderHandle>,
pub entry_point: String,
pub bind_group: Bindgroup<E>,
pub bind_group: Arc<Bindgroup<E>>,
pub output_buffer: Arc<ShaderInput<E>>,
}
impl<E: GpuExecutor + ?Sized> Clone for PipelineLayout<E> {
fn clone(&self) -> Self {
Self {
shader: self.shader.clone(),
entry_point: self.entry_point.clone(),
bind_group: self.bind_group.clone(),
output_buffer: self.output_buffer.clone(),
}
}
}
unsafe impl<E: GpuExecutor + ?Sized + StaticType> StaticType for PipelineLayout<E>
where
E::Static: GpuExecutor,
@@ -457,9 +468,9 @@ pub struct CreatePipelineLayoutNode<_E, EntryPoint, Bindgroup, OutputBuffer> {
#[node_macro::node_fn(CreatePipelineLayoutNode<_E>)]
async fn create_pipeline_layout_node<_E: GpuExecutor>(shader: _E::ShaderHandle, entry_point: String, bind_group: Bindgroup<_E>, output_buffer: Arc<ShaderInput<_E>>) -> PipelineLayout<_E> {
PipelineLayout {
shader,
shader: shader.into(),
entry_point,
bind_group,
bind_group: bind_group.into(),
output_buffer,
}
}