update bevy 0.11 - fix compile errors
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
pub mod r3d {
|
||||
use bevy_core_pipeline::core_3d::Opaque3d;
|
||||
use bevy_pbr::{
|
||||
DrawMesh, MeshPipeline, MeshPipelineKey, MeshUniform, SetMeshBindGroup,
|
||||
SetMeshViewBindGroup,
|
||||
};
|
||||
|
||||
use bevy::{
|
||||
core_pipeline::core_3d::Opaque3d,
|
||||
pbr::{
|
||||
DrawMesh, MeshPipeline, MeshPipelineKey, MeshUniform, SetMeshBindGroup,
|
||||
SetMeshViewBindGroup,
|
||||
},
|
||||
prelude::*,
|
||||
render::{
|
||||
mesh::MeshVertexBufferLayout,
|
||||
@@ -54,9 +55,9 @@ pub mod r3d {
|
||||
//use VertexFormat::{Float32x3, Float32x4};
|
||||
|
||||
let mut shader_defs = Vec::new();
|
||||
shader_defs.push("LINES_3D".to_string());
|
||||
shader_defs.push("LINES_3D".to_string().into());
|
||||
if depth_test {
|
||||
shader_defs.push("DEPTH_TEST_ENABLED".to_string());
|
||||
shader_defs.push("DEPTH_TEST_ENABLED".to_string().into());
|
||||
}
|
||||
|
||||
let vertex_buffer_layout = layout.get_layout(&[
|
||||
@@ -64,7 +65,7 @@ pub mod r3d {
|
||||
Mesh::ATTRIBUTE_COLOR.at_shader_location(1),
|
||||
])?;
|
||||
let (label, blend, depth_write_enabled);
|
||||
if key.contains(MeshPipelineKey::TRANSPARENT_MAIN_PASS) {
|
||||
if key.contains(MeshPipelineKey::BLEND_ALPHA) {
|
||||
label = "transparent_mesh_pipeline".into();
|
||||
blend = Some(BlendState::ALPHA_BLENDING);
|
||||
// For the transparent pass, fragments that are closer will be alpha
|
||||
@@ -96,7 +97,7 @@ pub mod r3d {
|
||||
write_mask: ColorWrites::ALL,
|
||||
})],
|
||||
}),
|
||||
layout: Some(vec![self.mesh_pipeline.view_layout.clone()]),
|
||||
layout: vec![self.mesh_pipeline.view_layout.clone()],
|
||||
primitive: PrimitiveState {
|
||||
front_face: FrontFace::Ccw,
|
||||
cull_mode: None,
|
||||
@@ -128,6 +129,7 @@ pub mod r3d {
|
||||
alpha_to_coverage_enabled: false,
|
||||
},
|
||||
label: Some(label),
|
||||
push_constant_ranges: vec![],
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -147,7 +149,7 @@ pub mod r3d {
|
||||
.read()
|
||||
.get_id::<DrawDebugLines>()
|
||||
.unwrap();
|
||||
let key = MeshPipelineKey::from_msaa_samples(msaa.samples);
|
||||
let key = MeshPipelineKey::from_msaa_samples(msaa.samples());
|
||||
for (view, mut transparent_phase) in views.iter_mut() {
|
||||
let view_matrix = view.transform.compute_matrix();
|
||||
let view_row_2 = view_matrix.row(2);
|
||||
@@ -183,7 +185,6 @@ pub mod r3d {
|
||||
pub mod r2d {
|
||||
use bevy::{
|
||||
asset::Handle,
|
||||
core_pipeline::core_2d::Transparent2d,
|
||||
prelude::*,
|
||||
render::{
|
||||
mesh::MeshVertexBufferLayout,
|
||||
@@ -200,12 +201,13 @@ pub mod r2d {
|
||||
texture::BevyDefault,
|
||||
view::{Msaa, VisibleEntities},
|
||||
},
|
||||
sprite::{
|
||||
DrawMesh2d, Mesh2dHandle, Mesh2dPipeline, Mesh2dPipelineKey, Mesh2dUniform,
|
||||
SetMesh2dBindGroup, SetMesh2dViewBindGroup,
|
||||
},
|
||||
utils::FloatOrd,
|
||||
};
|
||||
use bevy_core_pipeline::core_2d::Transparent2d;
|
||||
use bevy_sprite::{
|
||||
DrawMesh2d, Mesh2dHandle, Mesh2dPipeline, Mesh2dPipelineKey, Mesh2dUniform,
|
||||
SetMesh2dBindGroup, SetMesh2dViewBindGroup,
|
||||
};
|
||||
|
||||
use crate::lines::{RenderDebugLinesMesh, DEBUG_LINES_SHADER_HANDLE};
|
||||
|
||||
@@ -264,7 +266,7 @@ pub mod r2d {
|
||||
write_mask: ColorWrites::ALL,
|
||||
})],
|
||||
}),
|
||||
layout: Some(vec![self.mesh_pipeline.view_layout.clone()]),
|
||||
layout: vec![self.mesh_pipeline.view_layout.clone()],
|
||||
primitive: PrimitiveState {
|
||||
front_face: FrontFace::Ccw,
|
||||
cull_mode: None,
|
||||
@@ -281,6 +283,7 @@ pub mod r2d {
|
||||
alpha_to_coverage_enabled: false,
|
||||
},
|
||||
label: None,
|
||||
push_constant_ranges: vec![],
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -297,7 +300,7 @@ pub mod r2d {
|
||||
) {
|
||||
for (view, mut phase) in views.iter_mut() {
|
||||
let draw_mesh2d = draw2d_functions.read().get_id::<DrawDebugLines>().unwrap();
|
||||
let msaa_key = Mesh2dPipelineKey::from_msaa_samples(msaa.samples);
|
||||
let msaa_key = Mesh2dPipelineKey::from_msaa_samples(msaa.samples());
|
||||
|
||||
for visible_entity in &view.entities {
|
||||
if let Ok((uniform, mesh_handle)) = material_meshes.get(*visible_entity) {
|
||||
|
||||
Reference in New Issue
Block a user