Browse Source

libobs-d3d11: Log D3D11 adapter memory correctly

DXGI_ADAPTER_DESC's DedicatedVideoMemory and SharedSystemMemory are
unsigned long long int, but we were logging them as unsigned int. For
GPUs with memory values higher than 4294967295, the logged value would
roll over. Use %PRIu64 (%llu on VS2022) instead of %u in the log call.
Ryan Foster 2 years ago
parent
commit
dc5813c947
1 changed files with 2 additions and 2 deletions
  1. 2 2
      libobs-d3d11/d3d11-subsystem.cpp

+ 2 - 2
libobs-d3d11/d3d11-subsystem.cpp

@@ -1342,9 +1342,9 @@ static inline void LogD3DAdapters()
 
 		os_wcs_to_utf8(desc.Description, 0, name, sizeof(name));
 		blog(LOG_INFO, "\tAdapter %u: %s", i, name);
-		blog(LOG_INFO, "\t  Dedicated VRAM: %u",
+		blog(LOG_INFO, "\t  Dedicated VRAM: %" PRIu64,
 		     desc.DedicatedVideoMemory);
-		blog(LOG_INFO, "\t  Shared VRAM:    %u",
+		blog(LOG_INFO, "\t  Shared VRAM:    %" PRIu64,
 		     desc.SharedSystemMemory);
 		blog(LOG_INFO, "\t  PCI ID:         %x:%x", desc.VendorId,
 		     desc.DeviceId);