-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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] Software Renderer Protection and 10 bit Output #23221
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CrystalP
added
Type: Fix
non-breaking change which fixes an issue
Type: Improvement
non-breaking change which improves existing functionality
Component: Video rendering
Platform: Windows
v21 Omega
Platform: WindowsStore
labels
May 1, 2023
Good findings! 👍 The truth is that I knew the wrong pixel format in render SW + 10 bit but I had completely forgotten. |
thexai
reviewed
May 1, 2023
…tware renderer Main thread and VP Video thread use the non-thread safe D3D immediate context simultaneously
Changes applied. |
thexai
approved these changes
May 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component: Video rendering
Platform: Windows
Platform: WindowsStore
Type: Fix
non-breaking change which fixes an issue
Type: Improvement
non-breaking change which improves existing functionality
v21 Omega
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Turn on D3D11 multithreading protection for dxva2 decoding + software renderer path because the main thread and the video player video thread sometimes use the non-thread safe D3D immediate context simultaneously
Make swscale use the output format AV_PIX_FMT_X2BGR10 when Kodi is using a 10 bit swap chain (HDR screen&media and SDR media with "Use 10 bit for SDR" setting.
Motivation and context
The D3D debug layer triggers exceptions when using dxva2 decoding with software renderer. Can take a while, or very quickly when some breakpoints are set that significantly slow down the program and alter the usual timing.
Wrong colors on 10 bit output of software renderer.
How has this been tested?
Windows 10 x64, debug and release mode, UWP on Windows 10 as well.
Software renderer with DXVA2 decoding on and off. HDR and SDR material with HDR and SDR 10 or 8 bit output.
There are pre-existing unrelated issues with dxva2 decode + software renderer: on UWP decoded frames are presented in wrong order (improves when OSD is displayed), for x64 there are partially updated frames when playing 4k or when the OSD is displayed,
What is the effect on users?
Software renderer displays correctly HDR and works in SDR 10 bit mode.
Avoids some corruption when using dxva2 with software renderer. I didn't witness it but it would be more likely to happen on slow computers or more intensive loads (4k).
Screenshots (if appropriate):
Exception for simultaneous usage of immediate context from 2 threads:
Corrupted 10 bit output:
Fixed output:
Types of change
Checklist: