bevy/crates/bevy_pbr/src
Patrick Walton d3241c4f8d
Fix the texture_binding_array, specialized_mesh_pipeline, and custom_shader_instancing examples after the bindless change. (#16641)
The bindless PR (#16368) broke some examples:

* `specialized_mesh_pipeline` and `custom_shader_instancing` failed
because they expect to be able to render a mesh with no material, by
overriding enough of the render pipeline to be able to do so. This PR
fixes the issue by restoring the old behavior in which we extract meshes
even if they have no material.

* `texture_binding_array` broke because it doesn't implement
`AsBindGroup::unprepared_bind_group`. This was tricky to fix because
there's a very good reason why `texture_binding_array` doesn't implement
that method: there's no sensible way to do so with `wgpu`'s current
bindless API, due to its multiple levels of borrowed references. To fix
the example, I split `MaterialBindGroup` into
`MaterialBindlessBindGroup` and `MaterialNonBindlessBindGroup`, and
allow direct custom implementations of `AsBindGroup::as_bind_group` for
the latter type of bind groups. To opt in to the new behavior, return
the `AsBindGroupError::CreateBindGroupDirectly` error from your
`AsBindGroup::unprepared_bind_group` implementation, and Bevy will call
your custom `AsBindGroup::as_bind_group` method as before.

## Migration Guide

* Bevy will now unconditionally call
`AsBindGroup::unprepared_bind_group` for your materials, so you must no
longer panic in that function. Instead, return the new
`AsBindGroupError::CreateBindGroupDirectly` error, and Bevy will fall
back to calling `AsBindGroup::as_bind_group` as before.
2024-12-05 21:22:14 +00:00
..
cluster Cluster light probes using conservative spherical bounds. (#13746) 2024-12-05 13:07:10 +00:00
deferred Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
light Make PCSS experimental (#16382) 2024-11-14 07:39:26 +00:00
light_probe Cluster light probes using conservative spherical bounds. (#13746) 2024-12-05 13:07:10 +00:00
lightmap Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
meshlet Move required components doc to type doc (#16575) 2024-12-03 19:45:20 +00:00
prepass Make visibility range (HLOD) dithering work when prepasses are enabled. (#16286) 2024-12-04 17:34:36 +00:00
render Fix the texture_binding_array, specialized_mesh_pipeline, and custom_shader_instancing examples after the bindless change. (#16641) 2024-12-05 21:22:14 +00:00
ssao Move required components doc to type doc (#16575) 2024-12-03 19:45:20 +00:00
ssr Cluster light probes using conservative spherical bounds. (#13746) 2024-12-05 13:07:10 +00:00
volumetric_fog Move required components doc to type doc (#16575) 2024-12-03 19:45:20 +00:00
bundle.rs Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
extended_material.rs Add a bindless mode to AsBindGroup. (#16368) 2024-12-03 18:00:34 +00:00
fog.rs Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
lib.rs Retain RenderMeshInstance and MeshInputUniform data from frame to frame. (#16385) 2024-12-05 21:16:04 +00:00
material.rs Fix the texture_binding_array, specialized_mesh_pipeline, and custom_shader_instancing examples after the bindless change. (#16641) 2024-12-05 21:22:14 +00:00
material_bind_groups.rs Fix the texture_binding_array, specialized_mesh_pipeline, and custom_shader_instancing examples after the bindless change. (#16641) 2024-12-05 21:22:14 +00:00
mesh_material.rs Revert default mesh materials (#15930) 2024-10-15 19:47:40 +00:00
parallax.rs bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
pbr_material.rs Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
wireframe.rs Revert "Have EntityCommands methods consume self for easier chaining" (#15523) 2024-10-02 12:47:26 +00:00