Fix doc_markdown lints in bevy_render (#3479)

#3457 adds the `doc_markdown` clippy lint, which checks doc comments to make sure code identifiers are escaped with backticks. This causes a lot of lint errors, so this is one of a number of PR's that will fix those lint errors one crate at a time.

This PR fixes lints in the `bevy_render` crate.
This commit is contained in:
Michael Dorst 2022-01-09 11:09:46 +00:00
parent 6f167aa3d6
commit e56685370b
13 changed files with 23 additions and 23 deletions

View file

@ -381,7 +381,7 @@ impl Color {
}
}
/// Converts a `Color` to a `[f32; 4]` from sRBG colorspace
/// Converts a `Color` to a `[f32; 4]` from sRGB colorspace
pub fn as_rgba_f32(self: Color) -> [f32; 4] {
match self {
Color::Rgba {

View file

@ -1,5 +1,5 @@
//! These implementations allow you to
//! convert std::vec::Vec<T> to VertexAttributeValues::T and back.
//! convert `std::vec::Vec<T>` to `VertexAttributeValues::T` and back.
//!
//! # Examples
//!

View file

@ -68,9 +68,9 @@ impl Mesh {
/// Per vertex joint transform matrix index. Use in conjunction with [`Mesh::set_attribute`]
pub const ATTRIBUTE_JOINT_INDEX: &'static str = "Vertex_JointIndex";
/// Construct a new mesh. You need to provide a PrimitiveTopology so that the
/// Construct a new mesh. You need to provide a [`PrimitiveTopology`] so that the
/// renderer knows how to treat the vertex data. Most of the time this will be
/// `PrimitiveTopology::TriangleList`.
/// [`PrimitiveTopology::TriangleList`].
pub fn new(primitive_topology: PrimitiveTopology) -> Self {
Mesh {
primitive_topology,
@ -269,7 +269,7 @@ impl Mesh {
///
/// # Panics
/// Panics if [`Indices`] are set or [`Mesh::ATTRIBUTE_POSITION`] is not of type `float3`.
/// Consider calling [Mesh::duplicate_vertices] or export your mesh with normal attributes.
/// Consider calling [`Mesh::duplicate_vertices`] or export your mesh with normal attributes.
pub fn compute_flat_normals(&mut self) {
if self.indices().is_some() {
panic!("`compute_flat_normals` can't work on indexed geometry. Consider calling `Mesh::duplicate_vertices`.");
@ -404,8 +404,8 @@ pub enum VertexAttributeValues {
}
impl VertexAttributeValues {
/// Returns the number of vertices in this VertexAttribute. For a single
/// mesh, all of the VertexAttributeValues must have the same length.
/// Returns the number of vertices in this [`VertexAttributeValues`]. For a single
/// mesh, all of the [`VertexAttributeValues`] must have the same length.
pub fn len(&self) -> usize {
match *self {
VertexAttributeValues::Float32(ref values) => values.len(),
@ -439,7 +439,7 @@ impl VertexAttributeValues {
}
}
/// Returns `true` if there are no vertices in this VertexAttributeValue.
/// Returns `true` if there are no vertices in this [`VertexAttributeValues`].
pub fn is_empty(&self) -> bool {
self.len() == 0
}
@ -453,7 +453,7 @@ impl VertexAttributeValues {
}
// TODO: add vertex format as parameter here and perform type conversions
/// Flattens the VertexAttributeArray into a sequence of bytes. This is
/// Flattens the [`VertexAttributeValues`] into a sequence of bytes. This is
/// useful for serialization and sending to the GPU.
pub fn get_bytes(&self) -> &[u8] {
match self {

View file

@ -27,7 +27,7 @@ pub trait RenderAsset: Asset {
/// The GPU-representation of the the asset.
type PreparedAsset: Send + Sync + 'static;
/// Specifies all ECS data required by [`RenderAsset::prepare_asset`].
/// For convenience use the [`lifetimeless`](bevy_ecs::system::lifetimeless) SystemParams.
/// For convenience use the [`lifetimeless`](bevy_ecs::system::lifetimeless) [`SystemParam`].
type Param: SystemParam;
/// Converts the asset into a [`RenderAsset::ExtractedAsset`].
fn extract_asset(&self) -> Self::ExtractedAsset;

View file

@ -6,8 +6,8 @@ use super::NodeId;
/// They are used to describe the ordering (which node has to run first)
/// and may be of two kinds: [`NodeEdge`](Self::NodeEdge) and [`SlotEdge`](Self::SlotEdge).
///
/// Edges are added via the render_graph::add_node_edge(output_node, input_node) and the
/// render_graph::add_slot_edge(output_node, output_slot, input_node, input_slot) methods.
/// Edges are added via the `render_graph::add_node_edge(output_node, input_node)` and the
/// `render_graph::add_slot_edge(output_node, output_slot, input_node, input_slot)` methods.
///
/// The former simply states that the `output_node` has to be run before the `input_node`,
/// while the later connects an output slot of the `output_node`
@ -32,7 +32,7 @@ pub enum Edge {
}
impl Edge {
/// Returns the id of the 'input_node'.
/// Returns the id of the `input_node`.
pub fn get_input_node(&self) -> NodeId {
match self {
Edge::SlotEdge { input_node, .. } => *input_node,
@ -40,7 +40,7 @@ impl Edge {
}
}
/// Returns the id of the 'output_node'.
/// Returns the id of the `output_node`.
pub fn get_output_node(&self) -> NodeId {
match self {
Edge::SlotEdge { output_node, .. } => *output_node,

View file

@ -33,7 +33,7 @@ impl NodeId {
///
/// Nodes are the fundamental part of the graph and used to extend its functionality, by
/// generating draw calls and/or running subgraphs.
/// They are added via the render_graph::add_node(my_node) methode.
/// They are added via the `render_graph::add_node(my_node)` method.
///
/// To determine their position in the graph and ensure that all required dependencies (inputs)
/// are already executed, [`Edges`](Edge) are used.

View file

@ -4,7 +4,7 @@ use std::borrow::Cow;
use crate::render_resource::{Buffer, Sampler, TextureView};
/// A value passed between render [`Nodes`](super::Node).
/// Corresponds to the [SlotType] specified in the [`RenderGraph`](super::RenderGraph).
/// Corresponds to the [`SlotType`] specified in the [`RenderGraph`](super::RenderGraph).
///
/// Slots can have four different types of values:
/// [`Buffer`], [`TextureView`], [`Sampler`] and [`Entity`].

View file

@ -110,7 +110,7 @@ impl<P: PhaseItem> DrawFunctions<P> {
}
}
/// RenderCommand is a trait that runs an ECS query and produces one or more
/// [`RenderCommand`] is a trait that runs an ECS query and produces one or more
/// [`TrackedRenderPass`] calls. Types implementing this trait can be composed (as tuples).
///
/// They can be registered as a [`Draw`] function via the

View file

@ -249,7 +249,7 @@ impl<'a> TrackedRenderPass<'a> {
/// Set push constant data.
///
/// Features::PUSH_CONSTANTS must be enabled on the device in order to call these functions.
/// `Features::PUSH_CONSTANTS` must be enabled on the device in order to call these functions.
pub fn set_push_constants(&mut self, stages: ShaderStages, offset: u32, data: &[u8]) {
trace!(
"set push constants: {:?} offset: {} data.len: {}",

View file

@ -11,7 +11,7 @@ use wgpu::{
#[derive(Copy, Clone, Hash, Eq, PartialEq, Debug)]
pub struct RenderPipelineId(Uuid);
/// A RenderPipeline represents a graphics pipeline and its stages (shaders), bindings and vertex buffers.
/// A [`RenderPipeline`] represents a graphics pipeline and its stages (shaders), bindings and vertex buffers.
///
/// May be converted from and dereferences to a wgpu [`RenderPipeline`](wgpu::RenderPipeline).
/// Can be created via [`RenderDevice::create_render_pipeline`](crate::renderer::RenderDevice::create_render_pipeline).
@ -50,7 +50,7 @@ impl Deref for RenderPipeline {
#[derive(Copy, Clone, Hash, Eq, PartialEq, Debug)]
pub struct ComputePipelineId(Uuid);
/// A ComputePipeline represents a compute pipeline and its single shader stage.
/// A [`ComputePipeline`] represents a compute pipeline and its single shader stage.
///
/// May be converted from and dereferences to a wgpu [`ComputePipeline`](wgpu::ComputePipeline).
/// Can be created via [`RenderDevice::create_compute_pipeline`](crate::renderer::RenderDevice::create_compute_pipeline).

View file

@ -51,7 +51,7 @@ impl Deref for Texture {
pub struct TextureViewId(Uuid);
/// This type combines wgpu's [`TextureView`](wgpu::TextureView) and
/// [SurfaceTexture`](wgpu::SurfaceTexture) into the same interface.
/// [`SurfaceTexture`](wgpu::SurfaceTexture) into the same interface.
#[derive(Clone, Debug)]
pub enum TextureViewValue {
/// The value is an actual wgpu [`TextureView`](wgpu::TextureView).

View file

@ -35,7 +35,7 @@ impl RenderDevice {
self.device.limits()
}
/// Creates a [ShaderModule](wgpu::ShaderModule) from either SPIR-V or WGSL source code.
/// Creates a [`ShaderModule`](wgpu::ShaderModule) from either SPIR-V or WGSL source code.
#[inline]
pub fn create_shader_module(&self, desc: &wgpu::ShaderModuleDescriptor) -> wgpu::ShaderModule {
self.device.create_shader_module(desc)

View file

@ -189,7 +189,7 @@ impl Image {
}
/// Load a bytes buffer in a [`Texture`], according to type `image_type`, using the `image`
/// crate`
/// crate
pub fn from_buffer(buffer: &[u8], image_type: ImageType) -> Result<Image, TextureError> {
let format = match image_type {
ImageType::MimeType(mime_type) => match mime_type {