Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: automatic gpu storage planar bind groups #3

Merged
merged 3 commits into from
Feb 17, 2024
Merged

Conversation

mosure
Copy link
Owner

@mosure mosure commented Feb 17, 2024

#[derive(StorageBindings, Planar)] - implements GpuStoragePlanar trait:

pub trait GpuStoragePlanar {
    type PackedType;
    type PlanarType;

    fn bind_group(
        &self,
        render_device: &bevy::render::renderer::RenderDevice,
        layout: &bevy::render::render_resource::BindGroupLayout,
    ) -> bevy::render::render_resource::BindGroup;

    fn bind_group_layout(
        &self,
        render_device: &bevy::render::renderer::RenderDevice,
        read_only: bool,
    ) -> bevy::render::render_resource::BindGroupLayout;

    fn ordered_field_names(&self) -> &'static [&'static str];

    fn prepare(
        render_device: &bevy::render::renderer::RenderDevice,
        planar: &Self::PlanarType,
    ) -> Self;
}

#[derive(TextureBindings, Planar)] - implements GpuStoragePlanar trait:

// TODO: texture bindings derive macro

@mosure mosure changed the title feat: automatic gpu storage/texture planar bind groups feat: automatic gpu storage planar bind groups Feb 17, 2024
@mosure mosure merged commit 357b469 into main Feb 17, 2024
3 checks passed
@mosure mosure deleted the feat/auto-bind-group branch February 17, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant