Removed toolchain config

This commit is contained in:
Silas Bartha 2024-06-04 13:01:27 -04:00
parent a294ec442b
commit d98878f313
Signed by: soaos
GPG Key ID: 9BD3DCC0D56A09B2
7 changed files with 99 additions and 85 deletions

View File

@ -1,34 +0,0 @@
# Add the contents of this file to `config.toml` to enable "fast build" configuration. Please read the notes below.
# NOTE: For maximum performance, build using a nightly compiler
# If you are using rust stable, remove the "-Zshare-generics=y" below.
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"]
# NOTE: you must install [Mach-O LLD Port](https://lld.llvm.org/MachO/index.html) on mac. you can easily do this by installing llvm which includes lld with the "brew" package manager:
# `brew install llvm`
[target.x86_64-apple-darwin]
rustflags = [
"-C",
"link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld",
"-Zshare-generics=y",
]
[target.aarch64-apple-darwin]
rustflags = [
"-C",
"link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
"-Zshare-generics=y",
]
[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
rustflags = ["-Zshare-generics=n"]
# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
#[profile.dev]
#debug = 1

View File

@ -1,6 +1,6 @@
[package] [package]
name = "grex_outline_post_process" name = "bevy_outline_post_process"
version = "0.1.2" version = "0.1.3"
edition = "2021" edition = "2021"
[dependencies.bevy] [dependencies.bevy]

View File

@ -1,4 +1,4 @@
# grex_outline_post_process # bevy_outline_post_process
A plugin for the [Bevy](https://bevyengine.org) engine which adds an outline post-processing effect. A plugin for the [Bevy](https://bevyengine.org) engine which adds an outline post-processing effect.
@ -25,8 +25,8 @@ grex_outline_post_process::components::OutlinePostProcessSettings {
### Using git URL in Cargo.toml ### Using git URL in Cargo.toml
```toml ```toml
[dependencies.grex_outline_post_process] [dependencies.bevy_outline_post_process]
git = "https://github.com/exvacuum/grex_outline_post_process.git" git = "https://github.com/exvacuum/bevy_outline_post_process.git"
``` ```
## Usage ## Usage
@ -34,13 +34,13 @@ git = "https://github.com/exvacuum/grex_outline_post_process.git"
In `main.rs`: In `main.rs`:
```rs ```rs
use bevy::prelude::*; use bevy::prelude::*;
use grex_outline_post_process; use bevy_outline_post_process;
fn main() { fn main() {
App::new() App::new()
.add_plugins(( .add_plugins((
DefaultPlugins, DefaultPlugins,
grex_outline_post_process::OutlinePostProcessPlugin, bevy_outline_post_process::OutlinePostProcessPlugin,
)) ))
.insert_resource(Msaa::Off) .insert_resource(Msaa::Off)
.run(); .run();
@ -52,7 +52,7 @@ When spawning a camera:
commands.spawn(( commands.spawn((
// Camera3dBundle... // Camera3dBundle...
NormalPrepass, NormalPrepass,
grex_outline_post_process::components::OutlinePostProcessSettings { bevy_outline_post_process::components::OutlinePostProcessSettings {
weight: 2.0, weight: 2.0,
threshold: 0.0, threshold: 0.0,
} }

View File

@ -1,9 +1,10 @@
use bevy::{prelude::*, render::{render_resource::ShaderType, extract_component::ExtractComponent}}; use bevy::{
prelude::*,
render::{extract_component::ExtractComponent, render_resource::ShaderType},
};
#[derive(Component, ShaderType, ExtractComponent, PartialEq, Clone, Default)] #[derive(Component, ShaderType, ExtractComponent, PartialEq, Clone, Default)]
pub struct OutlinePostProcessSettings { pub struct OutlinePostProcessSettings {
pub weight: f32, pub weight: f32,
pub threshold: f32, pub threshold: f32,
#[cfg(feature = "webgl2")]
_padding: Vec2,
} }

View File

@ -1,12 +1,23 @@
use bevy::{prelude::*, render::{RenderApp, extract_component::{UniformComponentPlugin, ExtractComponentPlugin}, render_graph::{RenderGraphApp, ViewNodeRunner}}, asset::embedded_asset, core_pipeline::core_3d::graph::{Core3d, Node3d}}; #![warn(missing_docs)]
use bevy::{
asset::embedded_asset,
core_pipeline::core_3d::graph::{Core3d, Node3d},
prelude::*,
render::{
extract_component::{ExtractComponentPlugin, UniformComponentPlugin},
render_graph::{RenderGraphApp, ViewNodeRunner},
RenderApp,
},
};
pub use nodes::OutlineRenderLabel; pub use nodes::OutlineRenderLabel;
pub struct OutlinePostProcessPlugin; pub struct OutlinePostProcessPlugin;
pub mod components; pub mod components;
mod resources;
mod nodes; mod nodes;
mod resources;
impl Plugin for OutlinePostProcessPlugin { impl Plugin for OutlinePostProcessPlugin {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {
@ -21,10 +32,12 @@ impl Plugin for OutlinePostProcessPlugin {
return; return;
}; };
render_app.add_render_graph_node::<ViewNodeRunner<nodes::OutlineRenderNode>>( render_app
.add_render_graph_node::<ViewNodeRunner<nodes::OutlineRenderNode>>(
Core3d, Core3d,
nodes::OutlineRenderLabel, nodes::OutlineRenderLabel,
).add_render_graph_edges( )
.add_render_graph_edges(
Core3d, Core3d,
( (
Node3d::Tonemapping, Node3d::Tonemapping,

View File

@ -1,4 +1,18 @@
use bevy::{prelude::*, render::{render_graph::{ViewNode, NodeRunError, RenderGraphContext, RenderLabel}, view::ViewTarget, renderer::RenderContext, render_resource::{PipelineCache, BindGroupEntries, RenderPassDescriptor, RenderPassColorAttachment, Operations}, extract_component::ComponentUniforms}, core_pipeline::prepass::ViewPrepassTextures, ecs::query::QueryItem}; use bevy::{
core_pipeline::prepass::ViewPrepassTextures,
ecs::query::QueryItem,
prelude::*,
render::{
extract_component::ComponentUniforms,
render_graph::{NodeRunError, RenderGraphContext, RenderLabel, ViewNode},
render_resource::{
BindGroupEntries, Operations, PipelineCache, RenderPassColorAttachment,
RenderPassDescriptor,
},
renderer::RenderContext,
view::ViewTarget,
},
};
use super::components; use super::components;
use super::resources; use super::resources;
@ -30,7 +44,8 @@ impl ViewNode for OutlineRenderNode {
return Ok(()); return Ok(());
}; };
let uniforms = world.resource::<ComponentUniforms<components::OutlinePostProcessSettings>>(); let uniforms =
world.resource::<ComponentUniforms<components::OutlinePostProcessSettings>>();
let Some(uniform_binding) = uniforms.uniforms().binding() else { let Some(uniform_binding) = uniforms.uniforms().binding() else {
error!("Failed to get settings uniform binding"); error!("Failed to get settings uniform binding");
return Ok(()); return Ok(());

View File

@ -1,4 +1,18 @@
use bevy::{prelude::*, render::{render_resource::{Sampler, BindGroupLayout, BindGroupLayoutEntries, ShaderStages, binding_types::{texture_2d, sampler, uniform_buffer}, TextureSampleType, SamplerBindingType, SamplerDescriptor, PipelineCache, RenderPipelineDescriptor, CachedRenderPipelineId, PrimitiveState, MultisampleState, FragmentState, ColorTargetState, TextureFormat, ColorWrites}, renderer::RenderDevice, texture::BevyDefault}, core_pipeline::fullscreen_vertex_shader::fullscreen_shader_vertex_state}; use bevy::{
core_pipeline::fullscreen_vertex_shader::fullscreen_shader_vertex_state,
prelude::*,
render::{
render_resource::{
binding_types::{sampler, texture_2d, uniform_buffer},
BindGroupLayout, BindGroupLayoutEntries, CachedRenderPipelineId, ColorTargetState,
ColorWrites, FragmentState, MultisampleState, PipelineCache, PrimitiveState,
RenderPipelineDescriptor, Sampler, SamplerBindingType, SamplerDescriptor, ShaderStages,
TextureFormat, TextureSampleType,
},
renderer::RenderDevice,
texture::BevyDefault,
},
};
use super::components; use super::components;
@ -31,9 +45,14 @@ impl FromWorld for OutlinePostProcessPipeline {
let screen_sampler = render_device.create_sampler(&SamplerDescriptor::default()); let screen_sampler = render_device.create_sampler(&SamplerDescriptor::default());
let normal_sampler = render_device.create_sampler(&SamplerDescriptor::default()); let normal_sampler = render_device.create_sampler(&SamplerDescriptor::default());
let shader = world.resource::<AssetServer>().load::<Shader>("embedded://grex_outline_post_process/../assets/shaders/outline_post_process.wgsl"); let shader = world.resource::<AssetServer>().load::<Shader>(
"embedded://bevy_outline_post_process/../assets/shaders/outline_post_process.wgsl",
);
let pipeline_id = world.resource_mut::<PipelineCache>().queue_render_pipeline(RenderPipelineDescriptor { let pipeline_id =
world
.resource_mut::<PipelineCache>()
.queue_render_pipeline(RenderPipelineDescriptor {
label: Some("outline_post_process_render_pipeline".into()), label: Some("outline_post_process_render_pipeline".into()),
layout: vec![layout.clone()], layout: vec![layout.clone()],
push_constant_ranges: vec![], push_constant_ranges: vec![],