Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/release-content/migration-guides/bind-group-layout-descriptors.md
7223 views
---
title: "`RenderPipelineDescriptor` and `ComputePipelineDescriptor` now hold a `BindGroupLayoutDescriptor`" pull_requests: [21205]
---

In previous versions of Bevy, RenderPipelineDescriptor and ComputePipelineDescriptor held a BindGroupLayout to describe the layout of shader bind groups, depending directly on wgpu's BindGroupLayout. Now, they hold a new type BindGroupLayoutDescriptor which holds the BindGroupLayoutEntrys directly. The descriptors are used to create BindGroupLayouts when they are first needed by a pipeline, and cached for reuse.

Concretely, this means wherever you were using a RenderDevice to create a BindGroupLayout to store in a RenderPipelineDescriptor or ComputePipelineDescriptor, you will now create a BindGroupLayoutDescriptor:

// 0.17 let bind_group_layout = render_device.create_bind_group_layout( // ... ); commands.insert_resource(MyPipeline { bind_group_layout, /// ... }); // ... let bind_group = render_context.render_device().create_bind_group( None &my_pipeline.bind_group_layout, // ... ); // 0.18 let bind_group_layout = BindGroupLayoutDescriptor::new( // ... ); commands.insert_resource(MyPipeline { bind_group_layout, /// ... }); // ... let bind_group = render_context.render_device().create_bind_group( None &pipeline_cache.get_bind_group_layout(&my_pipeline.bind_group), // ... );