Repository navigation
Conversation
|
|
||
| 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. |
There was a problem hiding this comment.
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.
bdero
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
LGTM, modulo one nit on the rollout to further reduce risk!
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
design doc.dart run bin/assign_rfc_number.dartlocally when instructed).If you need help, consider asking for advice on the #hackers channel on Discord.