Skip to content

Insert the shader name in the source. #1821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions webrender/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps, it would make sense to do in debug only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use apitrace with release builds too and I don't think this adds any noticeable overhead so I lean towards leaving it in release builds as well unless you feel strongly about it.

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);
Expand Down