From 559cda92f1660678eef5a98f8729dd9df4697032 Mon Sep 17 00:00:00 2001 From: Sri Sham Haran Date: Mon, 30 Jan 2023 18:27:29 +0800 Subject: [PATCH 1/7] Delete Editor.SHConfig --- Assets/Editor/Editor.SHConfig | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 Assets/Editor/Editor.SHConfig diff --git a/Assets/Editor/Editor.SHConfig b/Assets/Editor/Editor.SHConfig deleted file mode 100644 index 51425027..00000000 --- a/Assets/Editor/Editor.SHConfig +++ /dev/null @@ -1,4 +0,0 @@ -Start Maximized: true -Working Scene ID: 97161771 -Window Size: {x: 1920, y: 1080} -Style: 0 \ No newline at end of file From f2b8e526086ed690da7086e00421a44d548ce925 Mon Sep 17 00:00:00 2001 From: Xiao Qi Date: Mon, 30 Jan 2023 18:28:49 +0800 Subject: [PATCH 2/7] Commented unused shader build lines --- .../src/Assets/Asset Types/Models/SHMeshAsset.h | 2 +- .../MiddleEnd/Interface/SHGraphicsSystem.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SHADE_Engine/src/Assets/Asset Types/Models/SHMeshAsset.h b/SHADE_Engine/src/Assets/Asset Types/Models/SHMeshAsset.h index 18272d02..14744c4d 100644 --- a/SHADE_Engine/src/Assets/Asset Types/Models/SHMeshAsset.h +++ b/SHADE_Engine/src/Assets/Asset Types/Models/SHMeshAsset.h @@ -58,6 +58,6 @@ namespace SHADE std::vector Indices; std::vector VertexBoneIndices; std::vector VertexBoneWeights; - uint32_t BoneCount; + uint32_t BoneCount; }; } diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index b10ca123..ec26837e 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -127,12 +127,12 @@ namespace SHADE SHFreetypeInstance::Init(); - SHAssetManager::CompileAsset("../../Assets/Shaders/DeferredComposite_CS.glsl", false); - SHAssetManager::CompileAsset("../../Assets/Shaders/SSAO_CS.glsl", false); - SHAssetManager::CompileAsset("../../Assets/Shaders/SSAOBlur_CS.glsl", false); - SHAssetManager::CompileAsset("../../Assets/Shaders/PureCopy_CS.glsl", false); - SHAssetManager::CompileAsset("../../Assets/Shaders/TestCube_VS.glsl", false); - SHAssetManager::CompileAsset("../../Assets/Shaders/TestCube_FS.glsl", false); + //SHAssetManager::CompileAsset("../../Assets/Shaders/DeferredComposite_CS.glsl", false); + //SHAssetManager::CompileAsset("../../Assets/Shaders/SSAO_CS.glsl", false); + //SHAssetManager::CompileAsset("../../Assets/Shaders/SSAOBlur_CS.glsl", false); + //SHAssetManager::CompileAsset("../../Assets/Shaders/PureCopy_CS.glsl", false); + //SHAssetManager::CompileAsset("../../Assets/Shaders/TestCube_VS.glsl", false); + //SHAssetManager::CompileAsset("../../Assets/Shaders/TestCube_FS.glsl", false); // Load Built In Shaders static constexpr AssetID VS_DEFAULT = 39210065; defaultVertShader = SHResourceManager::LoadOrGet(VS_DEFAULT); From c13f06e4a60c0ef38d4dae6a12e252d12b5718e0 Mon Sep 17 00:00:00 2001 From: Xiao Qi Date: Mon, 30 Jan 2023 19:55:42 +0800 Subject: [PATCH 3/7] Added warning line to check for existing path --- SHADE_Engine/src/Filesystem/SHFileSystem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SHADE_Engine/src/Filesystem/SHFileSystem.cpp b/SHADE_Engine/src/Filesystem/SHFileSystem.cpp index a28f70ca..cbcbd45b 100644 --- a/SHADE_Engine/src/Filesystem/SHFileSystem.cpp +++ b/SHADE_Engine/src/Filesystem/SHFileSystem.cpp @@ -105,6 +105,12 @@ namespace SHADE std::vector assets; // Get all subfolders/files in this current folder + if (!std::filesystem::exists(std::filesystem::path(folder->path))) + { + SHLOG_WARNING("[Asset Manager] Path to build directory does not exist!: {}", folder->path); + continue; + } + for (auto& dirEntry : std::filesystem::directory_iterator(folder->path)) { auto path = dirEntry.path(); From 38f2ba69db8320a7ba3505fb3438cac63be82fef Mon Sep 17 00:00:00 2001 From: mushgunAX Date: Tue, 31 Jan 2023 12:43:02 +0800 Subject: [PATCH 4/7] Force use of Dedicated GPU --- Assets/Editor/Editor.SHConfig | 2 +- .../src/Graphics/Devices/SHVkPhysicalDevice.h | 1 + .../Devices/SHVkPhysicalDeviceLibrary.cpp | 26 +++++++++++++++++-- .../Devices/SHVkPhysicalDeviceLibrary.h | 1 + .../src/Graphics/Instance/SHVkInstance.cpp | 2 ++ .../MiddleEnd/Interface/SHGraphicsSystem.cpp | 2 +- 6 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Assets/Editor/Editor.SHConfig b/Assets/Editor/Editor.SHConfig index b492a983..c56772c9 100644 --- a/Assets/Editor/Editor.SHConfig +++ b/Assets/Editor/Editor.SHConfig @@ -1,4 +1,4 @@ Start Maximized: true Working Scene ID: 97402985 -Window Size: {x: 1920, y: 1080} +Window Size: {x: 1920, y: 1013} Style: 0 \ No newline at end of file diff --git a/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDevice.h b/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDevice.h index a273da74..e2533106 100644 --- a/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDevice.h +++ b/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDevice.h @@ -10,6 +10,7 @@ namespace SHADE enum class SH_PHYSICAL_DEVICE_TYPE { BEST, + DEDICATED, }; class SHVkPhysicalDevice diff --git a/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDeviceLibrary.cpp b/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDeviceLibrary.cpp index 050ca769..ebda72c8 100644 --- a/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDeviceLibrary.cpp +++ b/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDeviceLibrary.cpp @@ -160,9 +160,31 @@ namespace SHADE } } + return bestDevice; } + vk::PhysicalDevice SHVkPhysicalDeviceLibrary::GetFirstDedicatedDevice(uint32_t apiVersion /*= SHVulkanAPIVersion::V_1_2*/) + { + if (!queried || physicalDevices.empty()) + return nullptr; + + for (auto const& device : physicalDevices) + { + // Check for API version and device type. Ignore if queried device doesn't support version passed in + if (device.getProperties().apiVersion < static_cast(apiVersion)) + continue; + + //VkDeviceSize biggestDeviceHeapSize = device.getMemoryProperties().; + if (device.getProperties().deviceType == vk::PhysicalDeviceType::eDiscreteGpu) + return device; + + } + + + return nullptr; + } + /***************************************************************************/ /*! @@ -181,10 +203,10 @@ namespace SHADE } #ifdef DEBUG - SHLOG_TRACE("Successfully queried Physical Devices:"); + SHLOG_INFO("Successfully queried Physical Devices:"); for (auto const& device : physicalDevices) { - SHLOG_TRACE(std::string_view (std::string("\t-") + GetDeviceTypeName(device.getProperties().deviceType) + device.getProperties().deviceName.operator std::string())); + SHLOG_INFO(std::string_view (std::string("\t-") + GetDeviceTypeName(device.getProperties().deviceType) + device.getProperties().deviceName.operator std::string())); } #endif diff --git a/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDeviceLibrary.h b/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDeviceLibrary.h index 79516987..4def81fa 100644 --- a/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDeviceLibrary.h +++ b/SHADE_Engine/src/Graphics/Devices/SHVkPhysicalDeviceLibrary.h @@ -26,6 +26,7 @@ namespace SHADE static void QueryPhysicalDevices(bool printInfo) noexcept; //static std::vector> GetDevicesByType(VkPhysicalDeviceType gpuType, SHVulkanAPIVersion apiVersion = SHVulkanAPIVersion::V_1_2) noexcept; static vk::PhysicalDevice GetBestDevice(uint32_t apiVersion = VK_API_VERSION_1_3); + static vk::PhysicalDevice GetFirstDedicatedDevice(uint32_t apiVersion = VK_API_VERSION_1_3); }; } diff --git a/SHADE_Engine/src/Graphics/Instance/SHVkInstance.cpp b/SHADE_Engine/src/Graphics/Instance/SHVkInstance.cpp index 237c6fee..067645ff 100644 --- a/SHADE_Engine/src/Graphics/Instance/SHVkInstance.cpp +++ b/SHADE_Engine/src/Graphics/Instance/SHVkInstance.cpp @@ -213,6 +213,8 @@ namespace SHADE { case SH_PHYSICAL_DEVICE_TYPE::BEST: return resourceManager.Create(SHVkPhysicalDeviceLibrary::GetBestDevice()); + case SH_PHYSICAL_DEVICE_TYPE::DEDICATED: + return resourceManager.Create(SHVkPhysicalDeviceLibrary::GetFirstDedicatedDevice()); default: return resourceManager.Create(SHVkPhysicalDeviceLibrary::GetBestDevice()); } diff --git a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp index c4990153..ca5841c1 100644 --- a/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp +++ b/SHADE_Engine/src/Graphics/MiddleEnd/Interface/SHGraphicsSystem.cpp @@ -65,7 +65,7 @@ namespace SHADE #endif // Get Physical Device - physicalDevice = SHVkInstance::CreatePhysicalDevice(SH_PHYSICAL_DEVICE_TYPE::BEST); + physicalDevice = SHVkInstance::CreatePhysicalDevice(SH_PHYSICAL_DEVICE_TYPE::DEDICATED); if (!physicalDevice->GetVkPhysicalDevice()) { throw std::runtime_error("[Graphics System] No supported Vulkan 1.3 compatible GPU was detected!"); From 164b4f719735c80a5029149b90447e8aa5c22d1f Mon Sep 17 00:00:00 2001 From: Xiao Qi Date: Tue, 31 Jan 2023 17:38:48 +0800 Subject: [PATCH 5/7] Changed gitignore line to ignore all items in Editor Folder --- .gitignore | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 06ae45fd..e595ab73 100644 --- a/.gitignore +++ b/.gitignore @@ -363,8 +363,6 @@ MigrationBackup/ *.filters -Assets/Editor/Layouts/UserLayout.ini - JSON/Schemas/Catalog/ -Assets/Editor/Editor.SHConfig +Assets/Editor/ From e0f363f1ec9f051831bfac2ae0a583aee3f0c3f0 Mon Sep 17 00:00:00 2001 From: Xiao Qi Date: Tue, 31 Jan 2023 17:47:36 +0800 Subject: [PATCH 6/7] Changed line to only ignore editor config --- .gitignore | 2 +- Assets/Editor/Layouts/UserLayout.ini | 165 +++++++++++++++++++++++++++ 2 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 Assets/Editor/Layouts/UserLayout.ini diff --git a/.gitignore b/.gitignore index e595ab73..1771ebb0 100644 --- a/.gitignore +++ b/.gitignore @@ -365,4 +365,4 @@ MigrationBackup/ JSON/Schemas/Catalog/ -Assets/Editor/ +Assets/Editor/Editor.SHConfig diff --git a/Assets/Editor/Layouts/UserLayout.ini b/Assets/Editor/Layouts/UserLayout.ini new file mode 100644 index 00000000..7c2df9e0 --- /dev/null +++ b/Assets/Editor/Layouts/UserLayout.ini @@ -0,0 +1,165 @@ +[Window][MainStatusBar] +Pos=0,989 +Size=1920,20 +Collapsed=0 + +[Window][SHEditorMenuBar] +Pos=0,48 +Size=1920,941 +Collapsed=0 + +[Window][Hierarchy Panel] +Pos=0,187 +Size=300,802 +Collapsed=0 +DockId=0x00000004,0 + +[Window][Debug##Default] +Pos=60,60 +Size=400,400 +Collapsed=0 + +[Window][Inspector] +Pos=1604,48 +Size=316,941 +Collapsed=0 +DockId=0x00000006,0 + +[Window][Profiler] +Pos=0,48 +Size=300,137 +Collapsed=0 +DockId=0x00000003,0 + +[Window][Viewport] +Pos=227,48 +Size=1457,1012 +Collapsed=0 +DockId=0x0000000B,0 + +[Window][面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面o] +Pos=60,60 +Size=32,64 +Collapsed=0 + +[Window][面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面面] +Pos=60,60 +Size=999,581 +Collapsed=0 + +[Window][o] +Pos=60,60 +Size=32,64 +Collapsed=0 + +[Window][面面] +Pos=60,60 +Size=553,422 +Collapsed=0 + +[Window][] +Pos=60,60 +Size=770,394 +Collapsed=0 + +[Window][ Viewport] +Pos=227,48 +Size=1457,1012 +Collapsed=0 +DockId=0x0000000B,0 + +[Window][ Viewport] +Pos=227,48 +Size=1457,1012 +Collapsed=0 +DockId=0x0000000B,0 + +[Window][ Viewport] +Pos=302,48 +Size=1300,836 +Collapsed=0 +DockId=0x0000000B,0 + +[Window][V] +Pos=310,722 +Size=1501,338 +Collapsed=0 +DockId=0x00000008,0 + +[Window][p] +Pos=310,750 +Size=1501,310 +Collapsed=0 +DockId=0x0000000A,0 + +[Window][ Asset Browser] +Pos=302,886 +Size=1300,103 +Collapsed=0 +DockId=0x0000000C,0 + +[Window][Material Inspector] +Pos=1604,48 +Size=316,941 +Collapsed=0 +DockId=0x00000006,1 + +[Window][Save scene as...] +Pos=1197,693 +Size=165,120 +Collapsed=0 + +[Window][Create New Asset] +Pos=896,472 +Size=464,144 +Collapsed=0 + +[Window][Collider Tag Panel] +Pos=60,60 +Size=625,744 +Collapsed=0 + +[Window][Input Bindings Panel] +Pos=60,60 +Size=154,204 +Collapsed=0 + +[Window][Save Scene As] +Pos=877,444 +Size=165,120 +Collapsed=0 + +[Table][0x9D40AE32,17] +Column 0 Weight=1.0000 +Column 1 Weight=1.0000 +Column 2 Weight=1.0000 +Column 3 Weight=1.0000 +Column 4 Weight=1.0000 +Column 5 Weight=1.0000 +Column 6 Weight=1.0000 +Column 7 Weight=1.0000 +Column 8 Weight=1.0000 +Column 9 Weight=1.0000 +Column 10 Weight=1.0000 +Column 11 Weight=1.0000 +Column 12 Weight=1.0000 +Column 13 Weight=1.0000 +Column 14 Weight=1.0000 +Column 15 Weight=1.0000 +Column 16 Weight=1.0000 + +[Docking][Data] +DockSpace ID=0xC5C9B8AB Window=0xBE4044E9 Pos=0,71 Size=1920,941 Split=X + DockNode ID=0x00000005 Parent=0xC5C9B8AB SizeRef=1602,1036 Split=X + DockNode ID=0x00000001 Parent=0x00000005 SizeRef=300,1036 Split=Y Selected=0x1E6EB881 + DockNode ID=0x00000003 Parent=0x00000001 SizeRef=225,147 Selected=0x1E6EB881 + DockNode ID=0x00000004 Parent=0x00000001 SizeRef=225,863 Selected=0xE096E5AE + DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1300,1036 Split=Y Selected=0xB41284E7 + DockNode ID=0x00000007 Parent=0x00000002 SizeRef=1501,672 Split=Y Selected=0xB41284E7 + DockNode ID=0x00000009 Parent=0x00000007 SizeRef=1501,700 Split=Y Selected=0xB41284E7 + DockNode ID=0x0000000B Parent=0x00000009 SizeRef=1501,836 CentralNode=1 Selected=0xB41284E7 + DockNode ID=0x0000000C Parent=0x00000009 SizeRef=1501,103 Selected=0xB128252A + DockNode ID=0x0000000A Parent=0x00000007 SizeRef=1501,310 Selected=0xD446F7B6 + DockNode ID=0x00000008 Parent=0x00000002 SizeRef=1501,338 Selected=0xD9F31532 + DockNode ID=0x00000006 Parent=0xC5C9B8AB SizeRef=316,1036 Selected=0xE7039252 + From 8c9673cafd7dd027b65aa28c20730e2c47150ea3 Mon Sep 17 00:00:00 2001 From: Xiao Qi Date: Tue, 31 Jan 2023 17:48:29 +0800 Subject: [PATCH 7/7] Removed editor config from repo --- Assets/Editor/Editor.SHConfig | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 Assets/Editor/Editor.SHConfig diff --git a/Assets/Editor/Editor.SHConfig b/Assets/Editor/Editor.SHConfig deleted file mode 100644 index c56772c9..00000000 --- a/Assets/Editor/Editor.SHConfig +++ /dev/null @@ -1,4 +0,0 @@ -Start Maximized: true -Working Scene ID: 97402985 -Window Size: {x: 1920, y: 1013} -Style: 0 \ No newline at end of file