Skip to content

Conversation

cgutman
Copy link
Collaborator

@cgutman cgutman commented Jan 12, 2023

Description

This PR introduces Intel QuickSync support for Windows. We initially create a D3D11VA hwdevice then use that to derive a QSV context which wraps the underlying D3D11 texture pool. We map the QSV surfaces back to D3D11 textures to draw into them (handled in #736).

The QSV encoder was a little more finicky than AMF and NVENC, so more quirk flags were required to get it to behave (respecting the max frame size, but without lowering the RC buffer too much which caused the HEVC encoder to fail completely on large frames).

This does not address hybrid graphics (Optimus) scenarios. I will put up a second PR for that.

Screenshot

image
image

Issues Fixed or Closed

Resolves #698
Resolves #438

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@@ -617,6 +696,7 @@ static std::vector<encoder_t> encoders {
nvenc,
#endif
#ifdef _WIN32
quicksync,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this go below the amd encoder? Otherwise I assume we would encode with quicksync if someone had an Intel igpu + amd gpu

Copy link
Collaborator Author

@cgutman cgutman Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it actually matters today, since the Desktop Duplication API only supports instantiation on GPUs where the display is physically connected. DuplicateOutput1() would fail when called on the dGPU, since the display is connected to the iGPU and it would end up selecting QuickSync anyway (once I get the Optimus PR done, right now it just totally fails in that scenario).

In the future, we could add support for cross-adapter encoding, but that entails 4 copies per frame (iGPU texture -> iGPU staging texture -> dGPU staging texture -> dGPU texture) so might not have good performance anyway.

@ReenigneArcher ReenigneArcher merged commit 4fc444b into LizardByte:nightly Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants