From 4b765c3ef9921c72e79c0b84f67761cf4b822015 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 11 Dec 2024 07:13:20 +0100 Subject: [PATCH] build: assume d3d11_4.h is always available It was added in mingw-w64 6 [1] which is the minimum version we support. [1] https://github.com/mingw-w64/mingw-w64/commit/aa6ab47929a9cac6897f38e630ce0bb88458e288 --- config.h.meson | 3 --- configure.ac | 2 +- meson.build | 1 - modules/video_output/win32/d3d11_quad.cpp | 2 -- modules/video_output/win32/d3d11_quad.h | 6 +----- modules/video_output/win32/direct3d11.cpp | 8 -------- 6 files changed, 2 insertions(+), 20 deletions(-) diff --git a/config.h.meson b/config.h.meson index 96d904f769..bfe2abbab2 100644 --- a/config.h.meson +++ b/config.h.meson @@ -107,9 +107,6 @@ /* Define if the compiler supports typeof. */ #mesondefine HAVE_CXX_TYPEOF -/* Define to 1 if you have the header file. */ -#mesondefine HAVE_D3D11_4_H - /* Define to 1 if you have the header file. */ #mesondefine HAVE_DCOMP_H diff --git a/configure.ac b/configure.ac index 0c52cb4d02..c732e7097e 100644 --- a/configure.ac +++ b/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 diff --git a/meson.build b/meson.build index 7f6135f187..0c8e88a9b3 100644 --- a/meson.build +++ b/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 ', '#include '], 'args' : [contrib_inc_args] }], diff --git a/modules/video_output/win32/d3d11_quad.cpp b/modules/video_output/win32/d3d11_quad.cpp index 92c5f00993..bb4e32e565 100644 --- a/modules/video_output/win32/d3d11_quad.cpp +++ b/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 diff --git a/modules/video_output/win32/d3d11_quad.h b/modules/video_output/win32/d3d11_quad.h index e28a4d3bcd..112071501a 100644 --- a/modules/video_output/win32/d3d11_quad.h +++ b/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 -#endif +#include #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 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 *, diff --git a/modules/video_output/win32/direct3d11.cpp b/modules/video_output/win32/direct3d11.cpp index 5bcbe49867..9e08005ccf 100644 --- a/modules/video_output/win32/direct3d11.cpp +++ b/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(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 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"); }