Skip to content
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

Sync changes from mozilla-central #3816

Merged
merged 3 commits into from Dec 18, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Bug 1604625 - Add nightly config value to enable GL error checking. r…

  • Loading branch information
Glenn Watson authored and moz-gfx committed Dec 18, 2019
commit f432b60a5b9b6371bef029594232101e53308b7b
@@ -1253,6 +1253,7 @@ impl Device {
allow_texture_swizzling: bool,
dump_shader_source: Option<String>,
surface_origin_is_top_left: bool,
panic_on_gl_error: bool,
) -> Device {
let mut max_texture_size = [0];
let mut max_texture_layers = [0];
@@ -1279,11 +1280,12 @@ impl Device {
// this on release builds because the synchronous call can stall the
// pipeline.
let supports_khr_debug = supports_extension(&extensions, "GL_KHR_debug");
if cfg!(debug_assertions) {
if panic_on_gl_error || cfg!(debug_assertions) {
gl = gl::ErrorReactingGl::wrap(gl, move |gl, name, code| {
if supports_khr_debug {
Self::log_driver_messages(gl);
}
println!("Caught GL error {:x} at {}", code, name);
panic!("Caught GL error {:x} at {}", code, name);
});
}
@@ -1974,6 +1974,7 @@ impl Renderer {
options.allow_texture_swizzling,
options.dump_shader_source.take(),
options.surface_origin_is_top_left,
options.panic_on_gl_error,
);

let color_cache_formats = device.preferred_color_formats();
@@ -6178,6 +6179,9 @@ pub struct RendererOptions {
/// The configuration options defining how WR composites the final scene.
pub compositor_config: CompositorConfig,
pub enable_gpu_markers: bool,
/// If true, panic whenever a GL error occurs. This has a significant
/// performance impact, so only use when debugging specific problems!
pub panic_on_gl_error: bool,
}

impl Default for RendererOptions {
@@ -6233,6 +6237,7 @@ impl Default for RendererOptions {
surface_origin_is_top_left: false,
compositor_config: CompositorConfig::default(),
enable_gpu_markers: true,
panic_on_gl_error: false,
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.