Browse Source

build: assume d3d11_4.h is always available

It was added in mingw-w64 6 [1] which is the minimum version we support.

[1] aa6ab47929
pull/176/head
Steve Lhomme 1 year ago
parent
commit
4b765c3ef9
  1. 3
      config.h.meson
  2. 2
      configure.ac
  3. 1
      meson.build
  4. 2
      modules/video_output/win32/d3d11_quad.cpp
  5. 6
      modules/video_output/win32/d3d11_quad.h
  6. 8
      modules/video_output/win32/direct3d11.cpp

3
config.h.meson

@ -107,9 +107,6 @@
/* Define if the compiler supports typeof. */
#mesondefine HAVE_CXX_TYPEOF
/* Define to 1 if you have the <d3d11_4.h> header file. */
#mesondefine HAVE_D3D11_4_H
/* Define to 1 if you have the <dcomp.h> header file. */
#mesondefine HAVE_DCOMP_H

2
configure.ac

@ -2761,7 +2761,7 @@ AM_CONDITIONAL([HAVE_AVCODEC_D3D11VA], [test "${have_avcodec_d3d11va}" = "yes"])
dnl
dnl DXGI debug
dnl
AC_CHECK_HEADERS([dxgidebug.h d3d11_4.h])
AC_CHECK_HEADERS([dxgidebug.h])
dnl
dnl IStorageFolder

1
meson.build

@ -268,7 +268,6 @@ check_c_headers = [
['zlib.h', { 'args' : [contrib_inc_args] }],
['wordexp.h'],
['dxgidebug.h'],
['d3d11_4.h'],
['GL/wglew.h',
{ 'prefix' : ['#include <windows.h>', '#include <GL/glew.h>'],
'args' : [contrib_inc_args] }],

2
modules/video_output/win32/d3d11_quad.cpp

@ -376,7 +376,6 @@ void d3d11_quad_t::UpdateViewport(const vout_display_place_t *place, const d3d_f
}
}
#ifdef HAVE_D3D11_4_H
HRESULT D3D11_InitFence(d3d11_device_t & d3d_dev, d3d11_gpu_fence & fence)
{
HRESULT hr;
@ -430,4 +429,3 @@ int D3D11_WaitFence(d3d11_gpu_fence & fence)
}
return VLC_ENOTSUP;
}
#endif // HAVE_D3D11_4_H

6
modules/video_output/win32/d3d11_quad.h

@ -25,16 +25,13 @@
#include "../../video_chroma/d3d11_fmt.h"
#include "d3d11_shaders.h"
#ifdef HAVE_D3D11_4_H
# include <d3d11_4.h>
#endif
#include <d3d11_4.h>
#define PS_CONST_LUMI_BOUNDS 0
#define VS_CONST_VIEWPOINT 1
typedef bool (*d3d11_select_plane_t)(void *opaque, size_t plane_index, ID3D11RenderTargetView **);
#ifdef HAVE_D3D11_4_H
struct d3d11_gpu_fence
{
Microsoft::WRL::ComPtr<ID3D11Fence> d3dRenderFence;
@ -46,7 +43,6 @@ struct d3d11_gpu_fence
HRESULT D3D11_InitFence(d3d11_device_t &, d3d11_gpu_fence &);
int D3D11_WaitFence(d3d11_gpu_fence &);
void D3D11_ReleaseFence(d3d11_gpu_fence &);
#endif
void D3D11_RenderQuad(d3d11_device_t *, d3d11_quad_t *, d3d11_vertex_shader_t *,

8
modules/video_output/win32/direct3d11.cpp

@ -129,9 +129,7 @@ typedef struct vout_display_sys_t
d3d_shader_compiler_t *shaders = nullptr;
d3d11_quad_t picQuad = {};
#ifdef HAVE_D3D11_4_H
d3d11_gpu_fence fence = {};
#endif
bool use_staging_texture = false;
picture_sys_d3d11_t stagingSys = {};
@ -909,7 +907,6 @@ static void PreparePicture(vout_display_t *vd, picture_t *picture,
}
}
#ifdef HAVE_D3D11_4_H
if (sys->log_level >= 4)
{
vlc_tick_t render_start = vlc_tick_now();
@ -920,7 +917,6 @@ static void PreparePicture(vout_display_t *vd, picture_t *picture,
{
D3D11_WaitFence(sys->fence);
}
#endif
}
static void Prepare(vout_display_t *vd, picture_t *picture,
@ -1466,13 +1462,11 @@ static int Direct3D11CreateGenericResources(vout_display_t *vd)
vout_display_sys_t *sys = static_cast<vout_display_sys_t *>(vd->sys);
HRESULT hr;
#ifdef HAVE_D3D11_4_H
hr = D3D11_InitFence(*sys->d3d_dev, sys->fence);
if (SUCCEEDED(hr))
{
msg_Dbg(vd, "using GPU render fence");
}
#endif
ComPtr<ID3D11BlendState> pSpuBlendState;
D3D11_BLEND_DESC spuBlendDesc = { };
@ -1589,9 +1583,7 @@ static void Direct3D11DestroyResources(vout_display_t *vd)
D3D11_ReleaseVertexShader(&sys->flatVShader);
D3D11_ReleaseVertexShader(&sys->projectionVShader);
#ifdef HAVE_D3D11_4_H
D3D11_ReleaseFence(sys->fence);
#endif
msg_Dbg(vd, "Direct3D11 resources destroyed");
}

Loading…
Cancel
Save