Bug 1897444 - Pass base color in add_composite_prim, then ignore it in the shader (release). r=gw, a=dmeehan

This appears to work around the glitch on Windows + Adreno. It is unclear why. The fact that this so far only reproduced on windows on arm looks like a driver issue, however from the workaround it looks like there might be a confusion between the textured and non-textured code paths with composite quads.

Differential Revision: https://phabricator.services.mozilla.com/D216302
This commit is contained in:
Nicolas Silva 2024-07-11 13:50:13 +00:00
parent 13f3af6658
commit 6d349fbdac
2 changed files with 13 additions and 1 deletions

View file

@ -16,6 +16,13 @@ void pattern_vertex(PrimitiveInfo info) {
if (info.segment.uv_rect.p0 != info.segment.uv_rect.p1) {
// Textured
v_flags_textured = 1;
// TODO: Ideally we would unconditionally modulate the texture with the provided
// base color, however we are currently getting glitches on Adreno GPUs on Windows
// if the base color is set to white for composite primitives. While we figure this
// out, v_color is forced to white here in the textured case, which restores the
// behavior from before the patch that introduced the glitches.
// See comment in `add_composite_prim`.
v_color = vec4(1.0);
vec2 f = (info.local_pos - info.segment.rect.p0) / rect_size(info.segment.rect);
vs_init_sample_color0(f, info.segment.uv_rect);

View file

@ -696,7 +696,12 @@ fn add_composite_prim(
&mut frame_state.frame_gpu_data.f32,
rect,
rect,
PremultipliedColorF::WHITE,
// TODO: The base color for composite prim should be opaque white
// (or white with some transparency to support an opacity directly
// in the quad primitive). However, passing opaque white
// here causes glitches with Adreno GPUs on Windows specifically
// (See bug 1897444).
pattern.base_color,
segments,
ScaleOffset::identity(),
);