Bug 1649861: Turn of RendererOptions::clear_caches_with_quads under SWGL. r=lsalzman

The `clear_caches_with_quads` flags is meant to work around a bug in some
drivers' scissored clears, but its implementation uses the `GL_ALWAYS` depth
comparison function, which SWGL doesn't support.

SWGL does scissored clears very well, so simply turning this workaround off on
SWGL avoids the problem and gets good results.

Of course we could just make SWGL support `GL_ALWAYS`, but that would be kind of
annoying, since it basically disables depth checks altogether, and we want to
use entirely different paths when depth checks aren't needed.

Differential Revision: https://phabricator.services.mozilla.com/D81918
This commit is contained in:
Jim Blandy 2020-07-01 22:27:56 +00:00
parent 8862fb303a
commit 1f4b5cd074
2 changed files with 6 additions and 1 deletions

View File

@ -1524,7 +1524,9 @@ pub extern "C" fn wr_window_new(
namespace_alloc_by_client: true, namespace_alloc_by_client: true,
enable_picture_caching, enable_picture_caching,
allow_pixel_local_storage_support: false, allow_pixel_local_storage_support: false,
clear_caches_with_quads: !allow_scissored_cache_clears, // SWGL doesn't support the GL_ALWAYS depth comparison function used by
// `clear_caches_with_quads`, but scissored clears work well.
clear_caches_with_quads: !software && !allow_scissored_cache_clears,
start_debug_server, start_debug_server,
surface_origin_is_top_left: !software && surface_origin_is_top_left, surface_origin_is_top_left: !software && surface_origin_is_top_left,
compositor_config, compositor_config,

View File

@ -269,6 +269,9 @@ impl Wrench {
allow_dual_source_blending: !disable_dual_source_blending, allow_dual_source_blending: !disable_dual_source_blending,
allow_advanced_blend_equation: true, allow_advanced_blend_equation: true,
dump_shader_source, dump_shader_source,
// SWGL doesn't support the GL_ALWAYS depth comparison function used by
// `clear_caches_with_quads`, but scissored clears work well.
clear_caches_with_quads: !window.is_software(),
..Default::default() ..Default::default()
}; };