Skip to content

pipeline trait #166

Open
Open
@github-actions

Description

@github-actions

// TODO: pipeline trait

            let pipeline = pipelines.specialize(&pipeline_cache, &custom_pipeline, key);

            let rangefinder = view.rangefinder3d();
            let center = *transform
                * GlobalTransform::from(
                    Transform::from_translation(aabb.center.into())
                        .with_scale((aabb.half_extents * 2.).into()),
                );
            let distance = rangefinder
                .distance_translation(&center.translation());

            transparent_phase.add(Transparent3d {
                entity: (*render_entity, *visible_entity),
                draw_function: draw_custom,
                distance,
                pipeline,
                batch_range: 0..1,
                extra_index: PhaseItemExtraIndex::NONE,
            });
        }
    }
}


// TODO: pipeline trait
// TODO: support extendions /w ComputePipelineDescriptor builder
#[derive(Resource)]
pub struct CloudPipeline<R: PlanarStorage> {
    shader: Handle<Shader>,
    pub gaussian_cloud_layout: BindGroupLayout,
    pub gaussian_uniform_layout: BindGroupLayout,
    pub view_layout: BindGroupLayout,
    pub sorted_layout: BindGroupLayout,
    phantom: std::marker::PhantomData<R>,
}

impl<R: PlanarStorage> FromWorld for CloudPipeline<R> {
    fn from_world(render_world: &mut World) -> Self {
        let render_device = render_world.resource::<RenderDevice>();

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions