dotnet / dotnet/wpf

High GPU usage when using WindowChrome, MediaElement and InkCanvas on Intel Iris Xe

Open
#8,686 11 comments 1 reaction 0 assignees View on GitHub
Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

When I create a WPF full screen demo using WindowChrome 、MediaElement and InkCanvas,the GPU usage will surge to 60%.
![1](https://github.com/dotnet/wpf/assets/69450831/db1b2a48-cf7f-4895-a5b3-72eb29636b30)
![2](https://github.com/dotnet/wpf/assets/69450831/3f1a6b8c-80f5-4632-85b7-0d80a132349f)

I tested different computers. This problem occurs when the computer graphics card driver is Intel Iris Xe , but is normal on UHD.

And I listed the GPU usage under different configurations:
![3](https://github.com/dotnet/wpf/assets/69450831/cca7e968-3358-49c2-9282-131b7dc48aff)

I can't reproduce the same issue from the system native app, so I'm not sure if this is an Intel issue or a WPF issue.

And I tried to get window's touch events to draw Geometry, and the GPU usage was not as exaggerated as InkCanvas, about 30%~40%.

My demo is as follows:

```cs







```

```cs
private void LoadingElement_OnMediaEnded(object sender, RoutedEventArgs e)
{
((MediaElement)sender).Position = ((MediaElement)sender).Position.Add(TimeSpan.FromMilliseconds(1));
}
```

### Reproduction Steps

1. Prepare a computer with Intel Iris Xe graphics (I tried it on two computers and it can be reproduced on both computers.),version of the graphics card driver is 31.0.101.5084.
2. Create an empty WPF application, .net 6.0 or .net framework 4.7.2. I am using .net framework 472, and it is the same when using .net 6.0.
3. Add MediaElement and Inkcanvas in xaml, and set WindowChrome.
4. Run the application, write on Inkcanvs.
5. Observe GPU usage in task manager.

### Expected behavior

The GPU usage is normal.

### Actual behavior

The GPU usage is very high.

### Regression?

_No response_

### Known Workarounds

Set the WPF app to use software rendering.
```cs
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
```

### Impact

_No response_

### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.