-
Notifications
You must be signed in to change notification settings - Fork 114
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Actual behavior
When calling the GetAdapterLuid method on the ID3D12Device interface, I get this:
It errors on ID3D12Device and ID3D12Device14 (latest). I tried the code in C++ and it worked perfectly, so it's an issue with the generated code.
Expected behavior
It should return a populated LUID structure.
Repro steps
NativeMethods.txtcontent:
DXGI_ERROR_*
D3D_FEATURE_LEVEL
D3D12_*
DXGI_MODE_DESC1
CreateDXGIFactory2
D3D12CreateDevice
IDXGIFactory2
IDXGIFactory7
IDXGIAdapter4
IDXGIOutput6
ID3D12Device
ID3D12Device14
NativeMethods.jsoncontent (if present):
{
"$schema": "https://aka.ms/CsWin32.schema.json",
"emitSingleFile": false,
"useSafeHandles": false,
"allowMarshaling": false
}- Any of your own code that should be shared?
Try something along these lines.
IDXGIFactory7* factory = null;
IDXGIAdapter1* adapter1 = null;
IDXGIAdapter4* adapter4 = null;
ID3D12Device14* d3dDevice = null;
PInvoke.CreateDXGIFactory2(flags, typeof(IDXGIFactory7).GUID, out void* obj);
factory = (IDXGIFactory7*)obj;
factory->EnumAdapters1((uint)devices.Count, &adapter1);
adapter1->QueryInterface(out adapter4);
PInvoke.D3D12CreateDevice((IUnknown*)adapter4, Windows.Win32.Graphics.Direct3D.D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_12_0, typeof(ID3D12Device14).GUID, (void**)&d3dDevice);
LUID luid = d3dDevice->GetAdapterLuid();Context
- CsWin32 version: 0.3.183
- Target Framework: .net 8
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working