MicrosoftEdge / MicrosoftEdge/WebView2Feedback
Support formats other than NV12 for Texture Streaming
@KomalPrasadMSPM is already working on this.
Since Mar 5, 2025.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
Currently the ICoreWebView2ExperimentalTextureStream interface only supports NV12 texture streams which are great for video capture devices which use this format natively but is a pain for anything else. With NV12 the bit depth and colour resolution are extremely limited which is problematic when viewing sharp features from technical rendering engines. It also results in an unnecessary colour space conversion from RGBA to YUV. For our use case we want to be able to stream rendered frames from an external rendering engine into WebView2.
Describe the solution you'd like and alternatives you've considered
Ideally we would be able to choose whichever DXGI format we wanted when calling ICoreWebView2ExperimentalTextureStream::CreateTexture and GetAvailableTexture; these would function as they currently do but would provide a texture in the desired format. The new function signatures could look like:
// Create a new texture for streaming with the specified format
public HRESULT CreateTexture(UINT32 widthInTexels, UINT32 heightInTexels, DXGI_FORMAT format, ICoreWebView2ExperimentalTexture ** texture);
// Get an available texture for streaming with the specified format (returning HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS) if no textures are available in the specified format)
public HRESULT GetAvailableTexture(DXGI_FORMAT format, ICoreWebView2ExperimentalTexture ** texture);
// Get an available texture for streaming in any format (the caller is responsible for checking the format of the returned texture using d3dTexture->GetDesc())
public HRESULT GetAvailableTexture(ICoreWebView2ExperimentalTexture ** texture);
If supporting all DXGI formats is unfeasible or if the dependency on dxgiformat.h needs to be avoided, a subset of the DXGI_FORMAT enum could be implemented in WebView2Experimental.h, ideally with a direct correspondance to the DXGI_FORMAT enum.
For our use case the DXGI_FORMAT_R8G8B8A8_UNORM (or an equivalent BGRA format) is what we need.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.