-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Make interleaved layout (more) explicit in generated headers. #42628
[Impeller] Make interleaved layout (more) explicit in generated headers. #42628
Conversation
| const std::vector<ShaderStageIOSlot>& p_inputs) { | ||
| // Attrib locations have to be iterated over in order of location because we | ||
| // will be calculating offsets later. | ||
| auto inputs = p_inputs; |
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.
don't need to sort, offsets must already be computed
| MTLVertexDescriptor* GetMTLVertexDescriptor() const; | ||
|
|
||
| private: | ||
| struct StageInput { |
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.
don't need to sort, offsets must already be computed
| return false; | ||
| } | ||
|
|
||
| vertex_descriptor->SetStageInputs(VertexShader::kAllShaderStageInputs, |
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.
There methods were unconditionally returning true so I've removed the fake validation. To do actual validation we need the backends
| // |Comparable<VertexDescriptor>| | ||
| bool VertexDescriptor::IsEqual(const VertexDescriptor& other) const { | ||
| return inputs_ == other.inputs_; | ||
| return inputs_ == other.inputs_ && layouts_ == other.layouts_; |
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.
This doesn't actually seem like the right comparison but unsure if its actually used.
| {{stage_input.type.vec_size}}u, // vec size | ||
| {{stage_input.type.columns}}u // number of columns | ||
| {{stage_input.type.columns}}u, // number of columns | ||
| {{stage_input.offset}}u, // offset for interleaved layout |
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.
Essentially the addtions here are:
- ShaderStageIO must have an offset
- A secondary array that has binding+stride info
We may need more info but this is good enough for now. TBD weirdness about stride in GLES
|
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. |
|
I appear to have broken some things 🥲 |
|
actually just text thankfully |
Fixes flutter/flutter#128283 Why doesn't this happen elsewhere? might depend on how spirv compiles shaders or the order they run in. Long term fix is #42628 which computes all offset data in the compiler 
| for (size_t i = 0; i < count; i++) { | ||
| inputs_.emplace_back(*stage_inputs[i]); | ||
| } | ||
| // TODO(jonahwilliams): vulkan shader stage needed sorting too. Remove once |
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.
Remove, offsets are already computed so no sorting needs to happen.
| const auto type = compiler_->get_type(resource.type_id); | ||
| auto location = compiler_->get_decoration( | ||
| resource.id, spv::Decoration::DecorationLocation); | ||
| // Malformed shader, will be caught later on. |
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.
Why not have some kind of VALIDATION_LOG here?
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.
So this happens with invalid inputs, there is already a validation log that fires and exit that happens, so we'd either need to perform all of that work twice (since this code only runs on vertex shaders), or we do what I did here and let the later stage catch it.
flutter/engine@9934c0d...48e0b4e 2023-06-15 skia-flutter-autoroll@skia.org Roll Skia from 0b66c6928dcf to 2d531d020c26 (3 revisions) (flutter/engine#42883) 2023-06-15 matej.knopp@gmail.com Raster cache should preserve RTree for overlay layers (flutter/engine#42552) 2023-06-15 skia-flutter-autoroll@skia.org Roll Skia from c0c74b433117 to 0b66c6928dcf (1 revision) (flutter/engine#42879) 2023-06-15 leroux_bruno@yahoo.fr [Linux] Allow BasicMessageChannel sending and responding to null message (flutter/engine#42808) 2023-06-15 skia-flutter-autoroll@skia.org Roll Skia from 12375fb6f3c8 to c0c74b433117 (1 revision) (flutter/engine#42876) 2023-06-15 skia-flutter-autoroll@skia.org Roll Skia from d62221bd33a6 to 12375fb6f3c8 (1 revision) (flutter/engine#42873) 2023-06-15 skia-flutter-autoroll@skia.org Roll Skia from e2e0256d4c6a to d62221bd33a6 (1 revision) (flutter/engine#42871) 2023-06-15 skia-flutter-autoroll@skia.org Roll Skia from c3abd540c7f9 to e2e0256d4c6a (1 revision) (flutter/engine#42869) 2023-06-15 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from uvmDF7KM34dWGdsuK... to 53EjCyuRu91oFTBf2... (flutter/engine#42868) 2023-06-15 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from h3-8RUVrC889UXou7... to P7QA6bfO_Ij5dre7B... (flutter/engine#42867) 2023-06-15 skia-flutter-autoroll@skia.org Roll Skia from 2718866006d2 to c3abd540c7f9 (1 revision) (flutter/engine#42866) 2023-06-15 skia-flutter-autoroll@skia.org Roll Skia from 19051bc5fc90 to 2718866006d2 (33 revisions) (flutter/engine#42864) 2023-06-15 skia-flutter-autoroll@skia.org Roll Dart SDK from 922c315b2c34 to 8eaed3382237 (1 revision) (flutter/engine#42862) 2023-06-15 godofredoc@google.com Add missing artifact to the android_arm64_profile config. (flutter/engine#42858) 2023-06-14 hterkelsen@users.noreply.github.com Build skia with expat (flutter/engine#42859) 2023-06-14 ychris@google.com [ios] use interfaceOrientation orientation on iOS 13 and above (flutter/engine#42846) 2023-06-14 skia-flutter-autoroll@skia.org Manual roll Dart SDK from f1387834bfd9 to 922c315b2c34 (4 revisions) (flutter/engine#42855) 2023-06-14 jonahwilliams@google.com [Impeller] Make interleaved layout (more) explicit in generated headers. (flutter/engine#42628) 2023-06-14 30870216+gaaclarke@users.noreply.github.com Renamed validation layers build (flutter/engine#42826) 2023-06-14 ychris@google.com [ios] view controller based status bar (flutter/engine#42643) 2023-06-14 skia-flutter-autoroll@skia.org Roll Skia from 6d5dc31d88e2 to 19051bc5fc90 (25 revisions) (flutter/engine#42828) 2023-06-14 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from Xi3c5nti2LKnEOqYt... to uvmDF7KM34dWGdsuK... (flutter/engine#42842) 2023-06-14 43091780+utzcoz@users.noreply.github.com Fix generateLockfiles running directory for documentation (flutter/engine#42734) 2023-06-14 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from Cld7-rm6ZmCOO8j-K... to h3-8RUVrC889UXou7... (flutter/engine#42839) 2023-06-14 skia-flutter-autoroll@skia.org Roll ANGLE from 7e075469ff02 to 3a3a3c655a96 (8 revisions) (flutter/engine#42834) 2023-06-14 skia-flutter-autoroll@skia.org Roll Dart SDK from c4e9794df8af to f1387834bfd9 (1 revision) (flutter/engine#42833) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from Xi3c5nti2LKn to 53EjCyuRu91o fuchsia/sdk/core/mac-amd64 from Cld7-rm6ZmCO to P7QA6bfO_Ij5 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 chinmaygarde@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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Working on #42415 , I found that it was difficult to customize the buffer layout as the interleaved layout is implicitly confiured in the backends. Rather than bake another built in layout, I've pulled (most) information about buffer layout into the generated headers so it is explicitly confiured, which should allow easier customization as the backend has fewer choices to make.
TBD whether or not we need to do something weird for GLES since stride has a different meaning there...
Work towards flutter/flutter#116168