d3d12/meson: Add USE_D3D12_PREVIEW_HEADERS compiler flag based on dep_dxheaders.version()

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13126

Reviewed-by: Pohsiang Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35057>
This commit is contained in:
Sil Vilerino 2025-05-12 12:38:17 -04:00
parent 97f71420df
commit 33f670d869
2 changed files with 9 additions and 1 deletions

View file

@ -600,6 +600,14 @@ if with_gallium_d3d12 or with_microsoft_clc or with_microsoft_vk or with_gfxstre
endif
endif
if dep_dxheaders.found()
if (dep_dxheaders.version().version_compare('>= 1.700.0'))
pre_args += '-DUSE_D3D12_PREVIEW_HEADERS=1'
else
pre_args += '-DUSE_D3D12_PREVIEW_HEADERS=0'
endif
endif
_with_gallium_d3d12_video = get_option('gallium-d3d12-video')
with_gallium_d3d12_video = false
if with_gallium_d3d12 and not _with_gallium_d3d12_video.disabled()

View file

@ -42,7 +42,7 @@ using Microsoft::WRL::ComPtr;
#define D3D12_VIDEO_ANY_DECODER_ENABLED (VIDEO_CODEC_H264DEC || VIDEO_CODEC_H265DEC || VIDEO_CODEC_AV1DEC || VIDEO_CODEC_VP9DEC)
#define D3D12_VIDEO_USE_NEW_ENCODECMDLIST4_INTERFACE (D3D12_PREVIEW_SDK_VERSION >= 716)
#define D3D12_VIDEO_USE_NEW_ENCODECMDLIST4_INTERFACE (USE_D3D12_PREVIEW_HEADERS && (D3D12_PREVIEW_SDK_VERSION >= 716))
#if !defined(_WIN32) || defined(_MSC_VER)
inline D3D12_VIDEO_DECODER_HEAP_DESC