diff --git a/Editor/OptionsWindow.cpp b/Editor/OptionsWindow.cpp index 5b7293ea1..49fa34920 100644 --- a/Editor/OptionsWindow.cpp +++ b/Editor/OptionsWindow.cpp @@ -109,6 +109,7 @@ void OptionsWindow::Create(EditorComponent* _editor) bool info = editor->main->config.GetSection("options").GetBool("info"); editor->main->infoDisplay.heap_allocation_counter = info; editor->main->infoDisplay.vram_usage = info; + editor->main->infoDisplay.device_name = info; editor->main->infoDisplay.colorspace = info; editor->main->infoDisplay.resolution = info; editor->main->infoDisplay.logical_size = info; @@ -117,6 +118,7 @@ void OptionsWindow::Create(EditorComponent* _editor) otherinfoCheckBox.OnClick([&](wi::gui::EventArgs args) { editor->main->infoDisplay.heap_allocation_counter = args.bValue; editor->main->infoDisplay.vram_usage = args.bValue; + editor->main->infoDisplay.device_name = args.bValue; editor->main->infoDisplay.colorspace = args.bValue; editor->main->infoDisplay.resolution = args.bValue; editor->main->infoDisplay.logical_size = args.bValue; diff --git a/WickedEngine/wiApplication.cpp b/WickedEngine/wiApplication.cpp index 5f7854c97..64de781ea 100644 --- a/WickedEngine/wiApplication.cpp +++ b/WickedEngine/wiApplication.cpp @@ -329,6 +329,10 @@ namespace wi } infodisplay_str += "\n"; } + if (infoDisplay.device_name) + { + infodisplay_str += "Device: " + graphicsDevice->GetDeviceName() + "\n"; + } if (infoDisplay.resolution) { infodisplay_str += "Resolution: " + std::to_string(canvas.GetPhysicalWidth()) + " x " + std::to_string(canvas.GetPhysicalHeight()) + " (" + std::to_string(int(canvas.GetDPI())) + " dpi)\n"; diff --git a/WickedEngine/wiApplication.h b/WickedEngine/wiApplication.h index b4a276b27..656f92b6b 100644 --- a/WickedEngine/wiApplication.h +++ b/WickedEngine/wiApplication.h @@ -99,6 +99,8 @@ namespace wi bool watermark = true; // display framerate bool fpsinfo = false; + // display graphics device name + bool device_name = false; // display resolution info bool resolution = false; // window's size in logical (DPI scaled) units diff --git a/WickedEngine/wiGraphicsDevice.h b/WickedEngine/wiGraphicsDevice.h index 225b06956..c6d64d89e 100644 --- a/WickedEngine/wiGraphicsDevice.h +++ b/WickedEngine/wiGraphicsDevice.h @@ -56,6 +56,7 @@ namespace wi::graphics size_t TOPLEVEL_ACCELERATION_STRUCTURE_INSTANCE_SIZE = 0; uint32_t VARIABLE_RATE_SHADING_TILE_SIZE = 0; uint64_t TIMESTAMP_FREQUENCY = 0; + std::string deviceName; public: virtual ~GraphicsDevice() = default; @@ -121,6 +122,7 @@ namespace wi::graphics constexpr size_t GetTopLevelAccelerationStructureInstanceSize() const { return TOPLEVEL_ACCELERATION_STRUCTURE_INSTANCE_SIZE; } constexpr uint32_t GetVariableRateShadingTileSize() const { return VARIABLE_RATE_SHADING_TILE_SIZE; } constexpr uint64_t GetTimestampFrequency() const { return TIMESTAMP_FREQUENCY; } + constexpr const std::string& GetDeviceName() const { return deviceName; } // Get the shader binary format that the underlying graphics API consumes virtual ShaderFormat GetShaderFormat() const = 0; diff --git a/WickedEngine/wiGraphicsDevice_DX12.cpp b/WickedEngine/wiGraphicsDevice_DX12.cpp index 9a5c9f6ed..e1ef65300 100644 --- a/WickedEngine/wiGraphicsDevice_DX12.cpp +++ b/WickedEngine/wiGraphicsDevice_DX12.cpp @@ -2330,6 +2330,7 @@ using namespace dx12_internal; { if (SUCCEEDED(D3D12CreateDevice(dxgiAdapter.Get(), featurelevel, IID_PPV_ARGS(&device)))) { + wi::helper::StringConvert(adapterDesc.Description, deviceName); break; } } diff --git a/WickedEngine/wiGraphicsDevice_Vulkan.cpp b/WickedEngine/wiGraphicsDevice_Vulkan.cpp index 8224be9e6..882f44e87 100644 --- a/WickedEngine/wiGraphicsDevice_Vulkan.cpp +++ b/WickedEngine/wiGraphicsDevice_Vulkan.cpp @@ -2568,6 +2568,7 @@ using namespace vulkan_internal; physicalDevice = dev; if (discrete) { + deviceName = properties2.properties.deviceName; break; // if this is discrete GPU, look no further (prioritize discrete GPU) } }