Skip to content
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 a less broken alternative to ID3D12Device_GetAdapterLuid() #121

Open
ue4brainstorm opened this issue Feb 16, 2024 · 2 comments
Open
Labels
conformance Related to supporting non-MSVC compilers

Comments

@ue4brainstorm
Copy link

Could we have a HRESULT ID3D12Device_GetAdapterLuid(ID3D12Device*, LUID*) instead? Figuring out the proper way to call this from C is a pain. Some examples of the problems caused by this function:

amerkoleci/Vortice.Windows#201

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26338

https://stackoverflow.com/questions/65197140/msvc-crash-when-invoking-a-method-directly-via-the-vtable-that-returns-by-value

@walbourn
Copy link
Member

walbourn commented Nov 7, 2024

The latest version of the header was updated to support non-MSVC compilers. Does this help your issue?

#if defined(_MSC_VER) || !defined(_WIN32)
        virtual LUID STDMETHODCALLTYPE GetAdapterLuid( void) = 0;
#else
        virtual LUID *STDMETHODCALLTYPE GetAdapterLuid( 
            LUID * RetVal) = 0;
#endif

@walbourn walbourn added the conformance Related to supporting non-MSVC compilers label Nov 7, 2024
@jacereda
Copy link

jacereda commented Nov 8, 2024

I don't think so, since I was compiling with MSVC when I faced this issue. It's a problem with the C API.

I ended up adding a C++ module with wrappers like this

HRESULT ID3D12Resource_GetDescNonBroken(ID3D12Resource *t,
                                              D3D12_RESOURCE_DESC *d) {
	*d = t->GetDesc();
	return S_OK;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conformance Related to supporting non-MSVC compilers
Projects
None yet
Development

No branches or pull requests

3 participants