Doc fixes: Broken links, <code> formatting.

This commit is contained in:
Jim Blandy
2021-07-12 12:46:27 -07:00
parent 3cbd845afb
commit 51dc5b407c
3 changed files with 11 additions and 6 deletions

View File

@@ -585,7 +585,8 @@ impl MapContext {
/// Handle to a GPU-accessible buffer.
///
/// Created with [`Device::create_buffer`] or [DeviceExt::create_buffer_init](util::DeviceExt::create_buffer_init)
/// Created with [`Device::create_buffer`] or
/// [`DeviceExt::create_buffer_init`](util::DeviceExt::create_buffer_init).
#[derive(Debug)]
pub struct Buffer {
context: Arc<C>,
@@ -1584,7 +1585,7 @@ impl Device {
/// This function passes binary data to the backend as-is and can potentially result in a
/// driver crash or bogus behaviour. No attempt is made to ensure that data is valid SPIR-V.
///
/// See also [`crate::include_spirv_raw!`] and [`crate::make_spirv_raw`].
/// See also [`include_spirv_raw!`] and [`util::make_spirv_raw`].
pub unsafe fn create_shader_module_spirv(
&self,
desc: &ShaderModuleDescriptorSpirV,
@@ -2263,7 +2264,7 @@ impl CommandEncoder {
impl CommandEncoder {
/// Resolve a query set, writing the results into the supplied destination buffer.
///
/// Queries may be between 8 and 40 bytes each. See [`PipelineStatisticsType`] for more information.
/// Queries may be between 8 and 40 bytes each. See [`PipelineStatisticsTypes`] for more information.
pub fn resolve_query_set(
&mut self,
query_set: &QuerySet,

View File

@@ -1,13 +1,13 @@
//! Convenience macros
/// Macro to produce an array of [VertexAttribute](crate::VertexAttribute).
/// Macro to produce an array of [`VertexAttribute`](crate::VertexAttribute).
///
/// Output has type: `[VertexAttribute; _]`. Usage is as follows:
/// ```
/// # use wgpu::vertex_attr_array;
/// let attrs = vertex_attr_array![0 => Float32x2, 1 => Float32, 2 => Uint16x4];
/// ```
/// This example specifies a list of three [VertexAttribute](crate::VertexAttribute),
/// This example specifies a list of three [`VertexAttribute`](crate::VertexAttribute),
/// each with the given `shader_location` and `format`.
/// Offsets are calculated automatically.
#[macro_export]
@@ -57,9 +57,11 @@ macro_rules! include_spirv {
};
}
/// Macro to load raw SPIR-V data statically, for use with [`wgpu::Features::SPIRV_SHADER_PASSTHROUGH`].
/// Macro to load raw SPIR-V data statically, for use with [`Features::SPIRV_SHADER_PASSTHROUGH`].
///
/// It ensures the word alignment as well as the magic number.
///
/// [`Features::SPIRV_SHADER_PASSTHROUGH`]: crate::Features::SPIRV_SHADER_PASSTHROUGH
#[macro_export]
macro_rules! include_spirv_raw {
($($token:tt)*) => {

View File

@@ -36,6 +36,8 @@ pub fn make_spirv(data: &[u8]) -> super::ShaderSource {
/// Version of [`make_spirv`] intended for use with [`Device::create_shader_module_spirv`].
/// Returns raw slice instead of ShaderSource.
///
/// [`Device::create_shader_module_spirv`]: crate::Device::create_shader_module_spirv
pub fn make_spirv_raw(data: &[u8]) -> Cow<[u32]> {
const MAGIC_NUMBER: u32 = 0x0723_0203;
assert_eq!(