protonscr

Improvement of ID3D12Device::CheckFeatureSupport for D3D12_FEATURE_ROOT_SIGNATURE

vkd3dclosed
HansKristian-Work/vkd3d-proton#1548 · opened 2023-05-04 by StarsX · updated 2023-05-10 · 6 comments · github
SStarsX 2023-05-04 github

For now, m_device->CheckFeatureSupport(D3D12_FEATURE_ROOT_SIGNATURE, &featureData, sizeof(featureData))) always outputs nothing in featureData (D3D12_FEATURE_DATA_ROOT_SIGNATURE). For other features, I wonder if CheckFeatureSupport should be necessary. However, it seems CheckFeatureSupport(D3D12_FEATURE_ROOT_SIGNATURE) for the highest root signature version can be commonly used in DX12 apps for root signature compatibility (as DX12 has a versioned root signature creation method), and thus I think vkd3d-proton should at least put D3D_ROOT_SIGNATURE_VERSION_1_0 into D3D12_FEATURE_DATA_ROOT_SIGNATURE::HighestVersion.

Although I can make a workaround manually by:
D3D12_FEATURE_DATA_ROOT_SIGNATURE featureData = {};

if (FAILED(m_device->CheckFeatureSupport(D3D12_FEATURE_ROOT_SIGNATURE,
&featureData, sizeof(featureData))) || !featureData.HighestVersion)
return D3D_ROOT_SIGNATURE_VERSION_1_0;

I think it would be better to handle it by vkd3d-proton. Thanks.

Software information

Name of the game, settings used etc.

System information

  • GPU: AMD RX6800 and NVIDIA RTX 3080
  • Driver: both latest
  • Wine version: NA
  • VKD3D-Proton version: latest staging

Log files

NA. I made a breakpoint to check the output value from CheckFeatureSupport.

Mmisyltoad maintainer 2023-05-04 github

Sorry, I don't follow what you are saying. Are you seeing different behaviour on this on VKD3D-Proton vs Windows D3D12?

The structure here says that it is both an input and an output, where it signals the highest version to check for:
https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_feature_data_root_signature

On input, specifies the highest version D3D_ROOT_SIGNATURE_VERSION to check for. On output specifies the highest version, up to the input version specified, actually available.

Ddoitsujin maintainer 2023-05-04 github

FWIW we're already doing this:

            data->HighestVersion = min(data->HighestVersion, D3D_ROOT_SIGNATURE_VERSION_1_1);

Which, if the documentation is correct, should be exactly what this function is supposed to do.

SStarsX 2023-05-05 github

FWIW we're already doing this:

            data->HighestVersion = min(data->HighestVersion, D3D_ROOT_SIGNATURE_VERSION_1_1);

Which, if the documentation is correct, should be exactly what this function is supposed to do.

I think this is related, but I got 0 for HighestVersion. I think it also should be at least D3D_ROOT_SIGNATURE_VERSION_1_0 from CheckFeatureSupport:

data->HighestVersion = max(data->HighestVersion, D3D_ROOT_SIGNATURE_VERSION_1_0);

SStarsX 2023-05-05 github

Sorry, I don't follow what you are saying. Are you seeing different behaviour on this on VKD3D-Proton vs Windows D3D12?

The structure here says that it is both an input and an output, where it signals the highest version to check for: https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_feature_data_root_signature

On input, specifies the highest version D3D_ROOT_SIGNATURE_VERSION to check for. On output specifies the highest version, up to the input version specified, actually available.

I see. Thank you. But the native DX12 behavior does output at least D3D_ROOT_SIGNATURE_VERSION_1_0 or return non-S_OK when the input is not specified (I'll double check it).

SStarsX 2023-05-05 github

Sorry, I don't follow what you are saying. Are you seeing different behaviour on this on VKD3D-Proton vs Windows D3D12?

The structure here says that it is both an input and an output, where it signals the highest version to check for: https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ns-d3d12-d3d12_feature_data_root_signature

On input, specifies the highest version D3D_ROOT_SIGNATURE_VERSION to check for. On output specifies the highest version, up to the input version specified, actually available.

I see. Thank you. But the native DX12 behavior does output at least D3D_ROOT_SIGNATURE_VERSION_1_0 or return non-S_OK when the input is not specified (I'll double check it).

SStarsX 2023-05-05 github

Confirmed: the native DX12 returns E_INVALIDARG when the input HighestVersion is 0. So, it's only a tiny behavior-difference issue. The main problem was my carelessness. Thanks.

Nothing extracted yet.