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

Conversation

@chinmaygarde
Copy link
Member

Towards implementing the FragmentProgram API in Impeller.

Specifies an Impeller specific format for data the renderer can use to create
pipelines with user supplied shader stages at runtime.

The data is in the form of a flatbuffer with a known schema.

This patch implements the wire format, creating and loading the program
payloads, and creating pipeline state objects using these payloads.

If the user supplied SPIRV intended for the older API, the loader will reject
this invalid payload. This is probably not going to be too much of an issue
because the FragmentProgram API will probably be modified to only allow buffers
loaded from asset managers. But still, in the meantime, I am using the old API
to pass these new buffers.

Fixes flutter/flutter#104750
Fixes flutter/flutter#105542
Towards resolving flutter/flutter#102853

@chinmaygarde
Copy link
Member Author

The new ImpellerC flags may change but this portion of the work is good for review.

Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

lgtm


namespace impeller {

static std::atomic_int32_t sValidationLogsDisabledCount = 0;
Copy link
Member

Choose a reason for hiding this comment

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

C++ question: Is this because ValidationLog is a struct and so if this were a static member of ValidationLog it would be public?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. But I don't see why that would be a problem either.

Copy link
Member

Choose a reason for hiding this comment

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

If it were public, it would be exposing internal state in a non-OOP-y way.

include_dirs = [ "$root_gen_dir/flutter" ]
}

flatbuffers("runtime_stage_flatbuffers") {
Copy link
Member

Choose a reason for hiding this comment

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

FYI @chingjun

@chinmaygarde
Copy link
Member Author

This is waiting on me patching the licenses for Flatbuffers and updating the buildroot dep.

…at runtime.

Towards implementing the FragmentProgram API in Impeller.

Specifies an Impeller specific format for data the renderer can use to create
pipelines with user supplied shader stages at runtime.

The data is in the form of a flatbuffer with a known schema.

This patch implements the wire format, creating and loading the program
payloads, and creating pipeline state objects using these payloads.

If the user supplied SPIRV intended for the older API, the loader will reject
this invalid payload. This is probably not going to be too much of an issue
because the FragmentProgram API will probably be modified to only allow buffers
loaded from asset managers. But still, in the meantime, I am using the old API
to pass these new buffers.

Fixes flutter/flutter#104750
Fixes flutter/flutter#105542
Towards resolving flutter/flutter#102853
@chinmaygarde chinmaygarde added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jun 14, 2022
@chinmaygarde chinmaygarde merged commit b43cf27 into flutter:main Jun 14, 2022
@chinmaygarde chinmaygarde deleted the fragment_program branch June 14, 2022 01:33
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 14, 2022
houhuayong pushed a commit to houhuayong/engine that referenced this pull request Jun 21, 2022
…at runtime. (flutter#33882)

Towards implementing the FragmentProgram API in Impeller.

Specifies an Impeller specific format for data the renderer can use to create
pipelines with user supplied shader stages at runtime.

The data is in the form of a flatbuffer with a known schema.

This patch implements the wire format, creating and loading the program
payloads, and creating pipeline state objects using these payloads.

If the user supplied SPIRV intended for the older API, the loader will reject
this invalid payload. This is probably not going to be too much of an issue
because the FragmentProgram API will probably be modified to only allow buffers
loaded from asset managers. But still, in the meantime, I am using the old API
to pass these new buffers.

Fixes flutter/flutter#104750
Fixes flutter/flutter#105542
Towards resolving flutter/flutter#102853
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

affects: engine e: impeller waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

No open projects
Archived in project

2 participants