mirror of
https://github.com/bevyengine/bevy
synced 2025-01-03 08:48:57 +00:00
afaf4ad3da
Changes to get Bevy to compile with wgpu master. With this, on a Mac: * 2d examples look fine * ~~3d examples crash with an error specific to metal about a compilation error~~ * 3d examples work fine after enabling feature `wgpu/cross` Feature `wgpu/cross` seems to be needed only on some platforms, not sure how to know which. It was introduced in https://github.com/gfx-rs/wgpu-rs/pull/826
30 lines
1 KiB
Rust
30 lines
1 KiB
Rust
use crate::{
|
|
pipeline::{FrontFace, PipelineDescriptor, PolygonMode, PrimitiveState, PrimitiveTopology},
|
|
shader::{Shader, ShaderStage, ShaderStages},
|
|
};
|
|
use bevy_asset::Assets;
|
|
|
|
pub(crate) fn build_wireframe_pipeline(shaders: &mut Assets<Shader>) -> PipelineDescriptor {
|
|
PipelineDescriptor {
|
|
name: Some("wireframe".into()),
|
|
primitive: PrimitiveState {
|
|
topology: PrimitiveTopology::TriangleList,
|
|
strip_index_format: None,
|
|
front_face: FrontFace::Ccw,
|
|
cull_mode: None,
|
|
polygon_mode: PolygonMode::Line,
|
|
clamp_depth: false,
|
|
conservative: false,
|
|
},
|
|
..PipelineDescriptor::default_config(ShaderStages {
|
|
vertex: shaders.add(Shader::from_glsl(
|
|
ShaderStage::Vertex,
|
|
include_str!("wireframe.vert"),
|
|
)),
|
|
fragment: Some(shaders.add(Shader::from_glsl(
|
|
ShaderStage::Fragment,
|
|
include_str!("wireframe.frag"),
|
|
))),
|
|
})
|
|
}
|
|
}
|