From 037dd63d832594bb100583b7f490e442a7de27fa Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 18 Nov 2022 12:43:30 +0000 Subject: [PATCH] Fail D3D12 amd shader extensions test if UAV bind slot isn't supported * UE5 checks for this feature so we'll also check for it. --- .../demos/d3d12/d3d12_amd_shader_extensions.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/util/test/demos/d3d12/d3d12_amd_shader_extensions.cpp b/util/test/demos/d3d12/d3d12_amd_shader_extensions.cpp index 53f19ea16..ab6b36882 100644 --- a/util/test/demos/d3d12/d3d12_amd_shader_extensions.cpp +++ b/util/test/demos/d3d12/d3d12_amd_shader_extensions.cpp @@ -178,7 +178,7 @@ void main(uint3 threadID : SV_DispatchThreadID) } ID3D12Device *ags_devHandle = NULL; - CreateExtendedDevice(&ags_devHandle); + CreateExtendedDevice(&ags_devHandle, NULL); // once we've checked that we can create an extension device on an adapter, we can release it // and return ready to run @@ -193,7 +193,8 @@ void main(uint3 threadID : SV_DispatchThreadID) Avail = "AGS couldn't create device on any selected adapter."; } - void CreateExtendedDevice(ID3D12Device * *ags_devHandle) + void CreateExtendedDevice(ID3D12Device * *ags_devHandle, + AGSDX12ReturnedParams::ExtensionsSupported * exts) { std::vector adapters = GetAdapters(); @@ -224,6 +225,8 @@ void main(uint3 threadID : SV_DispatchThreadID) else { *ags_devHandle = ret.pDevice; + if(exts) + *exts = ret.extensionsSupported; return; } } @@ -279,10 +282,18 @@ void main(uint3 threadID : SV_DispatchThreadID) // we don't use these directly, just copy them into the real device so we know that ags is the // one to destroy the last reference to the device ID3D12Device *ags_devHandle = NULL; - CreateExtendedDevice(&ags_devHandle); + AGSDX12ReturnedParams::ExtensionsSupported features = {}; + CreateExtendedDevice(&ags_devHandle, &features); dev = ags_devHandle; + if(!features.UAVBindSlot || !features.intrinsics16 || !features.intrinsics19) + { + dev = NULL; + TEST_ERROR("Couldn't create AMD device with required features"); + return 4; + } + // recreate things we need on the new device PostDeviceCreate();