SnowflakePowered / librashader

RetroArch Shaders for All
Mozilla Public License 2.0
77 stars 7 forks source link

librashader.dll pulls in unnecessary D3D12 imports #11

Closed chyyran closed 1 year ago

chyyran commented 1 year ago

librashader.dll has the following import table

Dump of file librashader.dll

File Type: DLL

  Image has the following dependencies:

    KERNEL32.dll
    dxcompiler.dll
    d3d12.dll
    d3dcompiler_47.dll
    bcrypt.dll
    shell32.dll
    ole32.dll
    oleaut32.dll
    MSVCP140.dll
    VCRUNTIME140.dll
    VCRUNTIME140_1.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-utility-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-time-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-filesystem-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll
    api-ms-win-crt-locale-l1-1-0.dll

dxcompiler.dll and d3d12.dll are not available or necessary for non-D3D12 consumers. These imports should be delayloaded so non-D3D12 consumers can still support their respective runtimes.


Originally reported in

I know you can't possibly be expected to support this scenario, but using the latest RC, Librashader stopped working for a couple of my users who were using a Windows build through Wine. Older versions (that predate CRT Royale working) seemed to work for them in Wine.

Originally posted by @star69rem in https://github.com/SnowflakePowered/librashader/discussions/2#discussioncomment-5020529

Root caused in

I did some local testing and the https://github.com/SnowflakePowered/librashader/tree/fix-delayload-dxcompiler branch should fix it without needing to build runtime-d3d11. It's probably unreasonable for me to ask your users to do testing for me but some confirmation that this fixes the issue would be nice to have.

Originally posted by @chyyran in https://github.com/SnowflakePowered/librashader/discussions/2#discussioncomment-5022087