Skip to content

Commit

Permalink
Bug 1623074 - add debug shaders to SWGL build. r=jrmuizel
Browse files Browse the repository at this point in the history
  • Loading branch information
lsalzman authored and github-sync committed Oct 9, 2020
1 parent 624f618 commit 5863663
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion swgl/build.rs
Expand Up @@ -112,7 +112,8 @@ fn main() {

let shader_flags =
ShaderFeatureFlags::GL |
ShaderFeatureFlags::DUAL_SOURCE_BLENDING;
ShaderFeatureFlags::DUAL_SOURCE_BLENDING |
ShaderFeatureFlags::DEBUG;
let mut shaders: Vec<String> = Vec::new();
for (name, features) in get_shader_features(shader_flags) {
shaders.extend(features.iter().map(|f| {
Expand Down
7 changes: 7 additions & 0 deletions webrender_build/src/shader_features.rs
Expand Up @@ -15,6 +15,7 @@ bitflags! {
const PIXEL_LOCAL_STORAGE = 1 << 10;
const DITHERING = 1 << 11;
const TEXTURE_EXTERNAL = 1 << 12;
const DEBUG = 1 << 13;
}
}

Expand Down Expand Up @@ -200,6 +201,12 @@ pub fn get_shader_features(flags: ShaderFeatureFlags) -> ShaderFeatures {

shaders.insert("ps_clear", vec![base_prim_features.finish()]);

if flags.contains(ShaderFeatureFlags::DEBUG) {
for name in &["debug_color", "debug_font"] {
shaders.insert(name, vec![String::new()]);
}
}

shaders
}

0 comments on commit 5863663

Please sign in to comment.