From 003e2d5063eed98d48a8a66d17b6c604a3401f49 Mon Sep 17 00:00:00 2001 From: Steven He Date: Tue, 7 May 2024 13:01:42 +0900 Subject: [PATCH] Fix incorrect DriverType --- samples/GpuInterop/VulkanDemo/D3DMemoryHelper.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/GpuInterop/VulkanDemo/D3DMemoryHelper.cs b/samples/GpuInterop/VulkanDemo/D3DMemoryHelper.cs index be396db6309..3e220b1ac91 100644 --- a/samples/GpuInterop/VulkanDemo/D3DMemoryHelper.cs +++ b/samples/GpuInterop/VulkanDemo/D3DMemoryHelper.cs @@ -8,7 +8,7 @@ namespace GpuInterop.VulkanDemo; public class D3DMemoryHelper { - public static ID3D11Device? CreateDeviceByLuid(Span luid) + public static ID3D11Device CreateDeviceByLuid(Span luid) { DXGI.CreateDXGIFactory1(out var factory).CheckError(); var longLuid = MemoryMarshal.Cast(luid)[0]; @@ -21,14 +21,14 @@ public class D3DMemoryHelper if (adapter.Description1.Luid != longLuid) continue; - D3D11.D3D11CreateDevice(adapter, DriverType.Hardware, DeviceCreationFlags.None, + D3D11.D3D11CreateDevice(adapter, DriverType.Unknown, DeviceCreationFlags.None, [ FeatureLevel.Level_12_1, FeatureLevel.Level_12_0, FeatureLevel.Level_11_1, FeatureLevel.Level_11_0, FeatureLevel.Level_10_0, FeatureLevel.Level_9_3, FeatureLevel.Level_9_2, FeatureLevel.Level_9_1, ], - out var device); - return device; + out var device).CheckError(); + return device!; } finally {