protonscr

No (documented) way to detect that app runs under vkd3d

vkd3dclosed
HansKristian-Work/vkd3d-proton#2459 · opened 2025-05-04 by Devaniti · updated 2025-05-05 · 4 comments · github
DDevaniti 2025-05-04 github

When running under vkd3d some features are reported differently, e.g. Work Groups become unsupported, D3D12_FEATURE_DATA_D3D12_OPTIONS3.WriteBufferImmediateSupportFlags may become more restrictive, stream out is reported as completely unsupported, etc.

I maintain database similar to vulkan gpuinfo, but for d3d12 (https://d3d12infodb.boolka.dev/), and I need a way to differentiate "real" d3d12 drivers from emulation layers, so that users can check both "normal" capabilities, and capabilities when running under vkd3d
You can see how those reports differ: normal, vkd3d

So far I haven't found a way to detect vkd3d, other than some heuristics which will likely break in the future
There seems to be a way to detect running under Wine, but since vkd3d can be used under Windows as well, it is not enough

Is there a way to detect when you run under vkd3d? Is there a way to detect vkd3d's version? Is it documented somewhere? Can it be documented if it is not already?

HHansKristian-Work maintainer 2025-05-05 github

You could try to detect if D3D12GetInterface returns something for IVKD3DCoreInterface (include/vkd3d_core_interface.idl), or query the device with ID3D12DXVKInteropDevice from include/vkd3d_device_vkd3d_ext.idl.

stream out

that is ... not expected.

DDevaniti 2025-05-05 github

Thanks, I guess there's no way to query vkd3d version then, but it is not a big deal
Feel free to close the issue if you don't want to add that to documentation
For stream out, I haven't tested whether it actually works or not, but it seems that ID3D12Device::CheckFeatureSupport when called with D3D12_FEATURE_FORMAT_SUPPORT never sets the D3D12_FORMAT_SUPPORT1_SO_BUFFER bit

HHansKristian-Work maintainer 2025-05-05 github

Feel free to close the issue if you don't want to add that to documentation

Generally we don't want random games/engines start querying for vkd3d-proton internals, so this is intentionally gray area, but is a pragmatic thing where it could make sense on a case-by-case basis.

There are some format bits we're missing because no application relies on those being set, so it has never been on the radar. We should fix it I suppose.

HHansKristian-Work maintainer 2025-05-05 github

The format features are on master now, so closing.

Nothing extracted yet.