Skip to content

Commit

Permalink
Merge pull request #131 from jmorton06/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jmorton06 authored Dec 29, 2023
2 parents 648688c + 4284ddf commit 80f1e57
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 16 deletions.
15 changes: 14 additions & 1 deletion Editor/Source/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,20 @@ namespace Lumos
if(ImGui::MenuItem(fmt::format("Cereal - Version : {0}.{1}.{2}", CEREAL_VERSION_MAJOR, CEREAL_VERSION_MINOR, CEREAL_VERSION_PATCH).c_str()))
Lumos::OS::Instance()->OpenURL("https://github.com/USCiLab/cereal");

ImGui::EndMenu();
if(ImGui::BeginMenu("Contributers"))
{
if(ImGui::MenuItem("Joe Morton"))
Lumos::OS::Instance()->OpenURL("https://github.com/jmorton06");

if(ImGui::MenuItem("RuanLucasGD"))
Lumos::OS::Instance()->OpenURL("https://github.com/RuanLucasGD");

if(ImGui::MenuItem("adriengivry"))
Lumos::OS::Instance()->OpenURL("https://github.com/adriengivry");

ImGui::EndMenu(); //Contributer Menu
}
ImGui::EndMenu(); // About Menu
}

if(m_ProjectLoaded)
Expand Down
2 changes: 1 addition & 1 deletion Editor/Source/ResourcePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ namespace Lumos
const float SmallOffsetX = 6.0f * Application::Get().GetWindowDPI();
ImDrawList* drawList = ImGui::GetWindowDrawList();

if(Input::Get().GetKeyHeld(InputCode::Key::LeftControl))
if(ImGui::IsWindowFocused() && Input::Get().GetKeyHeld(InputCode::Key::LeftControl))
{
float mouseScroll = Input::Get().GetScrollOffset();

Expand Down
6 changes: 4 additions & 2 deletions Lumos/Source/Lumos/Graphics/Renderers/RenderPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,7 @@ namespace Lumos::Graphics
LUMOS_PROFILE_FUNCTION();
float result = 0.0f;
bool found = false;

for(uint32_t i = 0; i < m_Renderer2DData.m_TextureCount; i++)
{
if(m_Renderer2DData.m_Textures[i] == texture)
Expand All @@ -2447,6 +2448,7 @@ namespace Lumos::Graphics
if(m_Renderer2DData.m_TextureCount >= m_Renderer2DData.m_Limits.MaxTextures)
{
Render2DFlush();
Renderer2DBeginBatch();
}
m_Renderer2DData.m_Textures[m_Renderer2DData.m_TextureCount] = texture;
m_Renderer2DData.m_TextureCount++;
Expand Down Expand Up @@ -2618,9 +2620,9 @@ namespace Lumos::Graphics
m_Renderer2DData.m_Pipeline->End(commandBuffer);

m_Renderer2DData.m_BatchDrawCallIndex++;

/*m_Renderer2DData.m_IndexCount = 0;
m_Renderer2DData.m_TextureCount = 0;
/*m_Renderer2DData.m_IndexCount = 0;
if((int)m_Renderer2DData.m_VertexBuffers[currentFrame].size() - 1 < (int)m_Renderer2DData.m_BatchDrawCallIndex)
{
Expand Down
2 changes: 1 addition & 1 deletion Lumos/Source/Lumos/Graphics/Renderers/RenderPasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ namespace Lumos
const glm::mat4* m_TransformationBack {};

Texture* m_Textures[MAX_BOUND_TEXTURES];
uint32_t m_TextureCount;
uint32_t m_TextureCount = 0;

uint32_t m_CurrentBufferID = 0;
glm::vec3 m_QuadPositions[4];
Expand Down
10 changes: 5 additions & 5 deletions Lumos/Source/Lumos/Platform/Vulkan/VKDescriptorSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ namespace Lumos

const uint32_t descriptorCount = (uint32_t)m_Descriptors.descriptors.size();
ArenaTemp scratch = ScratchBegin(nullptr, 0);
VkDescriptorBufferInfo* bufferInfos = PushArrayNoZero(scratch.arena, VkDescriptorBufferInfo, descriptorCount);
VkDescriptorImageInfo* imageInfos = PushArrayNoZero(scratch.arena, VkDescriptorImageInfo, descriptorCount);
VkWriteDescriptorSet* writeDescriptorSets = PushArrayNoZero(scratch.arena, VkWriteDescriptorSet, descriptorCount);
VkDescriptorBufferInfo* bufferInfos = PushArrayNoZero(scratch.arena, VkDescriptorBufferInfo, 32);
VkDescriptorImageInfo* imageInfos = PushArrayNoZero(scratch.arena, VkDescriptorImageInfo, 32);
VkWriteDescriptorSet* writeDescriptorSets = PushArrayNoZero(scratch.arena, VkWriteDescriptorSet, 32);

for(auto& imageInfo : m_Descriptors.descriptors)
{
Expand All @@ -166,7 +166,7 @@ namespace Lumos
imageInfos[imageIndex].imageLayout = des.imageLayout;
imageInfos[imageIndex].imageView = des.imageView;
imageInfos[imageIndex].sampler = des.sampler;
}
}
}
else
{
Expand All @@ -176,7 +176,7 @@ namespace Lumos
{
TransitionImageToCorrectLayout(imageInfo.textures[i], cmdBuffer);

VkDescriptorImageInfo& des = *static_cast<VkDescriptorImageInfo*>(imageInfo.textures[i]->GetDescriptorInfo());
VkDescriptorImageInfo& des = *static_cast<VkDescriptorImageInfo*>(imageInfo.textures[i]->GetDescriptorInfo());
imageInfos[i + imageIndex].imageLayout = des.imageLayout;
imageInfos[i + imageIndex].imageView = des.imageView;
imageInfos[i + imageIndex].sampler = des.sampler;
Expand Down
2 changes: 1 addition & 1 deletion Lumos/Source/Lumos/Platform/Vulkan/VKTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ namespace Lumos
m_VKFormat = VKUtilities::FormatToVK(m_Format);

#ifdef LUMOS_PLATFORM_MACOS
VkImageUsageFlags usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
VkImageUsageFlags usage = VkImageUsageFlags(0);

#else
VkImageUsageFlags usage = VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,27 @@ make -j8 # config=release
Run Scripts/GenerateVS.bat to generate a visual studio project.
```
cd Lumos
msbuild /p:Platform=x64 /p:Configuration=Release build/Lumos.sln
msbuild /p:Platform=x64 /p:Configuration=Release Lumos.sln
```
#### Mac
```
cd Lumos
Tools/premake5 xcode4
xcodebuild -project build/Runtime.xcodeproj
xcodebuild -project Runtime.xcodeproj
```

M1 Macs may need :
M1/M2/M3 Macs may need :
```
cd Lumos
Tools/premake5 xcode4 --arch=arm64 --os=macosx
xcodebuild -project build/Runtime.xcodeproj
xcodebuild -project Runtime.xcodeproj
```

#### iOS
```
cd Lumos
Tools/premake5 xcode4 --os=ios
xcodebuild -project build/Runtime.xcodeproj CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
xcodebuild -project Runtime.xcodeproj CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
```

To run on apple devices with Vulkan ( MoltenVK ), disable Metal API Validation here : Product > Scheme > Edit Scheme… > Run > Options > Metal API Validation
Expand Down

0 comments on commit 80f1e57

Please sign in to comment.