mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1567472 - Fix bug in preserve-3d batching code in WebRender. r=nical
The code to batch preserve-3d elements was incorrectly using the bounds and visibility mask from the parent element. This could result in batching bugs in some cases, which were showing up as draw order issues. Differential Revision: https://phabricator.services.mozilla.com/D38834 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
93bd4b973a
commit
be4cf10770
@ -1137,6 +1137,10 @@ impl BatchBuilder {
|
||||
gpu_cache,
|
||||
);
|
||||
|
||||
// Need a new z-id for each child preserve-3d context added
|
||||
// by this inner loop.
|
||||
let z_id = z_generator.next();
|
||||
|
||||
let prim_header_index = prim_headers.push(&prim_header, z_id, [
|
||||
uv_rect_address.as_int(),
|
||||
if raster_config.establishes_raster_root { 1 } else { 0 },
|
||||
@ -1152,11 +1156,11 @@ impl BatchBuilder {
|
||||
|
||||
self.add_split_composite_instance_to_batches(
|
||||
key,
|
||||
&prim_info.clip_chain.pic_clip_rect,
|
||||
&child_prim_info.clip_chain.pic_clip_rect,
|
||||
z_id,
|
||||
prim_header_index,
|
||||
child.gpu_address,
|
||||
prim_info.visibility_mask,
|
||||
child_prim_info.visibility_mask,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
15
gfx/wr/wrench/reftests/split/order-3-ref.yaml
Normal file
15
gfx/wr/wrench/reftests/split/order-3-ref.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
root:
|
||||
items:
|
||||
-
|
||||
type: rect
|
||||
bounds: [8, 8, 200, 200]
|
||||
color: blue
|
||||
-
|
||||
type: rect
|
||||
bounds: [8, 208, 200, 200]
|
||||
color: blue
|
||||
-
|
||||
type: rect
|
||||
bounds: [8, 408, 200, 200]
|
||||
color: blue
|
31
gfx/wr/wrench/reftests/split/order-3.yaml
Normal file
31
gfx/wr/wrench/reftests/split/order-3.yaml
Normal file
@ -0,0 +1,31 @@
|
||||
# Ensure that preserve-3d items are correctly batched with transparent siblings.
|
||||
---
|
||||
root:
|
||||
items:
|
||||
-
|
||||
type: stacking-context
|
||||
transform-style: "preserve-3d"
|
||||
items:
|
||||
-
|
||||
type: rect
|
||||
bounds: [8, 8, 200, 200]
|
||||
color: blue
|
||||
-
|
||||
type: stacking-context
|
||||
transform-style: "preserve-3d"
|
||||
items:
|
||||
-
|
||||
type: rect
|
||||
bounds: [8, 208, 200, 200]
|
||||
color: blue
|
||||
- type: rect
|
||||
color: [255, 0, 0, 0.5]
|
||||
bounds: [8, 408, 200, 200]
|
||||
-
|
||||
type: stacking-context
|
||||
transform-style: "preserve-3d"
|
||||
items:
|
||||
-
|
||||
type: rect
|
||||
bounds: [8, 408, 200, 200]
|
||||
color: blue
|
@ -19,3 +19,4 @@ platform(linux,mac) fuzzy(1,20) == same-plane.yaml same-plane.png
|
||||
== mixed-order.yaml mixed-order-ref.yaml
|
||||
fuzzy(1,40000) == filter.yaml filter-ref.yaml
|
||||
fuzzy(1,10000) == gradient.yaml gradient-ref.yaml
|
||||
== order-3.yaml order-3-ref.yaml
|
||||
|
Loading…
Reference in New Issue
Block a user