-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Add Direct3D texture interoperability support #26840
Conversation
21614f6
to
25df751
Compare
25df751
to
6beede1
Compare
955eced
to
96e5d8c
Compare
cc @cbracken @clarkezone. The approach looks fine to me. But the presubmit failures are real though (compilation failures). Can you please address those in the meantime? |
done. |
I'll take a look over the weekend |
Took a quick look, looks good based on that. |
cc @clarkezone Care to approve the patch 😄 |
@jnschulze do you have a test app I can run against your branch? |
@clarkezone |
@clarkezone Do you have the cycles to look over the sample? |
Appols.. I have not had a chance to look and I'm heading out on a vacation for a week. I have cycles on 7/26 that I could carve out to look but appreciate that is a ways out there. |
@jnschulze, I tried the gpu-surface-texture webview branch, and I have a question. The fallback texture bridge seems to work fine, but when enabling the gpu surface ( |
@knopp |
@jnschulze Any updates? |
@chinmaygarde |
I'm going to add the WIP tag in the meantime. |
632ea3a
to
409e92d
Compare
What DPI / scaling factor are you running at? |
…sktopGpuSurfaceTypeDxgi to kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle
0251d1e
to
0255691
Compare
978b121
to
d239ea7
Compare
I've just pushed an update. Changes since the previous commit
|
d239ea7
to
06a429a
Compare
e5d1e9d
to
bece2d2
Compare
Because Flutter effectively uses DirectX on Windows. The fact that it uses ANGLE for translating OpenGL to D3D on Windows is an implementation detail which might change in the future. |
True but so is the use of DirectX on Windows which is itself an implementation detail of ANGLE on Windows. My comment was more on the fact that you have (as it seems from the PR) to go through ANGLE anyway for the interop, so OpenGLES seemed like an easier target. But given you used this to embed native views (like webviews) that makes sense you used D3D. |
Greetings! I need a little help with this. So, I'm trying to render stuff using open-gl APIs with this texture API in Flutter. By using ANGLE & using shared I just stitched together various code I could find related to ANGLE, Direct3D or this new Direct3D texture API in Flutter. There's no boilerplate, everything is written very procedurally to have a minimal running example. I've configured everything in the repository & a single Thankyou. Repository: https://github.com/alexmercerind/flutter_windows_angle_d3d_texture Please copy these DLLs near your .exe before running Used References https://github.com/Microsoft/angle/wiki/Interop-with-other-DirectX-code |
I updated repository with fix & minor intro: https://github.com/alexmercerind/flutter-windows-ANGLE-OpenGL-Direct3D-Interop. Hope this serves as a good example to a new-comer. UPDATE: My happiness is immeasurable. |
This PR adds support for Direct3D texture interop using ANGLE's
ANGLE_d3d_share_handle_client_buffer
extension (see https://www.khronos.org/registry/EGL/extensions/ANGLE/EGL_ANGLE_d3d_share_handle_client_buffer.txt)It adds a new texture variant,
flutter::GpuSurfaceTexture
, as an addition to the existingflutter::PixelBufferTexture
.See https://github.com/Microsoft/angle/wiki/Interop-with-other-DirectX-code for an example of how to create compatible Direct3D textures.
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.