Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
GameWin221 committed Jun 15, 2022
2 parents 682df58 + d58870e commit 41b053d
Show file tree
Hide file tree
Showing 38 changed files with 1,065 additions and 954 deletions.
2 changes: 2 additions & 0 deletions EruptionEngine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#define MAX_SPOT_LIGHTS 118
#define MAX_DIR_LIGHTS 20

#define FRAMES_IN_FLIGHT 2

#define MIPMAP_BIAS 0.0f

#define ANISOTROPIC_FILTERING 8
4 changes: 4 additions & 0 deletions EruptionEngine.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Source\Renderer\Image.cpp" />
<ClCompile Include="Source\Editor\UIPanels\SettingsPanel.cpp" />
<ClCompile Include="Source\Editor\UIPanels\InspectorPanel.cpp" />
<ClCompile Include="Source\Editor\UIPanels\SceneHierarchyPanel.cpp" />
Expand Down Expand Up @@ -255,8 +256,10 @@
<ClCompile Include="Source\Input\InputManager.cpp" />
<ClCompile Include="Source\Renderer\RendererBackend.cpp" />
<ClCompile Include="Source\Editor\EditorLayer.cpp" />
<ClCompile Include="Source\Renderer\Swapchain.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Source\Renderer\Image.hpp" />
<ClInclude Include="Source\Assets\Asset.hpp" />
<ClInclude Include="Source\Editor\UIPanels\SettingsPanel.hpp" />
<ClInclude Include="Source\Renderer\Lights\DirectionalLight.hpp" />
Expand Down Expand Up @@ -304,6 +307,7 @@
<ClInclude Include="Source\Input\InputManager.hpp" />
<ClInclude Include="Source\Editor\EditorLayer.hpp" />
<ClInclude Include="Source\Renderer\Lights\Spotlight.hpp" />
<ClInclude Include="Source\Renderer\Swapchain.hpp" />
</ItemGroup>
<ItemGroup>
<None Include="EruptionEngine.ini" />
Expand Down
12 changes: 12 additions & 0 deletions EruptionEngine.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@
<ClCompile Include="Source\Editor\UIPanels\SettingsPanel.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Source\Renderer\Image.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Source\Renderer\Swapchain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Include\EnPch.hpp">
Expand Down Expand Up @@ -281,6 +287,12 @@
<ClInclude Include="Source\Assets\Asset.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Source\Renderer\Image.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Source\Renderer\Swapchain.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="EruptionEngine.ini" />
Expand Down
8 changes: 4 additions & 4 deletions External/CL/ColorfulLogging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace cl
#endif

// A map of running benchmarks
std::map<std::string, std::chrono::system_clock::time_point> benchmarks;
std::map<std::string, std::chrono::high_resolution_clock::time_point> benchmarks;


