Starting at Options12 up to Options15, every feature check is using the D3D12_FEATURE_D3D12_OPTIONS12 enum to get the feature results. While I am not very familiar with D3D12 and could not reproduce an actual bug based on this, just looking at the API this seems wrong.
E.g. code that I believe is incorrect:
for (D3D12_FEATURE_DATA_D3D12_OPTIONS15 options15; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &options15, sizeof(options15)));)
I think the first argument of CheckFeatureSupport should be D3D12_FEATURE_DATA_D3D12_OPTIONS15 in the snippet above. And the same for the previous few checks.
If you agree this is wrong, I can send a PR to fix these few lines, however I'm not sure how to actually test such a change.
Describe the bug I believe the feature check code for Direct3D12 is mis-using the API.
See the code around https://github.com/bkaradzic/bgfx/blob/0b73e8c7e22a2876a8979a4dd9b77d0686058090/src/renderer_d3d12.cpp#L1125
Starting at Options12 up to Options15, every feature check is using the D3D12_FEATURE_D3D12_OPTIONS12 enum to get the feature results. While I am not very familiar with D3D12 and could not reproduce an actual bug based on this, just looking at the API this seems wrong.
E.g. code that I believe is incorrect:
for (D3D12_FEATURE_DATA_D3D12_OPTIONS15 options15; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &options15, sizeof(options15)));)
I think the first argument of
CheckFeatureSupport
should beD3D12_FEATURE_DATA_D3D12_OPTIONS15
in the snippet above. And the same for the previous few checks.If you agree this is wrong, I can send a PR to fix these few lines, however I'm not sure how to actually test such a change.