CI check that docs are able to be built without warnings (#601)

* CI check that docs are able to be built without warnings
This commit is contained in:
Ashley Hauck 2021-04-23 10:12:02 +02:00 committed by GitHub
parent 3d710e7c4b
commit ec131ca95c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 36 deletions

View File

@ -100,6 +100,8 @@ jobs:
run: cargo fmt --all -- --check
- name: Rustfmt tests
run: rustfmt --check tests/ui/**/*.rs
- name: Check docs are valid
run: RUSTDOCFLAGS=-Dwarnings cargo doc
- name: Clippy
run: .github/workflows/clippy.sh

View File

@ -23,10 +23,9 @@ use crate::memory::{Scope, Semantics};
/// no such restriction starting with version 1.3.
///
/// If used with the `TessellationControl` execution model, it also implicitly
/// synchronizes the [`crate::storage_class::Output`] Storage Class: Writes to
/// `Output` variables performed by any invocation executed prior to a
/// [`control_barrier`] are visible to any other invocation proceeding beyond
/// that [`control_barrier`].
/// synchronizes the `output` storage class: Writes to `output` variables
/// performed by any invocation executed prior to a [`control_barrier`] are
/// visible to any other invocation proceeding beyond that [`control_barrier`].
#[spirv_std_macros::gpu_only]
#[doc(alias = "OpControlBarrier")]
#[inline]

View File

@ -1,5 +1,3 @@
//! The [`Derivative`] trait for getting derivatives and handling derivative
//! operations in SPIR-V.
use crate::float::Float;
#[cfg(target_arch = "spirv")]
@ -28,18 +26,17 @@ macro_rules! deriv_fn {
};
}
/// Returns the partial derivative of `Self` with respect to the window's
/// X coordinate. Returns the same result as either
/// [`Self::ddx_fine`] or [`Self::ddx_coarse`], selection of which one is
/// dependent on external factors.
/// Returns the partial derivative of `component` with respect to the window's X
/// coordinate. Returns the same result as either [`ddx_fine`] or
/// [`ddx_coarse`], selection of which one is dependent on external factors.
#[spirv_std_macros::vectorized]
#[spirv_std_macros::gpu_only]
pub fn ddx<F: Float>(component: F) -> F {
deriv_fn!(component, OpDPdx, false)
}
/// Returns the partial derivative of `Self` with respect to the window's
/// X coordinate. Uses local differencing based on the value of `Self` for
/// Returns the partial derivative of `component` with respect to the window's X
/// coordinate. Uses local differencing based on the value of `component` for
/// the current fragment and its immediate neighbor(s).
#[spirv_std_macros::vectorized]
#[spirv_std_macros::gpu_only]
@ -47,30 +44,29 @@ pub fn ddx_fine<F: Float>(component: F) -> F {
deriv_fn!(component, OpDPdxFine, true)
}
/// Returns the partial derivative of `Self` with respect to the window's
/// X coordinate. Uses local differencing based on the value of `Self` for
/// Returns the partial derivative of `component` with respect to the window's X
/// coordinate. Uses local differencing based on the value of `component` for
/// the current fragments neighbors, and possibly, but not necessarily,
/// includes the value of `Self` for the current fragment. That is, over a
/// given area, the implementation can compute X derivatives in fewer
/// unique locations than would be allowed by [`Self::ddx_fine`].
/// includes the value of `component` for the current fragment. That is, over a
/// given area, the implementation can compute X derivatives in fewer unique
/// locations than would be allowed by [`ddx_fine`].
#[spirv_std_macros::vectorized]
#[spirv_std_macros::gpu_only]
pub fn ddx_coarse<F: Float>(component: F) -> F {
deriv_fn!(component, OpDPdxCoarse, true)
}
/// Returns the partial derivative of `Self` with respect to the window's
/// Y coordinate. Returns the same result as either [`Self::ddy_fine`] or
/// [`Self::ddy_coarse`], selection of which one is dependent on
/// external factors.
/// Returns the partial derivative of `component` with respect to the window's Y
/// coordinate. Returns the same result as either [`ddy_fine`] or
/// [`ddy_coarse`], selection of which one is dependent on external factors.
#[spirv_std_macros::vectorized]
#[spirv_std_macros::gpu_only]
pub fn ddy<F: Float>(component: F) -> F {
deriv_fn!(component, OpDPdy, false)
}
/// Returns the partial derivative of `Self` with respect to the window's
/// Y coordinate. Uses local differencing based on the value of `Self` for
/// Returns the partial derivative of `component` with respect to the window's Y
/// coordinate. Uses local differencing based on the value of `component` for
/// the current fragment and its immediate neighbor(s).
#[spirv_std_macros::vectorized]
#[spirv_std_macros::gpu_only]
@ -78,36 +74,36 @@ pub fn ddy_fine<F: Float>(component: F) -> F {
deriv_fn!(component, OpDPdyFine, true)
}
/// Returns the partial derivative of `Self` with respect to the window's
/// Y coordinate. Uses local differencing based on the value of `Self` for
/// Returns the partial derivative of `component` with respect to the window's Y
/// coordinate. Uses local differencing based on the value of `component` for
/// the current fragments neighbors, and possibly, but not necessarily,
/// includes the value of `Self` for the current fragment. That is, over a
/// given area, the implementation can compute Y derivatives in fewer
/// unique locations than would be allowed by [`Derivative::ddy_fine`].
/// includes the value of `component` for the current fragment. That is, over a
/// given area, the implementation can compute Y derivatives in fewer unique
/// locations than would be allowed by [`ddy_fine`].
#[spirv_std_macros::vectorized]
#[spirv_std_macros::gpu_only]
pub fn ddy_coarse<F: Float>(component: F) -> F {
deriv_fn!(component, OpDPdyCoarse, true)
}
/// Returns the sum of the absolute values of [`Self::ddx`] and
/// [`Self::ddy`] as a single operation.
/// Returns the sum of the absolute values of [`ddx`] and [`ddy`] as a single
/// operation.
#[spirv_std_macros::vectorized]
#[spirv_std_macros::gpu_only]
pub fn fwidth<F: Float>(component: F) -> F {
deriv_fn!(component, OpFwidth, false)
}
/// Returns the sum of the absolute values of [`Self::ddx_fine`] and
/// [`Self::ddy_fine`] as a single operation.
/// Returns the sum of the absolute values of [`ddx_fine`] and [`ddy_fine`] as a
/// single operation.
#[spirv_std_macros::vectorized]
#[spirv_std_macros::gpu_only]
pub fn fwidth_fine<F: Float>(component: F) -> F {
deriv_fn!(component, OpFwidthFine, true)
}
/// Returns the sum of the absolute values of [`Self::ddx_coarse`] and
/// [`Self::ddy_coarse`] as a single operation.
/// Returns the sum of the absolute values of [`ddx_coarse`] and [`ddy_coarse`]
/// as a single operation.
#[spirv_std_macros::vectorized]
#[spirv_std_macros::gpu_only]
pub fn fwidth_coarse<F: Float>(component: F) -> F {

View File

@ -10,7 +10,7 @@ pub struct AccelerationStructure {
}
impl AccelerationStructure {
/// Converts a 64-bit integer into an [`AccelerationStructureKHR`].
/// Converts a 64-bit integer into an [`AccelerationStructure`].
/// # Safety
/// The 64-bit integer must point to a valid acceleration structure.
#[spirv_std_macros::gpu_only]
@ -31,7 +31,7 @@ impl AccelerationStructure {
loop {}
}
/// Converts a vector of two 32 bit integers into an [`AccelerationStructureKHR`].
/// Converts a vector of two 32 bit integers into an [`AccelerationStructure`].
/// # Safety
/// The combination must point to a valid acceleration structure.
#[spirv_std_macros::gpu_only]