-
Notifications
You must be signed in to change notification settings - Fork 120
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
Missing definition for ICompositionTexture
#1760
Comments
I don't see |
@mikebattista Think we're missing a header or idl here? |
Composition textures were added in 22621, I'm able to see it in the WinRT metadata from the SDK. I'd only expect the interop interfaces to be included here. |
@robmikh I'm looking at 22621 and don't see |
Looks like I misspelled it in the issue description, while writing it the correct way in the title. |
Got it, thanks! // \winrt\windows.ui.composition.interop.h
#if (NTDDI_VERSION >= NTDDI_WIN10_NI)
#undef INTERFACE
#define INTERFACE ICompositorInterop2
DECLARE_INTERFACE_IID_(ICompositorInterop2, IUnknown, "D3EEF34C-0667-4AFC-8D13-867607B0FE91")
{
IFACEMETHOD(CheckCompositionTextureSupport)(
_In_ IUnknown * renderingDevice,
_Out_ BOOL * supportsCompositionTextures) PURE;
IFACEMETHOD(CreateCompositionTexture)(
_In_ IUnknown * d3dTexture,
- _Outptr_ ICompositionTexture ** compositionTexture) PURE;
};
...
// \10.0.22621.0\winrt\windows.ui.composition.idl
[contract(Windows.Foundation.UniversalApiContract, 15.0)]
[exclusiveto(Windows.UI.Composition.CompositionTexture)]
[uuid(347D03A0-1C0A-4C0B-B232-8570B2B1A4EA)]
-interface ICompositionTexture : IInspectable
{
[propget] HRESULT SourceRect([out] [retval] Windows.Graphics.RectInt32* value);
[propput] HRESULT SourceRect([in] Windows.Graphics.RectInt32 value);
[propget] HRESULT AlphaMode([out] [retval] Windows.Graphics.DirectX.DirectXAlphaMode* value);
[propput] HRESULT AlphaMode([in] Windows.Graphics.DirectX.DirectXAlphaMode value);
[propget] HRESULT ColorSpace([out] [retval] Windows.Graphics.DirectX.DirectXColorSpace* value);
[propput] HRESULT ColorSpace([in] Windows.Graphics.DirectX.DirectXColorSpace value);
} Will try getting this added in tomorrow. |
@riverar the |
Was just talking notes and using the diff format to gain a highlighter. Not a real diff, apologies for any confusion ha! |
@riverar don't forget to look at the linked main...MarijnS95:win32metadata:winrt-composition-exclude-interop2 then! I've already done the work necessary to exclude it without botching/modifying the existing headers. |
Note that I proposed to just PR that, in case you're thinking of doing the exact same. |
I was going to take a stab at including it, don't think we want to exclude it from metadata. |
That might be even nicer, but probably a lot of work. I recall reading somewhere that "WinRT bindings are provided in a different file/way" ( |
Upon closer inspection, doesn't look like there's any work to be done here. Metadata is emitting the correct definition and pointing to the correct external source ( .method public hidebysig newslot abstract virtual
instance valuetype [Windows.Win32.winmd]Windows.Win32.Foundation.HRESULT CreateCompositionTexture (
[in] class [Windows.Win32.winmd]Windows.Win32.System.Com.IUnknown d3dTexture,
+ [out] class [Windows.Foundation.UniversalApiContract]Windows.UI.Composition.ICompositionTexture* compositionTexture
) cil managed
{
} // end of method ICompositorInterop2::CreateCompositionTexture |
Closing for now but feel free to holler or hit me if we're missing something here. |
Is this possibly the only non- |
ICompositionSurface should be in the same boat, and that's usable today from windows-rs. Maybe the WinRT metadata is out of date? |
Ah, maybe you're right. ICompositionTexture has a typedef in the interop header, which is unusual. That may be at play here when parsed. |
It's not the only reference tied to UniversalApiContract. Metadata has references to |
Complicating matters is that it appears Note to self: I'll need to update the Rust side too. |
@MarijnS95 Corrected that contract (#1763) and kicked off a metadata update @ microsoft/windows-rs#2745. Want to give those a whirl? |
@riverar thanks, yeah, the Windows SDK update in microsoft/windows-rs#2745 makes me able to pull in a new Win32 winmd - without the workaround to disable Good to know that there are multiple reasons for a |
|
The metadata should never refer to exclusive interfaces. They should be replaced by the class that implements the exclusive interface. |
It isn't up to me. This is passed to the C# compiler as a reference assembly, and C# is going to honor them. |
Looks like we'll need to fix up these references again (emitter.settings.rsp):
|
Actually think most of them are okay, just not the one I added back in 2023 🥲 |
Fix in the pipe, have to figure out what's going on with failing tests though. |
@mikebattista any idea when the next metadata will be published to nuget.org with the fix for this so I can get a CsWin32 update out? |
Just saying, I'd love for the next release to include #1757 in addition to the Agility SDK upgrade recently, if we can wait for that 🤞 |
In c41ef74 a new
ICompositorInterop2
interface is added togeneration/WinSDK/RecompiledIdlHeaders/winrt/windows.ui.composition.interop.h
which makes use ofICompositionTexture
that is only defined ingeneration/WinSDK/RecompiledIdlHeaders/winrt/windows.ui.composition.h
. This file is not listed under--traverse
ingeneration\WinSDK\Partitions\WinRT.Composition\settings.rsp
, causing the winmd to not have a definition forICompositionTexture
(only a type reference).windows-rs
requires a type definition to understand how it behaves, and will otherwise crash (with a still rather-obscure error):microsoft/windows-rs#2539 (comment)
Simply adding
<IncludeRoot>/winrt/windows.ui.composition.h
to--traverse
to scrape the whole file results in many errors that I cannot immediately resolve (duplicates innamespace Apis
, many missing references to types fromWindows.Foundation.Numerics
).Is it okay to open a PR that adds
ICompositorInterop2
to--exclude
for now, until someone figures out how to successfully scrapewindows.ui.composition.h
?The text was updated successfully, but these errors were encountered: