Closed Bug 1548131 Opened 5 years ago Closed 5 years ago

Assertion failure during texture cache reallocation

Categories

(Core :: Graphics: WebRender, defect, P3)

Other Branch
x86
Android
defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: kats, Assigned: kvark)

References

Details

Attachments

(1 file)

Running the wrench reftests on Android (7.0 emulator) I can reproduce an assertion failure at this line. The call site is here and is happening during texture cache reallocation. Apparently the new texture we create has a layer_count of 4, while the old one we're replacing has a layer_count of 16 (in at least the one instance I'm debugging).

I'll continue investigation tomorrow but if anybody has thoughts offhand why this might be feel free to drop a comment here. Note that the emulator's GLES implementation is not the greatest so it might be returning us some garbage at some point, causing this failure as a result.

That's weird. layer_count is application-managed and shouldn't be dependent on the driver.

That code path is only supposed to fire in the case where we're growing the texture cache. The texture cache only shrinks when we invoke clear and drop it entirely. So seems like maybe the commands are occurring out of order somehow, maybe related to document splitting? Bug 1538540 also just came across my desk, which seems potentially related.

It's coming from here - the picture_texture.slices gets truncated to length 4, which gets turned into the layer_count in the reallocation request. So this is basically intentionally requesting a realloc with a smaller layer count, presumably to free stuff?

I don't know this code well enough to know what the right fix here is. Dzmitry, any suggestions?

Flags: needinfo?(dmalyshau)

I think we should invalidate all the picture caches and not do any blitting in case the clear_picture stuff happens. Stealing the bug.

Assignee: kats → dmalyshau
Status: NEW → ASSIGNED
Flags: needinfo?(dmalyshau)

(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #2)

It's coming from here - the picture_texture.slices gets truncated to length 4, which gets turned into the layer_count in the reallocation request. So this is basically intentionally requesting a realloc with a smaller layer count, presumably to free stuff?

The semantics of the TextureCacheAllocation commands are that you can't realloc something smaller - you need to first free then allocate.

Introduce a new texture allocation operation "reset", which acts like a "realloc" but without the contents preserved.
Use it for the picture texture cache.

Attachment #9061956 - Attachment description: WR reset texture allocaiton → WR reset texture allocation
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: