Move MaterialProperties from bevy_pbr to bevy_material#2
Conversation
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
|
You added a new feature but didn't update the readme. Please run |
MaterialProperties from bevy_pbr to bevy_material
| /// loaded, won't have entries in this table. | ||
| pub(crate) render_lightmaps: MainEntityHashMap<RenderLightmap>, | ||
|
|
||
| pub struct RenderLightmapsL { |
There was a problem hiding this comment.
Contrast with RenderLightmapsU in crates/bevy_render/src/mesh/lightmap.rs
| /// This is cleared and repopulated each frame during the `extract_lightmaps` | ||
| /// system. | ||
| #[derive(Resource)] | ||
| pub struct RenderLightmapsU { |
There was a problem hiding this comment.
Contrast with RenderLightmapsL in crates/bevy_pbr/src/lightmap/mod.rs
| @@ -167,21 +120,8 @@ pub struct LightmapSlab { | |||
|
|
|||
| struct AllocatedLightmap { | |||
There was a problem hiding this comment.
Contrast with AllocatedLightmapUnloaded
| impl FromWorld for MeshPipeline { | ||
| fn from_world(world: &mut World) -> Self { | ||
| // impl FromWorld for MeshPipeline { | ||
| pub fn meshPipeline_from_world(world: &mut World) { |
There was a problem hiding this comment.
We change the FromWorld to be a RenderStartup system
| .get_supported_read_only_binding_type(CLUSTERED_FORWARD_STORAGE_BUFFER_COUNT); | ||
|
|
||
| todo!("Build 1x1 image"); | ||
| // A 1x1x1 'all 1.0' texture to use as a dummy texture to use in place of optional StandardMaterial textures |
There was a problem hiding this comment.
Need to handle dummy_white_gpu_image here
| if let Some(handle) = handle_option { | ||
| let gpu_image = gpu_images.get(handle)?; | ||
| Some((&gpu_image.texture_view, &gpu_image.sampler)) | ||
| } else { |
There was a problem hiding this comment.
Need to handle converting from dummy_white_gpu_image to a GpuImage
| } | ||
| } | ||
|
|
||
| impl GetBatchData for MeshPipeline { |
There was a problem hiding this comment.
This impl moves to bevy_render
| pub struct MeshLayouts { | ||
| /// The mesh model uniform (transform) and nothing else. | ||
| pub model_only: BindGroupLayoutDescriptor, | ||
| pub trait MeshLayoutsBuilder { |
There was a problem hiding this comment.
struct MeshLayouts doesn't depend on wgpu , but impl MeshLayouts does, so split out here
| /// A reference to all the mesh pipeline view layouts. | ||
| pub view_layouts: MeshPipelineViewLayouts, | ||
| // This dummy white texture is to be used in place of optional StandardMaterial textures | ||
| pub dummy_white_gpu_image: Handle<Image>, |
There was a problem hiding this comment.
This used to be a GpuImage
| fn extract_lightmaps( | ||
| render_lightmaps: ResMut<RenderLightmaps>, | ||
| render_lightmaps_u: ResMut<RenderLightmapsU>, | ||
| mut render_lightmaps_l: ResMut<RenderLightmapsL>, |
There was a problem hiding this comment.
Idea is we have split RenderLightmaps into 2 parts, the bit with wgpu-types and the bit with wgpu
| }; | ||
| render_lightmaps.slabs[usize::from(slab_index)].insert(slot_index, gpu_image.clone()); | ||
| false | ||
| return false; |
There was a problem hiding this comment.
Note a lot of shortcutting here to make it compile, I don't know how to do these actions
|
Superceded by bevyengine#21543 |
Objective
MaterialPropertiesfrombevy_pbrtobevy_material(new crate that doesn't depend onwgpu, justwgpu-types)Solution
bevy_pbrtobevy_materialbevy_rendertobevy_materialbevy_pbrtobevy_renderTesting