mirror of
https://github.com/VirtualDrivers/Virtual-Display-Driver.git
synced 2026-12-06 07:01:23 +09:00
Select Direct3D 12 automatically and report I2C support
This commit is contained in:
1 parent
ff7bfdb7a6
commit
baae153a41
3 files changed
+14
-13
No files matched your search
@@ -106,7 +106,7 @@ bool HDRPlus = false;
|
||||
bool SDR10 = false;
|
||||
bool customEdid = false;
|
||||
bool customDisplayId = false;
|
||||
bool d3d12SwapChain = false;
|
||||
bool d3d12SwapChain = true;
|
||||
bool virtualI2c = false;
|
||||
unsigned int initialDesktopReencodeFrameCount = 0;
|
||||
bool hardwareCursor = false;
|
||||
@@ -436,11 +436,11 @@ string WStringToString(const wstring& wstr) { //basically just a function for co
|
||||
return str;
|
||||
}
|
||||
|
||||
bool EnabledQuery(const std::wstring& settingKey) {
|
||||
bool EnabledQuery(const std::wstring& settingKey, bool defaultValue = false) {
|
||||
auto it = SettingsQueryMap.find(settingKey);
|
||||
if (it == SettingsQueryMap.end()) {
|
||||
vddlog("e", "requested data not found in xml, consider updating xml!");
|
||||
return false;
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
std::wstring regName = it->second.first;
|
||||
@@ -490,25 +490,25 @@ check_xml:
|
||||
HRESULT hr = SHCreateStreamOnFileEx(settingsname.c_str(), STGM_READ, FILE_ATTRIBUTE_NORMAL, FALSE, nullptr, &pFileStream);
|
||||
if (FAILED(hr)) {
|
||||
LogQueries("d", xmlName + L" - Failed to create file stream for XML settings.");
|
||||
return false;
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
CComPtr<IXmlReader> pReader;
|
||||
hr = CreateXmlReader(__uuidof(IXmlReader), (void**)&pReader, nullptr);
|
||||
if (FAILED(hr)) {
|
||||
LogQueries("d", xmlName + L" - Failed to create XML reader.");
|
||||
return false;
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
hr = pReader->SetInput(pFileStream);
|
||||
if (FAILED(hr)) {
|
||||
LogQueries("d", xmlName + L" - Failed to set input for XML reader.");
|
||||
return false;
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
XmlNodeType nodeType;
|
||||
const wchar_t* pwszLocalName;
|
||||
bool xmlLoggingValue = false;
|
||||
bool xmlLoggingValue = defaultValue;
|
||||
|
||||
while (S_OK == pReader->Read(&nodeType)) {
|
||||
if (nodeType == XmlNodeType_Element) {
|
||||
@@ -2352,7 +2352,8 @@ void HandleClient(HANDLE hPipe) {
|
||||
|
||||
}
|
||||
else if (bufferwstr == L"GETIDDCXFEATURES") {
|
||||
SendToPipe("IDDCX_FEATURES " + std::to_string(g_IddCx111Features.load()));
|
||||
const bool atomicI2c = IDD_IS_FIELD_AVAILABLE(IDD_CX_CLIENT_CONFIG, EvtIddCxMonitorI2CTransmitAndReceive);
|
||||
SendToPipe("IDDCX_FEATURES " + std::to_string(g_IddCx111Features.load()) + " I2C " + (atomicI2c ? "1" : "0"));
|
||||
}
|
||||
else if (bufferwstr.rfind(L"SETREENCODECOUNT ", 0) == 0) {
|
||||
if (!HasIddCx111Feature(IDDCX_DEVICE_FEATURES_1_11_UPDATE_REENCODE_COUNT) ||
|
||||
@@ -2541,7 +2542,7 @@ extern "C" NTSTATUS DriverEntry(
|
||||
|
||||
customEdid = EnabledQuery(L"CustomEdidEnabled");
|
||||
customDisplayId = EnabledQuery(L"CustomDisplayIdEnabled");
|
||||
d3d12SwapChain = EnabledQuery(L"D3D12SwapChainEnabled");
|
||||
d3d12SwapChain = EnabledQuery(L"D3D12SwapChainEnabled", true);
|
||||
virtualI2c = EnabledQuery(L"VirtualI2cEnabled");
|
||||
initialDesktopReencodeFrameCount = static_cast<UINT>(max(0, GetIntegerSetting(L"StaticDesktopReencodeFrameCount")));
|
||||
g_DesktopReencodeFrameCount.store(initialDesktopReencodeFrameCount);
|
||||
|
||||
@@ -19,13 +19,13 @@ Build the x64 or ARM64 driver with the Windows 28000 SDK and WDK. The release bu
|
||||
|
||||
| Setting | Behavior |
|
||||
| --- | --- |
|
||||
| `D3D12SwapChain` | Use a D3D12 device and command queue for IddCx buffers when Windows and the selected GPU support them. The driver falls back to D3D11 if setup fails. |
|
||||
| `D3D12SwapChain` | Automatically use D3D12 for IddCx buffers on compatible Windows runtimes and GPUs. Defaults to `true`. The driver uses D3D11 when D3D12 is unavailable or this setting is `false`. |
|
||||
| `CustomDisplayId` | Read `user_displayid.bin` from the configuration folder as a standalone DisplayID descriptor. Windows must support DisplayID-only monitor descriptions. The driver falls back to EDID when the file is unavailable or Windows rejects it. |
|
||||
| `VirtualI2c` | Enable the atomic I2C callback and the paired legacy callbacks on compatible runtimes. The virtual display serves its EDID and read-only DDC/CI identity queries. |
|
||||
| `StaticDesktopReencodeFrameCount` | Set the adapter’s initial static desktop reencode count. The default is `0`. |
|
||||
|
||||
The first three options default to `false`. Restart the driver after changing the XML or registry settings.
|
||||
`CustomDisplayId` and `VirtualI2c` default to `false`. Restart the driver after changing the XML or registry settings.
|
||||
|
||||
Virtual Driver Control 2.0 can remove these XML fields when it saves. To keep the settings across Control saves, use DWORD values in `HKLM\SOFTWARE\MikeTheTech\VirtualDisplayDriver`. Set `D3D12SWAPCHAIN`, `CUSTOMDISPLAYID`, or `VIRTUALI2C` to `1` to enable them. To disable an override, remove the DWORD and leave the corresponding XML option disabled. Set `STATICDESKTOPREENCODEFRAMECOUNT` to a value from `0` to `2147483647` for the initial count.
|
||||
Virtual Driver Control 2.0.0 can remove these XML fields when it saves. To keep the settings across Control saves, use DWORD values in `HKLM\SOFTWARE\MikeTheTech\VirtualDisplayDriver`. Set `CUSTOMDISPLAYID` or `VIRTUALI2C` to `1` to enable them. To force D3D11, set `<D3D12SwapChain>false</D3D12SwapChain>` in the XML and clear any enabling `D3D12SWAPCHAIN` registry value. To disable an override, remove the DWORD and leave the corresponding XML option disabled. Set `STATICDESKTOPREENCODEFRAMECOUNT` to a value from `0` to `2147483647` for the initial count.
|
||||
|
||||
In the Control console, `GETIDDCXFEATURES` returns the OS feature mask. Run Control as an administrator to queue a `SETREENCODECOUNT <unsigned integer>` override for current and subsequent swap chains until the driver restarts. Driver logs report the result of applying the override. [Microsoft’s IddCx 1.11 documentation](https://learn.microsoft.com/en-us/windows-hardware/drivers/display/iddcx1-dot-11-updates)
|
||||
@@ -79,7 +79,7 @@
|
||||
</edid>
|
||||
|
||||
<iddcx>
|
||||
<D3D12SwapChain>false</D3D12SwapChain>
|
||||
<D3D12SwapChain>true</D3D12SwapChain>
|
||||
<VirtualI2c>false</VirtualI2c>
|
||||
<StaticDesktopReencodeFrameCount>0</StaticDesktopReencodeFrameCount>
|
||||
</iddcx>
|
||||
|
||||
Reference in new issue
Block a user