From 8ee04f9dcea302a87c1b12aa052a9ceadf818ac5 Mon Sep 17 00:00:00 2001 From: Krishna Ayyalasomayajula Date: Sat, 30 May 2026 20:20:53 -0500 Subject: [PATCH] docs: standardize shader file path to shader.wgsl --- docs/concepts/shader-basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/shader-basics.md b/docs/concepts/shader-basics.md index ca04e82..d362767 100644 --- a/docs/concepts/shader-basics.md +++ b/docs/concepts/shader-basics.md @@ -128,7 +128,7 @@ fn fs_main(input: VertexOutput) -> @location(0) vec4 { In wgpu, the shader source code lives as a Rust string, embedded at compile time: ```rust -const SHADER_SOURCE: &str = include_str!("shaders/main.wgsl"); +const SHADER_SOURCE: &str = include_str!("shader.wgsl"); ``` `include_str!` reads the WGSL file during Rust compilation and inlines it as a `&'static str`. There is no runtime file I/O. The shader text is part of the binary. When you create the shader module via `device.create_shader_module()`, wgpu compiles the string to the platform's GPU intermediate format (SPIR-V, MSL, or DXIL). The compilation happens asynchronously on the [[device]](GLOSSARY.md#device) — you drive it to completion with a [[device poll]](GLOSSARY.md#device-poll).