Some applications (e.g. UE4) requires the DriverVersion string in the registry. The string is taken from `dlls/wbemprox/builtin.c`
-- v5: win32u: Add DriverVersion string for GPUs to registry
From: Michael Skorokhodov mykhailo.skorokhodov@globallogic.com
Some applications (e.g. UE4) requires the DriverVersion string in the registry.
Signed-off-by: Mykhailo Skorokhodov mykhailo.skorokhodov@globallogic.com --- dlls/win32u/sysparams.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 233e5bb934b..d978bd2c144 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1230,6 +1230,8 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param ) static const WCHAR ramdacW[] = {'I','n','t','e','r','g','r','a','t','e','d',' ','R','A','M','D','A','C',0}; static const WCHAR driver_dateW[] = {'D','r','i','v','e','r','D','a','t','e',0}; + static const WCHAR driver_versionW[] = + {'D','r','i','v','e','r','V','e','r','s','i','o','n',0};
TRACE( "%s %04X %04X %08X %02X\n", debugstr_w(gpu->name), gpu->vendor_id, gpu->device_id, gpu->subsys_id, gpu->revision_id ); @@ -1374,6 +1376,30 @@ static void add_gpu( const struct gdi_gpu *gpu, void *param ) set_reg_value( hkey, chip_typeW, REG_BINARY, desc, size ); set_reg_value( hkey, dac_typeW, REG_BINARY, ramdacW, sizeof(ramdacW) );
+ if (gpu->vendor_id && gpu->device_id) + { + switch (gpu->vendor_id) + { + /* Intel */ + case 0x8086: + sprintf( buffer, "31.0.101.4576" ); + break; + /* AMD */ + case 0x1002: + sprintf( buffer, "31.0.14051.5006" ); + break; + /* Nvidia */ + case 0x10de: + sprintf( buffer, "31.0.15.3625" ); + break; + /* Default value for any other vendor */ + default: + sprintf( buffer, "31.0.10.1000" ); + break; + } + set_reg_value( hkey, driver_versionW, REG_SZ, bufferW, asciiz_to_unicode( bufferW, buffer ) ); + } + NtClose( hkey );
link_device( ctx->gpuid, guid_devinterface_display_adapterW );
On Fri Jul 28 02:58:23 2023 +0000, Zhiyi Zhang wrote:
Put the comment on top of default.
Done.
On Mon Jul 31 07:02:37 2023 +0000, Michael Skorokhodov wrote:
changed this line in [version 5 of the diff](/wine/wine/-/merge_requests/3104/diffs?diff_id=60031&start_sha=80b7052eec80d00eadc9e95a02decc22835bf532#85770a8b187bd82db4dbb9a2b8a5f34616049d0f_1400_1400)
Done.
On Mon Jul 31 07:02:39 2023 +0000, Michael Skorokhodov wrote:
changed this line in [version 5 of the diff](/wine/wine/-/merge_requests/3104/diffs?diff_id=60031&start_sha=80b7052eec80d00eadc9e95a02decc22835bf532#85770a8b187bd82db4dbb9a2b8a5f34616049d0f_1389_1389)
If DriverVersion is not really related to vendors, then I think it would be enough to pick the highest "31.*" version and then use it for all vendors. I thought they would have different versions.
On Mon Jul 31 07:28:48 2023 +0000, Zhiyi Zhang wrote:
If DriverVersion is not really related to vendors, then I think it would be enough to pick the highest "31.*" version and then use it for all vendors. I thought they would have different versions.
DriverVersion is related to vendors, sometimes. Here is an example of a rare case: ```C if (vendor == 0x10de && driverVersion >= 9999) { enable_cool_rtx_stuff();} ``` Proton or DXVK should be able to fix it.
On Mon Jul 31 07:50:21 2023 +0000, Michael Skorokhodov wrote:
DriverVersion is related to vendors, sometimes. Here is an example of a rare case:
if (vendor == 0x10de && driverVersion >= 9999) { enable_cool_rtx_stuff();}
Proton or DXVK should be able to fix it.
Where did you see this code?
On Mon Jul 31 07:52:46 2023 +0000, Zhiyi Zhang wrote:
Where did you see this code?
It's an example of what UE4 does.
about it: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7928#note_1695389
On Mon Jul 31 07:59:23 2023 +0000, Michael Skorokhodov wrote:
It's an example (pseudocode) of what UE4 does. about it: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7928#note_1695389
Screenshots of that UE4 code. ![image](/uploads/ff3c0273d052002a8c553d3581a5a79c/image.png) ![image](/uploads/d67190f5d50c96cffb12ea156de4518d/image.png)
On Mon Jul 31 07:58:31 2023 +0000, Michael Skorokhodov wrote:
Screenshots of that UE4 code. ![image](/uploads/ff3c0273d052002a8c553d3581a5a79c/image.png) ![image](/uploads/d67190f5d50c96cffb12ea156de4518d/image.png)
As I said in my PR to Proton: UE4 expects ANY value in the driverVersion string.
On Mon Jul 31 08:03:05 2023 +0000, Michael Skorokhodov wrote:
As I said in my PR to Proton: UE4 expects ANY value (for Intel GPUs) in the driverVersion string.
I see. Adding a comment saying the last seven digits are the driver number would be beneficial. Also, please add a dot after the commit subject. And you can put the commit message body on a single line. I usually break at 100 characters. Otherwise, it looks good to me. Thanks for looking into this.