Skip to content

Commit 582b0ac

Browse files
author
bors-servo
authored
Auto merge of #1821 - nical:shader-names, r=kvark
Insert the shader name in the source. This makes life easier when looking at apitrace recordings. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1821) <!-- Reviewable:end -->
2 parents 4052fe4 + 6bae0eb commit 582b0ac

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

webrender/src/device.rs

+5
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)