Skip to content

Adds impeller directx proposal - #52

Open
gaaclarke wants to merge 6 commits into
flutter:mainfrom
gaaclarke:directx
Open

gaaclarke wants to merge 6 commits into
flutter:mainfrom
gaaclarke:directx

Conversation

@gaaclarke

Copy link
Copy Markdown
Member

On Impeller for Windows we use ANGLE as a compatibility layer to render content with our existing OpenGLES backend we wrote for Android. ANGLE is funded by the Chromium team and prioritizes the requirements for Chromium, which are not in alignment with the needs of Flutter. This is a proposal to remove ANGLE as a dependency for Impeller Windows and instead implement a DirectX 11 backend for Impeller instead.
Tracking issue: flutter/flutter#197901

Pre-launch Checklist

  • I read RFC 000.0001: Taxonomy and followed the file and path naming and metadata standards.
  • I read RFC 000.0002: Process and confirmed this proposal meets the threshold for a full RFC.
  • I read and agree to the Code of Conduct.
  • I signed the CLA.
  • I have linked an issue from flutter/flutter with the label design doc.
  • All existing and new tests are passing.
  • I have enabled "Allow edits from maintainers" on this PR so the bot can automatically assign an RFC number (or I will run dart run bin/assign_rfc_number.dart locally when instructed).

If you need help, consider asking for advice on the #hackers channel on Discord.


Given the early success of the AI prototype for D3D11 I'm confident that if the calculus changes in a couple of years, we'll be able to pivot to D3D12. A lot of the work done for D3D11 will not be wasted if we move to D3D12, things like impellerc integration and test harnesses will be reused.

In that situation it is possible that we graduate Vulkan to the defacto renderer on Windows too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Windows accepts DXGI and D3D11 external textures (here). I suspect supporting this with a D3D11 backend is easy but might be harder with a D3D12 backend.

@gaaclarke
gaaclarke marked this pull request as ready for review December 5, 2026 00:28

@bdero bdero left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I fully support this.

Our current GL->ANGLE->D3D11 path makes Windows the single hardest platform to support for Flutter GPU/Flutter Scene apps: Slow runtime shader compilation that can't be made AOT, process crashes when a shader function returns early from inside a loop (ANGLE's translation of that pattern crashes FXC), and memory overhead like ETC2 textures being decompressed to RGBA8.

I wrote a "feature complete" D3D12 backend prototype in October (now pushed to flutter/flutter#197844) with the shell surface, external textures, embedder API, runtime effects, and Flutter GPU wired up. It passed the golden and unit test suites locally at the time.

Feel free to point your agents at it to extract anything useful for the D3D11 backend once you get to snaking it through all the subsystems.


### Implement a D3D12 backend

Given our stated goal of reducing Engine developer maintenance cost I'm advocating for D3D11 over D3D12. D3D12 doesn't offer any features that we need to implement an Impeller backend. Things that exist in D3D12 but not on D3D11 are things like ray-tracing. I expect less D3D11 driver issues and considering the cost to implement and maintain Vulkan, I'm wary of having to give that sort of investment again.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One major benefit of going with D3D11 as the initial ANGLE replacement on Windows (regardless of whether we eventually support D3D12) is that D3D11 is hardware accelerated in the common ways of running Windows on a Mac (Parallels / VMware Fusion / recently, UTM). Parallels in particular caps at DirectX 11.1 on Apple silicon.

Moving straight to D3D12 without a D3D11 path would push those setups onto WARP, which would likely create substantial friction for the many Flutter devs building/testing Windows apps from Mac. @knopp initially raised this when I floated D3D12 with him at Flutter & Friends.


## Rollout

The D3D11 backend will be developed behind a build flag and it will exist there until the point at which ANGLE can be removed. It will be a wholesale switch with no fallback to ANGLE once all the tests are passing and the devicelab benchmarks are complementary.

@loic-sharma loic-sharma Dec 5, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why the wholesale switch? Wouldn't it be better to have a runtime flag that lets us switch which backend is used, and when we're ready, we switch the flag's default? A runtime flag would be less risky if there are regressions - users can opt-out of the D3D11 backend if needed.

@loic-sharma loic-sharma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, modulo one nit on the rollout to further reduce risk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants