[vlc-devel] [PATCH] direct3d9: prefer hardware vertex processing when possible
Jean-Baptiste Kempf
jb at videolan.org
Wed Oct 18 13:03:22 CEST 2017
For my curiosity, what's the difference?
On Wed, 18 Oct 2017, at 12:33, Steve Lhomme wrote:
> ---
> modules/video_output/win32/direct3d9.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/modules/video_output/win32/direct3d9.c
> b/modules/video_output/win32/direct3d9.c
> index 0798ba3ff9..0c5fec2799 100644
> --- a/modules/video_output/win32/direct3d9.c
> +++ b/modules/video_output/win32/direct3d9.c
> @@ -900,22 +900,30 @@ static int Direct3D9Open(vout_display_t *vd,
> video_format_t *fmt)
> d3dai.VendorId, d3dai.DeviceId, d3dai.Revision );
> }
>
> + DWORD creationFlags = D3DCREATE_MULTITHREADED;
> + if ( (sys->d3dcaps.DevCaps & D3DDEVCAPS_DRAWPRIMTLVERTEX) &&
> + (sys->d3dcaps.DevCaps & D3DDEVCAPS_HWRASTERIZATION) ) {
> + creationFlags |= D3DCREATE_HARDWARE_VERTEXPROCESSING;
> + } else if (sys->d3dcaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) {
> + creationFlags |= D3DCREATE_MIXED_VERTEXPROCESSING;
> + } else {
> + creationFlags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING;
> + }
> +
> // Create the D3DDevice
> HRESULT hr;
> if (sys->use_d3d9ex) {
> LPDIRECT3DDEVICE9EX d3ddevex;
> hr = IDirect3D9Ex_CreateDeviceEx((LPDIRECT3D9EX)d3dobj,
> AdapterToUse,
> DeviceType, sys->sys.hvideownd,
> -
> D3DCREATE_SOFTWARE_VERTEXPROCESSING|
> - D3DCREATE_MULTITHREADED,
> + creationFlags,
> &sys->d3dpp, NULL, &d3ddevex);
> sys->d3ddev = (LPDIRECT3DDEVICE9)d3ddevex;
> } else {
> LPDIRECT3DDEVICE9 d3ddev;
> hr = IDirect3D9_CreateDevice(d3dobj, AdapterToUse,
> DeviceType, sys->sys.hvideownd,
> -
> D3DCREATE_SOFTWARE_VERTEXPROCESSING|
> - D3DCREATE_MULTITHREADED,
> + creationFlags,
> &sys->d3dpp, &d3ddev);
> sys->d3ddev = d3ddev;
> }
> --
> 2.14.2
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
--
Jean-Baptiste Kempf - President
+33 672 704 734
More information about the vlc-devel
mailing list