Repository navigation
pvr/g5p: refuse a draw into a colour attachment that is not stored - #57
Merged
Merged
Conversation
A G5P pipeline writes its colour outputs to the render's end-of-tile
targets. A colour attachment with store op DONT_CARE (and no resolve)
is not one of them, so g5p_mrt_draw_check() can count one target on
both sides while the draw's output really goes through another
attachment's end-of-tile setup. With a 32-bit channel format (R32_*,
R32G32_*) the fragment job then never finishes and the device is lost.
That draw is reached once refused work is skipped: in the render-pass
input-attachment cases, the subpass that reads the attachment is
refused (image_deref_load), and its pass is no longer dropped as a
whole. With pvr_skip_refused_work on, every
renderpass1.*.formats.{r32,r32g32}_*.input.*.dont_care.draw case hung
the fragment job on an iPhone 6s.
Refuse the draw unless every colour attachment of the subpass is an
end-of-tile target, or resolves into one. Two cases stay allowed:
the driver's own vkCmdClearAttachments quads, which write a constant
and have not hung, and a render with no end-of-tile target at all,
whose outputs go nowhere (occlusion queries draw like that).
Generated-by: LLM
Signed-off-by: Jeroen Trappers <jeroen.trappers@gmail.com>
Contributor
|
Merged, thank you Jeroen! Turning that GPU hang into a clean refusal is exactly the kind of fix that makes the driver safer for everyone, and the CTS sample with and without the change (plus the r32 probe cases going from 6 lost devices to 0) made it easy to land with confidence.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A G5P pipeline writes its colour outputs to the render's end-of-tile targets. A colour attachment with store op DONT_CARE (and no resolve) is not one of them.
g5p_mrt_draw_check()compares only the counts, so a draw can pass with one target on each side while its output really goes through another attachment's end-of-tile setup. With a 32-bit channel format (R32_, R32G32_), the fragment job then never finishes, and the device is lost: no MMU fault, just the job timeout.How it's reached: with refused work skipped (
pvr_skip_refused_work, on by default in #48):image_deref_load);On an iPhone 6s (A9) with skipping on,
renderpass1.*.formats.{r32,r32g32}_{sint,uint,sfloat}.input.*.dont_care.drawhangs for all 6 formats. Other formats fail without hanging.The fix: refuse the draw unless every colour attachment of the subpass is an end-of-tile target, or resolves into one. Two cases stay allowed, each because an earlier version without the exception lost passes:
vkCmdClearAttachmentsquads, which write a constant (3*.dont_care.clearcases);occlusion_query.copy_results_size_32_stride_4_without_availability).Tested on an iPhone 6s (A9), 340 MHz, on 58db632; rebased onto current main without conflicts, retest there pending:
pvr_skip_refused_work=true: the 12 r32 / r32g32 probe cases go from 6 lost devices to 0. They now fail cleanly.Found while answering henrikklee's question on #48.