Restrict more internal symbols to crate visibility.
This commit is contained in:
parent
4a292ca6bc
commit
d41057f905
|
@ -13,7 +13,7 @@ use crate::uniforms::{
|
||||||
};
|
};
|
||||||
use crate::view_uniforms::SetOutlineViewBindGroup;
|
use crate::view_uniforms::SetOutlineViewBindGroup;
|
||||||
|
|
||||||
pub type DrawStencil = (
|
pub(crate) type DrawStencil = (
|
||||||
SetItemPipeline,
|
SetItemPipeline,
|
||||||
SetMeshViewBindGroup<0>,
|
SetMeshViewBindGroup<0>,
|
||||||
SetMeshBindGroup<1>,
|
SetMeshBindGroup<1>,
|
||||||
|
@ -23,7 +23,7 @@ pub type DrawStencil = (
|
||||||
);
|
);
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn queue_outline_stencil_mesh(
|
pub(crate) fn queue_outline_stencil_mesh(
|
||||||
stencil_draw_functions: Res<DrawFunctions<StencilOutline>>,
|
stencil_draw_functions: Res<DrawFunctions<StencilOutline>>,
|
||||||
stencil_pipeline: Res<OutlinePipeline>,
|
stencil_pipeline: Res<OutlinePipeline>,
|
||||||
msaa: Res<Msaa>,
|
msaa: Res<Msaa>,
|
||||||
|
@ -65,7 +65,7 @@ pub fn queue_outline_stencil_mesh(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type DrawOutline = (
|
pub(crate) type DrawOutline = (
|
||||||
SetItemPipeline,
|
SetItemPipeline,
|
||||||
SetMeshViewBindGroup<0>,
|
SetMeshViewBindGroup<0>,
|
||||||
SetMeshBindGroup<1>,
|
SetMeshBindGroup<1>,
|
||||||
|
@ -75,7 +75,7 @@ pub type DrawOutline = (
|
||||||
);
|
);
|
||||||
|
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn queue_outline_volume_mesh(
|
pub(crate) fn queue_outline_volume_mesh(
|
||||||
opaque_draw_functions: Res<DrawFunctions<OpaqueOutline>>,
|
opaque_draw_functions: Res<DrawFunctions<OpaqueOutline>>,
|
||||||
transparent_draw_functions: Res<DrawFunctions<TransparentOutline>>,
|
transparent_draw_functions: Res<DrawFunctions<TransparentOutline>>,
|
||||||
outline_pipeline: Res<OutlinePipeline>,
|
outline_pipeline: Res<OutlinePipeline>,
|
||||||
|
|
12
src/node.rs
12
src/node.rs
|
@ -19,7 +19,7 @@ use bevy::render::{
|
||||||
};
|
};
|
||||||
use bevy::utils::FloatOrd;
|
use bevy::utils::FloatOrd;
|
||||||
|
|
||||||
pub struct StencilOutline {
|
pub(crate) struct StencilOutline {
|
||||||
pub distance: f32,
|
pub distance: f32,
|
||||||
pub pipeline: CachedRenderPipelineId,
|
pub pipeline: CachedRenderPipelineId,
|
||||||
pub entity: Entity,
|
pub entity: Entity,
|
||||||
|
@ -52,7 +52,7 @@ impl CachedRenderPipelinePhaseItem for StencilOutline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct OpaqueOutline {
|
pub(crate) struct OpaqueOutline {
|
||||||
pub distance: f32,
|
pub distance: f32,
|
||||||
pub pipeline: CachedRenderPipelineId,
|
pub pipeline: CachedRenderPipelineId,
|
||||||
pub entity: Entity,
|
pub entity: Entity,
|
||||||
|
@ -85,7 +85,7 @@ impl CachedRenderPipelinePhaseItem for OpaqueOutline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TransparentOutline {
|
pub(crate) struct TransparentOutline {
|
||||||
pub distance: f32,
|
pub distance: f32,
|
||||||
pub pipeline: CachedRenderPipelineId,
|
pub pipeline: CachedRenderPipelineId,
|
||||||
pub entity: Entity,
|
pub entity: Entity,
|
||||||
|
@ -119,7 +119,7 @@ impl CachedRenderPipelinePhaseItem for TransparentOutline {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::type_complexity)]
|
#[allow(clippy::type_complexity)]
|
||||||
pub struct OutlineNode {
|
pub(crate) struct OutlineNode {
|
||||||
query: QueryState<
|
query: QueryState<
|
||||||
(
|
(
|
||||||
Read<ExtractedCamera>,
|
Read<ExtractedCamera>,
|
||||||
|
@ -135,9 +135,9 @@ pub struct OutlineNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OutlineNode {
|
impl OutlineNode {
|
||||||
pub const IN_VIEW: &'static str = "view";
|
pub(crate) const IN_VIEW: &'static str = "view";
|
||||||
|
|
||||||
pub fn new(world: &mut World) -> Self {
|
pub(crate) fn new(world: &mut World) -> Self {
|
||||||
Self {
|
Self {
|
||||||
query: world.query_filtered(),
|
query: world.query_filtered(),
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,21 +26,21 @@ use crate::uniforms::{OutlineFragmentUniform, OutlineStencilUniform, OutlineVolu
|
||||||
use crate::view_uniforms::OutlineViewUniform;
|
use crate::view_uniforms::OutlineViewUniform;
|
||||||
use crate::ATTRIBUTE_OUTLINE_NORMAL;
|
use crate::ATTRIBUTE_OUTLINE_NORMAL;
|
||||||
|
|
||||||
pub const OUTLINE_SHADER_HANDLE: HandleUntyped =
|
pub(crate) const OUTLINE_SHADER_HANDLE: HandleUntyped =
|
||||||
HandleUntyped::weak_from_u64(Shader::TYPE_UUID, 2101625026478770097);
|
HandleUntyped::weak_from_u64(Shader::TYPE_UUID, 2101625026478770097);
|
||||||
|
|
||||||
pub const FRAGMENT_SHADER_HANDLE: HandleUntyped =
|
pub(crate) const FRAGMENT_SHADER_HANDLE: HandleUntyped =
|
||||||
HandleUntyped::weak_from_u64(Shader::TYPE_UUID, 12033806834125368121);
|
HandleUntyped::weak_from_u64(Shader::TYPE_UUID, 12033806834125368121);
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum PassType {
|
pub(crate) enum PassType {
|
||||||
Stencil = 1,
|
Stencil = 1,
|
||||||
Opaque = 2,
|
Opaque = 2,
|
||||||
Transparent = 3,
|
Transparent = 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
|
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
pub struct PipelineKey(u32);
|
pub(crate) struct PipelineKey(u32);
|
||||||
bitfield_bitrange! {struct PipelineKey(u32)}
|
bitfield_bitrange! {struct PipelineKey(u32)}
|
||||||
|
|
||||||
impl PipelineKey {
|
impl PipelineKey {
|
||||||
|
@ -52,25 +52,25 @@ impl PipelineKey {
|
||||||
pub offset_zero, set_offset_zero: 11;
|
pub offset_zero, set_offset_zero: 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new() -> Self {
|
pub(crate) fn new() -> Self {
|
||||||
PipelineKey(0)
|
PipelineKey(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_msaa_samples(mut self, msaa_samples: u32) -> Self {
|
pub(crate) fn with_msaa_samples(mut self, msaa_samples: u32) -> Self {
|
||||||
self.set_msaa_samples_minus_one(msaa_samples - 1);
|
self.set_msaa_samples_minus_one(msaa_samples - 1);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn msaa_samples(&self) -> u32 {
|
pub(crate) fn msaa_samples(&self) -> u32 {
|
||||||
self.msaa_samples_minus_one() + 1
|
self.msaa_samples_minus_one() + 1
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_primitive_topology(mut self, primitive_topology: PrimitiveTopology) -> Self {
|
pub(crate) fn with_primitive_topology(mut self, primitive_topology: PrimitiveTopology) -> Self {
|
||||||
self.set_primitive_topology_int(primitive_topology as u32);
|
self.set_primitive_topology_int(primitive_topology as u32);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn primitive_topology(&self) -> PrimitiveTopology {
|
pub(crate) fn primitive_topology(&self) -> PrimitiveTopology {
|
||||||
match self.primitive_topology_int() {
|
match self.primitive_topology_int() {
|
||||||
x if x == PrimitiveTopology::PointList as u32 => PrimitiveTopology::PointList,
|
x if x == PrimitiveTopology::PointList as u32 => PrimitiveTopology::PointList,
|
||||||
x if x == PrimitiveTopology::LineList as u32 => PrimitiveTopology::LineList,
|
x if x == PrimitiveTopology::LineList as u32 => PrimitiveTopology::LineList,
|
||||||
|
@ -81,12 +81,12 @@ impl PipelineKey {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_pass_type(mut self, pass_type: PassType) -> Self {
|
pub(crate) fn with_pass_type(mut self, pass_type: PassType) -> Self {
|
||||||
self.set_pass_type_int(pass_type as u32);
|
self.set_pass_type_int(pass_type as u32);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn pass_type(&self) -> PassType {
|
pub(crate) fn pass_type(&self) -> PassType {
|
||||||
match self.pass_type_int() {
|
match self.pass_type_int() {
|
||||||
x if x == PassType::Stencil as u32 => PassType::Stencil,
|
x if x == PassType::Stencil as u32 => PassType::Stencil,
|
||||||
x if x == PassType::Opaque as u32 => PassType::Opaque,
|
x if x == PassType::Opaque as u32 => PassType::Opaque,
|
||||||
|
@ -95,14 +95,14 @@ impl PipelineKey {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_offset_zero(mut self, offset_zero: bool) -> Self {
|
pub(crate) fn with_offset_zero(mut self, offset_zero: bool) -> Self {
|
||||||
self.set_offset_zero(offset_zero);
|
self.set_offset_zero(offset_zero);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct OutlinePipeline {
|
pub(crate) struct OutlinePipeline {
|
||||||
mesh_pipeline: MeshPipeline,
|
mesh_pipeline: MeshPipeline,
|
||||||
pub outline_view_bind_group_layout: BindGroupLayout,
|
pub outline_view_bind_group_layout: BindGroupLayout,
|
||||||
pub outline_stencil_bind_group_layout: BindGroupLayout,
|
pub outline_stencil_bind_group_layout: BindGroupLayout,
|
||||||
|
|
|
@ -18,7 +18,7 @@ use crate::{pipeline::OutlinePipeline, ComputedOutlineDepth, OutlineStencil, Out
|
||||||
macro_rules! outline_vertex_uniform {
|
macro_rules! outline_vertex_uniform {
|
||||||
($x:ident) => {
|
($x:ident) => {
|
||||||
#[derive(Clone, Component, ShaderType)]
|
#[derive(Clone, Component, ShaderType)]
|
||||||
pub struct $x {
|
pub(crate) struct $x {
|
||||||
#[align(16)]
|
#[align(16)]
|
||||||
pub origin: Vec3,
|
pub origin: Vec3,
|
||||||
pub offset: f32,
|
pub offset: f32,
|
||||||
|
@ -30,22 +30,22 @@ outline_vertex_uniform!(OutlineStencilUniform);
|
||||||
outline_vertex_uniform!(OutlineVolumeUniform);
|
outline_vertex_uniform!(OutlineVolumeUniform);
|
||||||
|
|
||||||
#[derive(Clone, Component, ShaderType)]
|
#[derive(Clone, Component, ShaderType)]
|
||||||
pub struct OutlineFragmentUniform {
|
pub(crate) struct OutlineFragmentUniform {
|
||||||
#[align(16)]
|
#[align(16)]
|
||||||
pub colour: Vec4,
|
pub colour: Vec4,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct OutlineStencilBindGroup {
|
pub(crate) struct OutlineStencilBindGroup {
|
||||||
pub bind_group: BindGroup,
|
pub bind_group: BindGroup,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct OutlineVolumeBindGroup {
|
pub(crate) struct OutlineVolumeBindGroup {
|
||||||
pub bind_group: BindGroup,
|
pub bind_group: BindGroup,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn extract_outline_stencil_uniforms(
|
pub(crate) fn extract_outline_stencil_uniforms(
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
query: Extract<Query<(Entity, &OutlineStencil, &ComputedOutlineDepth)>>,
|
query: Extract<Query<(Entity, &OutlineStencil, &ComputedOutlineDepth)>>,
|
||||||
) {
|
) {
|
||||||
|
@ -57,7 +57,7 @@ pub fn extract_outline_stencil_uniforms(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn extract_outline_volume_uniforms(
|
pub(crate) fn extract_outline_volume_uniforms(
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
query: Extract<Query<(Entity, &OutlineVolume, &ComputedOutlineDepth)>>,
|
query: Extract<Query<(Entity, &OutlineVolume, &ComputedOutlineDepth)>>,
|
||||||
) {
|
) {
|
||||||
|
@ -77,7 +77,7 @@ pub fn extract_outline_volume_uniforms(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn queue_outline_stencil_bind_group(
|
pub(crate) fn queue_outline_stencil_bind_group(
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
render_device: Res<RenderDevice>,
|
render_device: Res<RenderDevice>,
|
||||||
outline_pipeline: Res<OutlinePipeline>,
|
outline_pipeline: Res<OutlinePipeline>,
|
||||||
|
@ -96,7 +96,7 @@ pub fn queue_outline_stencil_bind_group(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn queue_outline_volume_bind_group(
|
pub(crate) fn queue_outline_volume_bind_group(
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
render_device: Res<RenderDevice>,
|
render_device: Res<RenderDevice>,
|
||||||
outline_pipeline: Res<OutlinePipeline>,
|
outline_pipeline: Res<OutlinePipeline>,
|
||||||
|
@ -122,7 +122,7 @@ pub fn queue_outline_volume_bind_group(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SetOutlineStencilBindGroup<const I: usize>();
|
pub(crate) struct SetOutlineStencilBindGroup<const I: usize>();
|
||||||
|
|
||||||
impl<const I: usize> EntityRenderCommand for SetOutlineStencilBindGroup<I> {
|
impl<const I: usize> EntityRenderCommand for SetOutlineStencilBindGroup<I> {
|
||||||
type Param = (
|
type Param = (
|
||||||
|
@ -141,7 +141,7 @@ impl<const I: usize> EntityRenderCommand for SetOutlineStencilBindGroup<I> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SetOutlineVolumeBindGroup<const I: usize>();
|
pub(crate) struct SetOutlineVolumeBindGroup<const I: usize>();
|
||||||
|
|
||||||
impl<const I: usize> EntityRenderCommand for SetOutlineVolumeBindGroup<I> {
|
impl<const I: usize> EntityRenderCommand for SetOutlineVolumeBindGroup<I> {
|
||||||
type Param = (
|
type Param = (
|
||||||
|
|
|
@ -14,17 +14,17 @@ use crate::node::{OpaqueOutline, StencilOutline, TransparentOutline};
|
||||||
use crate::pipeline::OutlinePipeline;
|
use crate::pipeline::OutlinePipeline;
|
||||||
|
|
||||||
#[derive(Clone, Component, ShaderType)]
|
#[derive(Clone, Component, ShaderType)]
|
||||||
pub struct OutlineViewUniform {
|
pub(crate) struct OutlineViewUniform {
|
||||||
#[align(16)]
|
#[align(16)]
|
||||||
scale: Vec2,
|
scale: Vec2,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct OutlineViewBindGroup {
|
pub(crate) struct OutlineViewBindGroup {
|
||||||
bind_group: BindGroup,
|
bind_group: BindGroup,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn extract_outline_view_uniforms(
|
pub(crate) fn extract_outline_view_uniforms(
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
query: Extract<Query<(Entity, &Camera), With<Camera3d>>>,
|
query: Extract<Query<(Entity, &Camera), With<Camera3d>>>,
|
||||||
) {
|
) {
|
||||||
|
@ -43,7 +43,7 @@ pub fn extract_outline_view_uniforms(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn queue_outline_view_bind_group(
|
pub(crate) fn queue_outline_view_bind_group(
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
render_device: Res<RenderDevice>,
|
render_device: Res<RenderDevice>,
|
||||||
outline_pipeline: Res<OutlinePipeline>,
|
outline_pipeline: Res<OutlinePipeline>,
|
||||||
|
@ -62,7 +62,7 @@ pub fn queue_outline_view_bind_group(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SetOutlineViewBindGroup<const I: usize>();
|
pub(crate) struct SetOutlineViewBindGroup<const I: usize>();
|
||||||
|
|
||||||
impl<const I: usize> EntityRenderCommand for SetOutlineViewBindGroup<I> {
|
impl<const I: usize> EntityRenderCommand for SetOutlineViewBindGroup<I> {
|
||||||
type Param = (
|
type Param = (
|
||||||
|
|
Loading…
Reference in New Issue