Commit Graph

42 Commits

Author SHA1 Message Date
Cameron Gutman 0e50a9d457 Only enable D3D11/DXGI debug layer if Graphics Tools are installed
Closes #1857
2026-04-13 20:06:24 -05:00
Cameron Gutman 1e825c85e5 Optimize render to decode fence usage to reduce pipeline bubbles 2026-01-19 18:38:38 -06:00
Cameron Gutman adbd19e6fa Remove the previous frame rendered fence
- Waiting on this fence prior to rendering introduces pipeline bubbles which can impact rendering performance on low-end GPUs
- Pacer simply waiting to release the previous frame until after the current frame is rendered already means any decoder stall should be very short
2026-01-19 16:01:50 -06:00
Cameron Gutman a739c1cef8 Fix D3D11 fence sharing without monitored fence support 2026-01-19 14:53:23 -06:00
Cameron Gutman f6e08f8a43 Use separate render and decode D3D11Devices
See #1424
2026-01-19 14:25:08 -06:00
Cameron Gutman 788675ad59 Handle window size and display changes in D3D11Renderer 2026-01-10 17:48:28 -06:00
Cameron Gutman be9f465008 Remove manual hwframes creation in D3D11VARenderer
This way we aren't always allocating the worst-case possible number of frames
2026-01-10 16:36:35 -06:00
Cameron Gutman 92b68a40d1 Use a D3D11Fence to force sync between video and 3D engines when binding output textures 2026-01-10 14:52:27 -06:00
Cameron Gutman cda65ab58d Use a D3D11Fence to wait to start the next frame until the previous frame is finished 2026-01-07 19:04:15 -06:00
Cameron Gutman c3ce0918b3 Optimize blending in DXVA2 and D3D11VA renderers 2025-12-28 13:53:13 -06:00
Cameron Gutman d501a627f0 Test all renderers before use
Every renderer except SDL had opted-in for testing due to various
quirks discovered over the years, so just do away with this option
and test all renderers.
2025-12-22 23:58:26 -06:00
Cameron Gutman f0821d9543 Use D3D11_COPY_DISCARD when updating our video texture
This ensures the driver knows it doesn't have to synchronize with the previous texture data.
2025-11-24 18:49:19 -06:00
Cameron Gutman 7116efd8de Switch D3D11VA to the shared functions for CSC matrix generation and chroma co-siting 2025-11-05 22:26:27 -06:00
Cameron Gutman f67272b153 Handle chroma co-siting in the D3D11 shaders 2025-11-01 22:42:51 -05:00
Cameron Gutman 25132a1f7b Enable decoder texture binding for all FL11.1 iGPUs
Since those GPUs don't benefit from the fence hack, restrict that to Intel only.
2024-08-31 00:36:25 -05:00
Cameron Gutman 99311403fa Move dummy fence into renderVideo()
The workaround only seems to work with a new fence each time.
2024-08-30 22:42:53 -05:00
Cameron Gutman 8b50eea485 Wait on a dummy fence before using textures shared with the decoder 2024-08-30 22:22:30 -05:00
Cameron Gutman 9e811f54f1 Use ComPtr for lifetime management in D3D11VA 2024-07-30 22:29:38 -05:00
Cameron Gutman 0bb0d27d64 Implement YUV 4:4:4 decoding with D3D11VA on Intel GPUs 2024-07-30 21:12:11 -05:00
Cameron Gutman 335ed0e8e6 Only sample directly from the video decoder output texture on Intel GPUs
This technique seems to actually make performance worse on some AMD GPUs (RX 480)
and causes rendering errors on others (HD 5570). These might be AMD-specific bugs
but let's not risk a behavior change for AMD/NVIDIA where nobody was having perf
issues with the old copy method anyway.
2024-06-29 14:44:08 -05:00
Cameron Gutman c3bd7edc4e Revert "Use a separate texture for rendering to avoid blending in the alignment padding"
This kills performance on some Intel iGPUs (particularly Atom chips like N100),
so let's remove the copy and solve this issue a different way instead.

