-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Presentation.h and PresentationTypes.h (Win11 Composition Swapchain API) #403
Conversation
…in API) This looks right except that `Windows.CreatePresentationFactory` has a blank DLL name: `[DllImport("", ...)]`
|
The unresolved |
--with-using | ||
CompositionFrameDisplayInstance=TerraFX.Interop.DirectX | ||
ICompositionFramePresentStatistics=TerraFX.Interop.DirectX | ||
IPresentationSurface=TerraFX.Interop.DirectX | ||
IPresentationSurface2=TerraFX.Interop.DirectX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to get these automatic by adding the type it uses to https://github.com/terrafx/terrafx.interop.windows/blob/main/generation/remap-namespaces.rsp, which should just tell the system that DXGI_COLOR_SPACE_TYPE
is in TerraFX.Interop.DirectX
You should be able to add the entries to the handler in https://github.com/terrafx/terrafx.interop.windows/blob/main/tests/Interop/Windows/ResolveDllImportTests.cs#L53 There's an existing grouping for cases that simply aren't on server, but if its instead relegated to a particular version of Windows then you can place it in a separate grouping with the relevant guard. |
That is already be getting handled via https://github.com/terrafx/terrafx.interop.windows/blob/main/tests/Interop/Windows/ResolveDllImportTests.cs#L218 and warning, not erroring. The only actual failure is |
It should be possible to test the |
using static TerraFX.Interop.Windows.Windows;
unsafe void Main()
{
using ComPtr<IDXGIFactory7> spDxgiFactory = default;
HRESULT hr = DirectX.CreateDXGIFactory2(
0,
__uuidof<IDXGIFactory7>(),
(void**)spDxgiFactory.GetAddressOf());
D3D_FEATURE_LEVEL featureLevel = D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_0;
using ComPtr<ID3D11Device> spWarpDevice = default;
hr = DirectX.D3D11CreateDevice(
null,
D3D_DRIVER_TYPE.D3D_DRIVER_TYPE_WARP,
HMODULE.NULL,
(uint)D3D11_CREATE_DEVICE_FLAG.D3D11_CREATE_DEVICE_BGRA_SUPPORT,
&featureLevel,
1,
D3D11.D3D11_SDK_VERSION,
spWarpDevice.GetAddressOf(),
null,
null);
using ComPtr<IPresentationFactory> spPresentationFactory = default;
hr = CreatePresentationFactory(
(IUnknown*)spWarpDevice.Get(),
__uuidof<IPresentationFactory>(),
(void**)spPresentationFactory.GetAddressOf());
bool isPresentationSupported = (BOOL)spPresentationFactory.Get()->IsPresentationSupported();
bool isPresentationSupportedWithIFlip = (BOOL)spPresentationFactory.Get()->IsPresentationSupportedWithIndependentFlip();
(isPresentationSupported, isPresentationSupportedWithIFlip).Dump();
} |
This looks right except that
Windows.CreatePresentationFactory
has a blank DLL name:[DllImport("", ...)]
. It should bedcomp.dll
as per https://learn.microsoft.com/en-us/windows/win32/api/presentation/nf-presentation-createpresentationfactoryEdit: Fixed the DLL name for the
[DllImport]
onCreatePresentationFactory