@@ -212,11 +212,40 @@ fn merge_unreal_context(event: &mut Event, context: Unreal4Context) {
212
212
os_context. name = Annotated :: new ( os_major) ;
213
213
}
214
214
215
- if let Some ( gpu_brand) = runtime_props. misc_primary_gpu_brand . take ( ) {
215
+ // See https://github.com/EpicGames/UnrealEngine/blob/5.3.2-release/Engine/Source/Runtime/RHI/Private/DynamicRHI.cpp#L368-L376
216
+ if let Some ( adapter_name) = context. engine_data . get ( "RHI.AdapterName" ) {
217
+ let gpu_context = contexts. get_or_default :: < GpuContext > ( ) ;
218
+ gpu_context. name = Annotated :: new ( adapter_name. into ( ) ) ;
219
+ } else if let Some ( gpu_brand) = runtime_props. misc_primary_gpu_brand . take ( ) {
216
220
let gpu_context = contexts. get_or_default :: < GpuContext > ( ) ;
217
221
gpu_context. name = Annotated :: new ( gpu_brand) ;
218
222
}
219
223
224
+ if let Some ( device_id) = context. engine_data . get ( "RHI.DeviceId" ) {
225
+ let gpu_context = contexts. get_or_default :: < GpuContext > ( ) ;
226
+ gpu_context. id = Annotated :: new ( Value :: String ( device_id. into ( ) ) ) ;
227
+ }
228
+
229
+ if let Some ( feature_level) = context. engine_data . get ( "RHI.FeatureLevel" ) {
230
+ let gpu_context = contexts. get_or_default :: < GpuContext > ( ) ;
231
+ gpu_context. graphics_shader_level = Annotated :: new ( feature_level. into ( ) ) ;
232
+ }
233
+
234
+ if let Some ( vendor_name) = context. engine_data . get ( "RHI.GPUVendor" ) {
235
+ let gpu_context = contexts. get_or_default :: < GpuContext > ( ) ;
236
+ gpu_context. vendor_name = Annotated :: new ( vendor_name. into ( ) ) ;
237
+ }
238
+
239
+ if let Some ( driver_version) = context. engine_data . get ( "RHI.UserDriverVersion" ) {
240
+ let gpu_context = contexts. get_or_default :: < GpuContext > ( ) ;
241
+ gpu_context. version = Annotated :: new ( driver_version. into ( ) ) ;
242
+ }
243
+
244
+ if let Some ( rhi_name) = context. engine_data . get ( "RHI.RHIName" ) {
245
+ let gpu_context = contexts. get_or_default :: < GpuContext > ( ) ;
246
+ gpu_context. api_type = Annotated :: new ( rhi_name. into ( ) ) ;
247
+ }
248
+
220
249
if runtime_props. is_assert . unwrap_or ( false ) {
221
250
event. level = Annotated :: new ( Level :: Error )
222
251
}
@@ -338,6 +367,27 @@ mod tests {
338
367
<Modules>\\Mac\Home\Desktop\WindowsNoEditor\YetAnother\Binaries\Win64\YetAnother.exe
339
368
\\Mac\Home\Desktop\WindowsNoEditor\Engine\Binaries\ThirdParty\PhysX3\Win64\VS2015\PxFoundationPROFILE_x64.dll</Modules>
340
369
</RuntimeProperties>
370
+ <EngineData>
371
+ <MatchingDPStatus>WindowsNo errors</MatchingDPStatus>
372
+ <RHI.IntegratedGPU>false</RHI.IntegratedGPU>
373
+ <RHI.DriverDenylisted>false</RHI.DriverDenylisted>
374
+ <RHI.D3DDebug>false</RHI.D3DDebug>
375
+ <RHI.Breadcrumbs>true</RHI.Breadcrumbs>
376
+ <RHI.DRED>true</RHI.DRED>
377
+ <RHI.DREDMarkersOnly>false</RHI.DREDMarkersOnly>
378
+ <RHI.DREDContext>true</RHI.DREDContext>
379
+ <RHI.Aftermath>true</RHI.Aftermath>
380
+ <RHI.RHIName>D3D12</RHI.RHIName>
381
+ <RHI.AdapterName>NVIDIA GeForce RTX 4060 Laptop GPU</RHI.AdapterName>
382
+ <RHI.UserDriverVersion>551.52</RHI.UserDriverVersion>
383
+ <RHI.InternalDriverVersion>31.0.15.5152</RHI.InternalDriverVersion>
384
+ <RHI.DriverDate>2-7-2024</RHI.DriverDate>
385
+ <RHI.FeatureLevel>SM5</RHI.FeatureLevel>
386
+ <RHI.GPUVendor>NVIDIA</RHI.GPUVendor>
387
+ <RHI.DeviceId>28E0</RHI.DeviceId>
388
+ <DeviceProfile.Name>Windows</DeviceProfile.Name>
389
+ <Platform.AppHasFocus>true</Platform.AppHasFocus>
390
+ </EngineData>
341
391
<PlatformProperties>
342
392
<PlatformIsRunningWindows>1</PlatformIsRunningWindows>
343
393
<PlatformCallbackResult>0</PlatformCallbackResult>
0 commit comments