This reverts commit a6fccf93d1.
2024-06-22 12:35:00 -05:00
Cameron Gutman b6bb96223d Revert "Remove manual hwframe ctx setup for D3D11VA"
We need this back to avoid the copy that's tanking performance on Intel iGPUs.

This reverts commit 2cef09471b.
2024-06-22 12:34:10 -05:00
Cameron Gutman f2535f1e6e Avoid D3D9 fallback on lack of codec support unless a D3D11 FL11.0 GPU wasn't found
We'd rather not waste time (and risk crashes) loading the D3D9 driver if the GPU doesn't have the physical decoding hardware at all.
2024-03-26 23:59:18 -05:00
Cameron Gutman 114074bfd8 Don't set HDR metadata on the DXGI swapchain
This is no longer recommended by Microsoft due inconsistencies with display support for HDR metadata.
2023-12-31 15:15:06 -06:00
Cameron Gutman 2cef09471b Remove manual hwframe ctx setup for D3D11VA
It was apparently never necessary, since FFmpeg's default behavior of
avcodec_get_hw_frames_parameters() + av_hwframe_ctx_init() makes a
context that exactly matches the one we constructed manually.
2023-12-22 02:45:11 -06:00
Cameron Gutman a6fccf93d1 Use a separate texture for rendering to avoid blending in the alignment padding
Fixes #885
2022-10-26 21:48:55 -05:00
Cameron Gutman 9e4337babf Revert "Increase the number of decoder surfaces for DXVA2/D3D11VA"
This reverts commit 02c781b8f4.
2022-10-15 14:32:12 -05:00
Cameron Gutman 02c781b8f4 Increase the number of decoder surfaces for DXVA2/D3D11VA
We forgot to take into account frames buffered within Moonlight itself
2022-10-14 21:20:35 -05:00
Cameron Gutman 9e8a4cab7b Enable HEVC RFI for DXVA2 and D3D11VA 2022-10-04 22:56:21 -05:00
Cameron Gutman 99885f5b4b Centralize colorspace and color range handling 2022-09-24 12:28:23 -05:00
Cameron Gutman bf4332b9e7 Prefer D3D11VA in non-FSE modes for improved performance 2022-08-21 17:50:56 -05:00
Cameron Gutman 2480849f39 Clean up DXGI adapter enumeration code 2022-05-02 19:05:00 -05:00
Cameron Gutman f732b1978e Require a test frame with D3D11VA 2022-04-26 23:04:31 -05:00
Cameron Gutman d3a542bac4 Try all available GPUs in D3D11VA decoder 2022-04-26 22:49:46 -05:00
Cameron Gutman 747d3eedf1 Cleanup D3D11VA renderer by removing unnecessary codepaths
Waitable swapchains seem to be worse than our existing DXVsyncSource for synchronizing with VBlank.

Full-screen exclusive mode isn't beneficial vs Independent Flip on modern Win10/Win11 systems.
2022-04-15 23:26:32 -05:00
Cameron Gutman 6d3d51553b Wait on our D3D11 swapchain before rendering to reduce latency 2022-04-07 21:46:48 -05:00
Cameron Gutman 9a64c026ea Use optimized pixel shaders for the normal SDR and HDR colorspaces 2022-02-09 20:46:02 -06:00
Cameron Gutman 4dc07bf63f Don't render the alignment padding area 2022-02-05 15:23:29 -06:00
Cameron Gutman 04a0aca221 Create SRVs for all textures in the pool during initialization 2022-02-05 14:49:08 -06:00
Cameron Gutman 1942e72474 Only bind the constant buffer once 2022-02-05 14:15:35 -06:00
Cameron Gutman f256407789 Implement D3D11VA video rendering 2022-02-04 21:51:34 -06:00
Cameron Gutman 67612f607e WIP: D3D11VA support
Overlays work, but drawing the actual video is unimplemented
2022-02-03 19:45:07 -06:00