Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] Assign incremental clip depth to all entities. #49828

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

bdero
Copy link
Member

@bdero bdero commented Jan 17, 2024

  • Add depth settings to pipeline variant hash.
  • Assign new clip depth to all entities.
  • Punt the final depth to all the vertex shaders.
  • Add validations to assert all clip depths are resolved.

@bdero bdero self-assigned this Jan 17, 2024
@bdero bdero force-pushed the bdero/depth-settings branch from 146d0c6 to 59469d2 Compare January 17, 2024 10:35
@bdero bdero force-pushed the bdero/depth-settings branch from 59469d2 to a8d3369 Compare January 22, 2024 23:15
@bdero bdero force-pushed the bdero/depth-settings branch from a8d3369 to 7197858 Compare January 30, 2024 03:45
@bdero bdero changed the title [Impeller] Add depth settings to pipeline variant hash. [Impeller] Assign incremental clip depth to all entities. Jan 30, 2024
@bdero bdero force-pushed the bdero/depth-settings branch 3 times, most recently from 07473a6 to c7c73c9 Compare January 30, 2024 23:16
@bdero bdero marked this pull request as ready for review January 31, 2024 22:57
@bdero bdero requested a review from jonahwilliams January 31, 2024 22:57
@bdero
Copy link
Member Author

bdero commented Jan 31, 2024

This gets us as close to switching clips to the depth buffer as possible without actually doing it. I want to keep the diff to flip it on minimal so that we can easily revert it if there are problems.

@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #49828 at sha 3104b26

@bdero
Copy link
Member Author

bdero commented Feb 1, 2024

Got some weird stuff going on with the goldens again. Looking into it.

@bdero bdero removed the request for review from jonahwilliams February 1, 2024 00:06
@bdero
Copy link
Member Author

bdero commented Feb 1, 2024

nvm, accidentally changed the compare op, so this should be fixed.

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

For my understanding, this adjusts the depth but we're still clipping via stencil ops, right?

return new_clip_depth_;
}

static Scalar depth_epsilon = 1.0f / std::pow(2, 18);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constexpr? or at least const

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -30,6 +30,8 @@ bool EntityPlayground::OpenPlaygroundHere(EntityPass& entity_pass) {
return false;
}

entity_pass.PopAllClips(1000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment to explain why we need to do this in the Entity playground specifically.

@@ -154,12 +154,12 @@ struct TexImage2DData {
// only use the stencil component.
//
// https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
case PixelFormat::kD24UnormS8Uint:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, should we have been hitting this path before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we ever hit this path if offscreen MSAA is supported.

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #49828 at sha 68e0b12

@bdero
Copy link
Member Author

bdero commented Feb 1, 2024

For my understanding, this adjusts the depth but we're still clipping via stencil ops, right?

Yeah, it gets the correct depth values pumping into clip space but doesn't actually use them yet.

auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 1, 2024
…142726)

flutter/engine@68943af...8c43332

2024-02-01 zanderso@users.noreply.github.com Moves impeller/golden_tests_harvester to tools/golden_tests_harvester (flutter/engine#50211)
2024-02-01 skia-flutter-autoroll@skia.org Roll Skia from 2386d5077ec5 to cdf214adfb4d (2 revisions) (flutter/engine#50239)
2024-02-01 skia-flutter-autoroll@skia.org Roll Skia from 20578fecfc37 to 2386d5077ec5 (2 revisions) (flutter/engine#50238)
2024-02-01 skia-flutter-autoroll@skia.org Roll Skia from 756276a133b1 to 20578fecfc37 (1 revision) (flutter/engine#50236)
2024-02-01 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from nymRxHV9Shod7cyLe... to kvEXgoydRYnW3UvX2... (flutter/engine#50235)
2024-02-01 bdero@google.com [Impeller] Assign incremental clip depth to all entities. (flutter/engine#49828)
2024-02-01 skia-flutter-autoroll@skia.org Roll Skia from 505d22d0ecdc to 756276a133b1 (3 revisions) (flutter/engine#50232)
2024-02-01 skia-flutter-autoroll@skia.org Roll Skia from bcbc172f74da to 505d22d0ecdc (1 revision) (flutter/engine#50230)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from nymRxHV9Shod to kvEXgoydRYnW

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC matanl@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Feb 1, 2024
Depends on #49828.

No semantic change.

Also adds/documents stencil configurations that are needed for StC. Operations for the current stencil stack are labeled as "legacy".
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants