diff --git a/meson.build b/meson.build index 0a3bc42a3a1..4702057d35f 100644 --- a/meson.build +++ b/meson.build @@ -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() diff --git a/src/gallium/drivers/d3d12/d3d12_video_types.h b/src/gallium/drivers/d3d12/d3d12_video_types.h index b7ab7572c9c..9b12f7a718c 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_types.h +++ b/src/gallium/drivers/d3d12/d3d12_video_types.h @@ -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