// Returns current system time
Expand Down Expand Up @@ -61,7 +61,7 @@ namespace cl
{
if (benchmarks.count(bechmarkName) == 0)
{
benchmarks[bechmarkName] = std::chrono::system_clock::now();
benchmarks[bechmarkName] = std::chrono::high_resolution_clock::now();
}

#ifdef DEBUG_MODE
Expand All @@ -75,7 +75,7 @@ namespace cl
{
if (benchmarks.count(bechmarkName) != 0)
{
auto now = std::chrono::system_clock::now();
auto now = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> diff = now - benchmarks[bechmarkName];
return diff.count();
}
Expand All @@ -94,7 +94,7 @@ namespace cl
if (benchmarks.count(bechmarkName) != 0)
{
double time = BenchmarkGetTime(bechmarkName);
benchmarks[bechmarkName] = std::chrono::system_clock::now();
benchmarks[bechmarkName] = std::chrono::high_resolution_clock::now();
return time;
}
else
Expand Down
11 changes: 0 additions & 11 deletions Shaders/Move.frag

This file was deleted.

Binary file removed Shaders/Move.spv
Binary file not shown.
1 change: 0 additions & 1 deletion Shaders/compile.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
%VULKAN_SDK%/Bin/glslc.exe %~dp0\DepthFragment.frag -o %~dp0\DepthFragment.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\DepthVertex.vert -o %~dp0\DepthVertex.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\FXAA.frag -o %~dp0\FXAA.spv
%VULKAN_SDK%/Bin/glslc.exe %~dp0\Move.frag -o %~dp0\Move.spv

pause
2 changes: 1 addition & 1 deletion Source/Assets/AssetManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ namespace en

void AssetManager::UpdateMaterials()
{
for (auto& material : m_Materials)
for (const auto& material : m_Materials)
material.second->UpdateDescriptorSet();
}

Expand Down
25 changes: 20 additions & 5 deletions Source/Assets/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@ namespace en

VkDescriptorImageInfo albedoImageInfo{};
albedoImageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
albedoImageInfo.imageView = m_Albedo->m_ImageView;
albedoImageInfo.imageView = m_Albedo->m_Image->m_ImageView;
albedoImageInfo.sampler = m_Albedo->m_ImageSampler;

VkDescriptorImageInfo specularImageInfo{};
specularImageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
specularImageInfo.imageView = m_Roughness->m_ImageView;
specularImageInfo.imageView = m_Roughness->m_Image->m_ImageView;
specularImageInfo.sampler = m_Roughness->m_ImageSampler;

VkDescriptorImageInfo normalImageInfo{};
normalImageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
normalImageInfo.imageView = m_Normal->m_ImageView;
normalImageInfo.imageView = m_Normal->m_Image->m_ImageView;
normalImageInfo.sampler = m_Normal->m_ImageSampler;

VkDescriptorImageInfo metalnessImageInfo{};
metalnessImageInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
metalnessImageInfo.imageView = m_Metalness->m_ImageView;
metalnessImageInfo.imageView = m_Metalness->m_Image->m_ImageView;
metalnessImageInfo.sampler = m_Metalness->m_ImageSampler;

std::array<VkWriteDescriptorSet, 4> descriptorWrites{};
Expand Down Expand Up @@ -196,10 +196,25 @@ namespace en
metalnessLayoutBinding
};

std::array<VkDescriptorBindingFlags, 4> flags =
{
VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT,
VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT,
VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT,
VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT
};

VkDescriptorSetLayoutBindingFlagsCreateInfo flagsCreateInfo{};
flagsCreateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO;
flagsCreateInfo.bindingCount = static_cast<uint32_t>(bindings.size());
flagsCreateInfo.pBindingFlags = flags.data();

VkDescriptorSetLayoutCreateInfo layoutInfo{};
layoutInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
layoutInfo.bindingCount = static_cast<uint32_t>(bindings.size());
layoutInfo.pBindings = bindings.data();
layoutInfo.pNext = &flagsCreateInfo;


if (vkCreateDescriptorSetLayout(ctx.m_LogicalDevice, &layoutInfo, nullptr, &g_MatDescriptorSetLayout) != VK_SUCCESS)
EN_ERROR("Material.cpp::CreateMatDescriptorPool() - Failed to create descriptor set layout!");
Expand All @@ -219,7 +234,7 @@ namespace en
poolInfo.poolSizeCount = static_cast<uint32_t>(poolSizes.size());
poolInfo.pPoolSizes = poolSizes.data();
poolInfo.maxSets = static_cast<uint32_t>(MAX_MATERIALS);
poolInfo.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
poolInfo.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT | VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT;

if (vkCreateDescriptorPool(ctx.m_LogicalDevice, &poolInfo, nullptr, &g_MatDescriptorPool) != VK_SUCCESS)
EN_ERROR("Material.cpp::CreateMatDescriptorPool() - Failed to create descriptor pool!");
Expand Down
Loading

0 comments on commit 41b053d

Please sign in to comment.