-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add BindGroupLayout caching via descriptors #21205
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
base: main
Are you sure you want to change the base?
Conversation
crates/bevy_anti_alias/src/contrast_adaptive_sharpening/node.rs
Outdated
Show resolved
Hide resolved
render_device, | ||
material_param, | ||
false, | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is yuck, AsBindGroup::unprepared_bind_group
needs a BindGroupLayout
, so we fetch it from the cache - investigate if unprepared_bind_group
can use BindGroupLayoutDescriptor
instead
Can you add more motivation to the PR description please? I'm having trouble following why this is a good idea. |
pub label: Option<Cow<'static, str>>, | ||
/// The layout of bind groups for this pipeline. | ||
pub layout: Vec<BindGroupLayout>, | ||
pub layout: Vec<BindGroupLayoutDescriptor>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewers: this line (and the equivalent on ComputePipelineDescriptor) is the whole point of this change. It makes these two structs not depend on wgpu
, which means they can be moved out of bevy_render into a bevy_material, and created without the need of a renderdevice. Specifically, this allows describing a shader's inputs without bevy_render, which when combined with bevy_shader allows for renderless material abstraction.
Everything else in this PR is just to make these two line diffs happen.
Objective
BindGroupLayout
by using aBindGroupLayoutDescriptor
and cache the resultsbevy_material
(render-less material definitions)Solution
Testing