From 6bae0eb504e01ece067e79edc3a31a4f00024b8b Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Fri, 6 Oct 2017 11:33:58 +0200 Subject: [PATCH] Insert the shader name in the source. This makes life easier when looking at apitrace recordings. --- webrender/src/device.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webrender/src/device.rs b/webrender/src/device.rs index 37fd6dffb8..688f374e9d 100644 --- a/webrender/src/device.rs +++ b/webrender/src/device.rs @@ -183,6 +183,11 @@ pub fn build_shader_strings( vs_source.push_str(gl_version_string); fs_source.push_str(gl_version_string); + // Insert the shader name to make debugging easier. + let name_string = format!("// {}\n", base_filename); + vs_source.push_str(&name_string); + fs_source.push_str(&name_string); + // Define a constant depending on whether we are compiling VS or FS. vs_source.push_str(SHADER_KIND_VERTEX); fs_source.push_str(SHADER_KIND_FRAGMENT);