-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Impeller] make sure to render TiledTextureContents if the geometry doesn't fit in the texture's bounds. #51393
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand this, could you explain it a bit more? I know for the regular texture contents we have some src/dst checking.
Since tiled texture contents is an arbitrary geometry, we have the axis aligned rect check first. What is the additional check doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the geometry is not contained in the texture that means we have to render texcoords outside of 0..1, so we can't take the fast pass of avoiding rendering. We need the clamping, decal, etc.
If you check out the issue this is where we could hack this conditional to give us the correct result by sending in
Scale(1.001, 1.001, 1)
instead ofIdentity()
for the effect transform because the fast pass conditional was incorrectly ignoring the geometry and the full render was correct.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But isn't that expressed in the coverage and the scaling below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Demonstrably, no. If you run the golden test without this patch it will render with the incorrect texture coords, instead stretching them to fill the whole geometry. That flow through the code lacks the math the express the effect transform correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think since the effect transform was identity it was assumed it could be ignored, but it's not the case when the geometry is expanded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I agree its not working! But, this code should be able to render a stretched rectangle right? It seems like there is a bug in the math there that we could fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I played around with it again and I don't think so. The
Snapshot
flow lacks the expressivity to represent rendering texcoords outside of 0..1. It's not a bug, but a limit of the abstraction. That's why it only works when rendering a subset inside of the texture.If you set the scale to 1.0 you can see it renders at the correct size without the halo we need and there is no lever to pull to make it appear.
We can file an issue to redesign
Snapshot
it will probably require having a matrix for the uvs and the vertices?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack. The snapshot has a transform, but it assumes a srcRect. We could add support for that, but it isn't necessary here.