Skip to content

Commit 6bae0eb

Browse files
committed
Insert the shader name in the source.
This makes life easier when looking at apitrace recordings.
1 parent 1a21291 commit 6bae0eb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

webrender/src/device.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ pub fn build_shader_strings(
183183
vs_source.push_str(gl_version_string);
184184
fs_source.push_str(gl_version_string);
185185

186+
// Insert the shader name to make debugging easier.
187+
let name_string = format!("// {}\n", base_filename);
188+
vs_source.push_str(&name_string);
189+
fs_source.push_str(&name_string);
190+
186191
// Define a constant depending on whether we are compiling VS or FS.
187192
vs_source.push_str(SHADER_KIND_VERTEX);
188193
fs_source.push_str(SHADER_KIND_FRAGMENT);

0 commit comments

Comments
 (0)