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

d3d12: Add D3D12PIXEventsReplaceBlock and D3D12PIXGetThreadInfo stub … #1582

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nqsxw
Copy link

@nqsxw nqsxw commented May 31, 2023

…to fix failing to load DirectML.dll

If we use vkd3d-proton in an application with DirectML enabled. The program will error out Entry Point Not Found.

The procedure entry point D3D12PIXEventsReplaceBlock/D3D12PIXGetThreadInfo could not be located in the dynamic link library C:\Windows\SYSTEM32\DirectML.dll

And the DirectML.dll will be unloaded.

@HansKristian-Work
Copy link
Owner

This is very questionable. Does the native d3d12.dll runtime export these symbols?

@nqsxw
Copy link
Author

nqsxw commented May 31, 2023

This is very questionable. Does the native d3d12.dll runtime export these symbols?

Yeah. It should be. You can try to use GetProcAddress to get that symbol from the system d3d12.dll.

And I found the MinGW runtime also exports the symbols. This link d3d12.def should be helpful.

@@ -206,3 +206,13 @@ HRESULT WINAPI DLLEXPORT D3D12GetInterface(REFCLSID rcslid, REFIID iid, void **d
return E_NOINTERFACE;
return IVKD3DCoreInterface_GetInterface(core, rcslid, iid, debug);
}

void WINAPI DLLEXPORT D3D12PIXEventsReplaceBlock()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least the return types should be correct here and return E_NOTIMPL. I doubt these functions return void.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, printing a FIXME probably screws with some registers so all these should probably do is return.... something.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I approve. I've updated the codes to return the E_NOTIMPL. Could you help review them?

…to fix failing to load DirectML.dll

If we use vkd3d-proton in an application with DirectML enabled.
The program will error out Entry Point Not Found.

The procedure entry point D3D12PIXEventsReplaceBlock/D3D12PIXGetThreadInfo
could not be located in the dynamic link library C:\Windows\SYSTEM32\DirectML.dll

And the DirectML.dll will be unloaded.

Signed-off-by: Jianhua Wu <[email protected]>
@@ -206,3 +206,15 @@ HRESULT WINAPI DLLEXPORT D3D12GetInterface(REFCLSID rcslid, REFIID iid, void **d
return E_NOINTERFACE;
return IVKD3DCoreInterface_GetInterface(core, rcslid, iid, debug);
}

HRESULT WINAPI DLLEXPORT D3D12PIXEventsReplaceBlock()
Copy link
Owner

@HansKristian-Work HansKristian-Work Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it really take no arguments? () != (void) in C fwiw. Proper argument types is important for WINAPI calling convention at least on 32-bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants