Interface Not Registered #1590
-
I am trying to use D3D11 in Silk.NET, and I am following the sample given in this GitHub repository. However, I reach this line of code: When I reach it, the API throws a System.ArgumentException that reads "Interface not registered." I cannot figure out why. Is there something I am missing? My Swap Chain is defined as: I also define my Factory as: My Swap Chain Description is: I have also abstracted the window handle into its own class. I am unsure if this is the right place to ask this question, but I don't really know where else to put it. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Does the sample itself run? |
Beta Was this translation helpful? Give feedback.
-
Do you have a more complete sample that we can just run/a more detailed stack trace? I've tried reproducing by tweaking a few parameters in the sample and I can't reproduce. You can also use the info queue to get more info: // before you do anything with dxgi
using var infoQueue = dxgi.GetDebugInterface1<IDXGIInfoQueue>(0);
// check the info queue after failing to create the swapchain
var hr = factory.CreateSwapChainForHwnd(
device,
_renderWindow.WindowSurface.Native!.DXHandle!.Value,
in scd,
null,
ref Unsafe.NullRef<IDXGIOutput>(),
ref swapchain);
if (!HResult.IndicatesSuccess(hr))
{
for (var i = 0ul; i < infoQueue.GetNumStoredMessages(); i++)
{
nuint msgByteLength = default;
SilkMarshal.ThrowHResult(infoQueue.GetMessageA(i, null, ref msgByteLength));
var msgBytes = new byte[msgByteLength];
ref var msg = ref Unsafe.As<byte, InfoQueueMessage>(ref msgBytes[0]);
SilkMarshal.ThrowHResult(infoQueue.GetMessageA(i, ref msg, ref msgByteLength));
Console.WriteLine(SilkMarshal.PtrToString((nint) msg.PDescription));
}
} Alternatively you can set up another thread to do this like we do in D3D11's DebugHelpers. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
I just figured it out. I forgot to set the Format field in the SwapChainDesc1. The "Interface not registered" message was definitely misleading, and I think it should be changed to mirror what the struct _com_error in C++ does in interpreting an HRESULT. |
Beta Was this translation helpful? Give feedback.
I just figured it out. I forgot to set the Format field in the SwapChainDesc1. The "Interface not registered" message was definitely misleading, and I think it should be changed to mirror what the struct _com_error in C++ does in interpreting an HRESULT.