mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Docs surface creation no longer unsafe (#5265)
* doc: as of #4597 surface creation is no longer unsafe * doc: extend documentation of the include_wgsl macro
This commit is contained in:
@@ -358,7 +358,7 @@ static_assertions::assert_impl_all!(SurfaceConfiguration: Send, Sync);
|
||||
/// Handle to a presentable surface.
|
||||
///
|
||||
/// A `Surface` represents a platform-specific surface (e.g. a window) onto which rendered images may
|
||||
/// be presented. A `Surface` may be created with the unsafe function [`Instance::create_surface`].
|
||||
/// be presented. A `Surface` may be created with the function [`Instance::create_surface`].
|
||||
///
|
||||
/// This type is unique to the Rust API of `wgpu`. In the WebGPU specification,
|
||||
/// [`GPUCanvasContext`](https://gpuweb.github.io/gpuweb/#canvas-context)
|
||||
|
||||
@@ -78,7 +78,16 @@ macro_rules! include_spirv_raw {
|
||||
};
|
||||
}
|
||||
|
||||
/// Macro to load a WGSL module statically.
|
||||
/// Load WGSL source code from a file at compile time.
|
||||
///
|
||||
/// The loaded path is relative to the path of the file containing the macro call, in the same way
|
||||
/// as [`include_str!`] operates.
|
||||
///
|
||||
/// ```ignore
|
||||
/// fn main() {
|
||||
/// let module: ShaderModuleDescriptor = include_wgsl!("shader.wgsl");
|
||||
/// }
|
||||
/// ```
|
||||
#[macro_export]
|
||||
macro_rules! include_wgsl {
|
||||
($($token:tt)*) => {
|
||||
|
||||
Reference in New Issue
Block a user