-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improving vulkan backend and working with new record API for vulkan.
- Loading branch information
Showing
54 changed files
with
2,597 additions
and
549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: ✅ CI | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: "0 12 * * 0" | ||
|
||
jobs: | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
# Breaking change was removing the bit timing sections from hal::can::settings, | ||
# now it is just baud_rate. | ||
name: 🚀 Deploy Version | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: engine3d-dev/ci/.github/workflows/[email protected] | ||
engine3d: | ||
uses: engine3d-dev/ci/.github/workflows/deploy.yml@main | ||
with: | ||
compiler: gcc | ||
version: ${{ github.ref_name }} | ||
# version: ${{ github.ref_name }} | ||
arch: x86_64 | ||
compiler_version: 12.3 | ||
compiler_package: "" | ||
os: Linux | ||
secrets: inherit | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "engine3d/Core/backend/third_party/JolyPhysics"] | ||
path = engine3d/Core/backend/third_party/JolyPhysics | ||
url = https://github.com/engine3d-dev/JoltPhysics | ||
[submodule "engine3d/Core/backend/third_party/imgui"] | ||
path = engine3d/Core/backend/third_party/imgui | ||
url = https://github.com/SpinnerX/imgui | ||
[submodule "engine3d/Core/backend/third_party/ImGuizmo"] | ||
path = engine3d/Core/backend/third_party/ImGuizmo | ||
url = https://github.com/SpinnerX/ImGuizmo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(Editor CXX) | ||
|
||
include_directories( | ||
../ | ||
) | ||
|
||
set( | ||
all_src | ||
Editor/Editor.h | ||
Editor/Editor.cpp | ||
Editor/EngineLayer.cpp | ||
Editor/UILayer.cpp | ||
platforms/main.cpp | ||
platforms/win32.cpp | ||
) | ||
|
||
find_package(spdlog REQUIRED) | ||
find_package(glm REQUIRED) | ||
find_package(yaml-cpp REQUIRED) | ||
find_package(Vulkan REQUIRED) | ||
find_package(imguidocking REQUIRED) | ||
find_package(engine3d REQUIRED) | ||
|
||
add_executable(${PROJECT_NAME} ${all_src}) | ||
|
||
# target_link_libraries(${PROJECT_NAME} engine3d) | ||
target_include_directories(${PROJECT_NAME} PRIVATE ../) | ||
|
||
target_link_libraries( | ||
${PROJECT_NAME} | ||
engine3d | ||
glfw | ||
glm::glm | ||
fmt::fmt | ||
spdlog::spdlog | ||
glm::glm | ||
yaml-cpp::yaml-cpp | ||
box2d::box2d | ||
# joltphysics::joltphysics | ||
Vulkan::Vulkan | ||
imguidocking::imguidocking | ||
engine3d::engine3d | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,71 @@ | ||
#include "Editor.h" | ||
#include "EngineLayer.h" | ||
#include "UILayer.h" | ||
#include <engine3d/Core/Event/InputPoll.h> | ||
#include "engine3d/Core/EngineLogger.h" | ||
#include "engine3d/Core/Renderer/Renderer.h" | ||
#include <engine3d/Core/Timestep.h> | ||
#include <GLFW/glfw3.h> | ||
#include <imgui/imgui.h> | ||
|
||
namespace engine3d{ | ||
|
||
EditorApplication::EditorApplication(){ | ||
InitiateEditor(); | ||
EditorApplication::EditorApplication(const std::string& p_DebugName) : ApplicationInstance(p_DebugName) { | ||
<<<<<<< HEAD | ||
Renderer::Initialize(); | ||
Renderer::SetBackgroundColor({1.0f, 0.0f, 0.0f, 0.0f}); | ||
} | ||
|
||
EditorApplication::~EditorApplication(){ | ||
ShutdownEditor(); | ||
} | ||
EditorApplication::~EditorApplication() {} | ||
|
||
void EditorApplication::InitiateEditor(){ | ||
//! @note Initially we will have our actual rendering and everything engine-related in EngineLayer | ||
//! @note UILayer is where all of the UI-related stuff are done. | ||
//! @note UILayer for right now is used for initiating any imgui related configurations. | ||
m_Layers[0] = new EngineLayer(); | ||
m_Layers[0]->OnAttach(); | ||
m_Layers[1] = new UILayer(); | ||
m_Layers[1]->OnAttach(); | ||
void EditorApplication::UpdateThisApplicationInstance(){ | ||
|
||
Renderer::Initialize(); | ||
|
||
//! @note Setting our color to being light blue | ||
Renderer::SetBackgroundColor({0.0f, 0.5f, 0.5f, 0.f}); | ||
// Renderer::SetBackgroundColor({1.0f, 0.0f, 0.0f, 1.0f}); | ||
|
||
// m_CmdBuffer = vk::VulkanCommandBuffer(vk::VulkanSwapchain::GetImagesSize()); | ||
// m_CmdBuffer.RecordCommandBuffers(); | ||
|
||
//! @param index, zero - indicates getting first data in queue at index 0 (zero) | ||
//! @note TODO -- for cmd buffers/queues, shader modules, and render passes. Figuring out what parameters are important that users should specify when creating this instance | ||
//! @note This is because as it stands the API requires for instancing the object before initializing it, but should just utilize the constructor to cleanup the API for initiating our object's lifetimes. | ||
// m_CmdQueue = vk::VulkanCommandQueue(0); | ||
// m_RenderPass.InitializeRenderPass(); | ||
// m_RenderPass.InitializeFramebuffers(); | ||
// m_TriangleShaderVertModule = vk::VulkanShaderModule("Resources/shaders/TriangleShader/triangle.vert.spirv"); | ||
// m_TriangleShaderFragModule = vk::VulkanShaderModule("Resources/shaders/TriangleShader/triangle.frag.spirv"); | ||
// engine3d::UILayer::InitializeUI(m_CmdQueue.GetVkQueueInstance()); | ||
|
||
// m_ShaderPipeline = vk::VulkanShaderCompiler(m_TriangleShaderVertModule.GetVkShaderModuleInstance(), m_TriangleShaderFragModule.GetVkShaderModuleInstance(), m_RenderPass.GetRenderPassInstnace()); | ||
|
||
//! @note Just testing to see if application still closes cleanly. | ||
// if(InputPoll::IsKeyPressed(ENGINE_KEY_ESCAPE)){ | ||
// exit(0); | ||
// } | ||
|
||
//! @note This function will render our primitives | ||
//! @note TODO -- Flush should only happens when our scene is given everything that lives within this scene (ref to lifetimes) | ||
/* Renderer::FlushScene(); */ | ||
|
||
Renderer::Presentation(); | ||
// ImGui::Begin("Hello, world!"); // Create a window called "Hello, world!" and append into it. | ||
// ImGui::End(); | ||
} | ||
|
||
void EditorApplication::ShutdownEditor(){ | ||
// m_Pipeline.CleanupPipeline(); | ||
// m_VulkDevice.CleanupDevice(); | ||
ApplicationInstance* InitializeApplication(){ | ||
return new EditorApplication(); | ||
} | ||
|
||
void EditorApplication::RunEditor(){ | ||
======= | ||
/* Renderer::Initialize(); */ | ||
/* Renderer::SetBackgroundColor({0.0f, 0.5f, 0.5f, 0.f}); */ | ||
Renderer::SetBackgroundColor({1.0f, 0.0f, 0.0f, 0.0f}); | ||
|
||
while(!glfwWindowShouldClose(vk::VulkanPipeline::GetCurrentWindow())){ | ||
m_LastFrameTime = (float)glfwGetTime(); | ||
Timerstep ts = m_LastFrameTime; | ||
ConsoleLogInfo("Initializing Current Application Name === {}!!!", ApplicationInstance::CurrentApplicationName()); | ||
} | ||
|
||
for(const auto& layer : m_Layers){ | ||
layer->OnUpdate(ts); | ||
} | ||
EditorApplication::~EditorApplication() {} | ||
|
||
// Clearing screen | ||
// uint32_t idx = m_CmdQueue.AcquireNextImage(); | ||
// m_CmdQueue.WaitIdleFence(); | ||
// m_CmdQueue.SubmitAsync(m_CmdBuffer[idx]); | ||
// // m_CmdQueue.WaitIdle(); | ||
// m_CmdQueue.WaitIdleFence(); | ||
// m_CmdQueue.Presentation(idx); | ||
Renderer::FlushScene(); | ||
void EditorApplication::UpdateThisApplicationInstance(){ | ||
|
||
//! @note Just testing to see if application still closes cleanly. | ||
// if(InputPoll::IsKeyPressed(ENGINE_KEY_ESCAPE)){ | ||
// exit(0); | ||
// } | ||
|
||
//! @note This function will render our primitives | ||
//! @note TODO -- Flush should only happens when our scene is given everything that lives within this scene (ref to lifetimes) | ||
/* Renderer::FlushScene(); */ | ||
|
||
Renderer::Presentation(); | ||
// ImGui::Begin("Hello, world!"); // Create a window called "Hello, world!" and append into it. | ||
// ImGui::End(); | ||
} | ||
|
||
// m_RenderPass.BeginPass(idx, m_CmdBuffer[idx], VK_SUBPASS_CONTENTS_INLINE, m_ShaderPipeline.GetShaderPipeline()); | ||
// vkCmdBindPipeline(m_CmdBuffer[idx], VK_PIPELINE_BIND_POINT_GRAPHICS, m_ShaderPipeline.GetShaderPipeline()); | ||
// vkCmdDraw(m_CmdBuffer[idx], 3, 1, 0, 0); | ||
// m_RenderPass.EndPass(m_CmdBuffer[idx]); | ||
ApplicationInstance* InitializeApplication(){ | ||
return new EditorApplication(); | ||
} | ||
|
||
for(const auto& layer : m_Layers){ | ||
layer->OnUIRender(); | ||
} | ||
>>>>>>> fa59aaf07c9cbf80f5d25918c4d43b3cca25238f | ||
|
||
glfwPollEvents(); | ||
} | ||
} | ||
|
||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,23 @@ | ||
#pragma once | ||
#include <engine3d/Core/EngineLogger.h> | ||
#include <engine3d/Core/BaseApplication.h> | ||
#include <engine3d/Core/backend/Vulkan/Vulkan.h> | ||
#include <engine3d/Core/backend/Vulkan/VulkanDevice.h> | ||
#include <engine3d/Core/backend/Vulkan/VulkanSwapchain.h> | ||
#include <engine3d/Core/backend/Vulkan/VulkanCommandBuffer.h> | ||
#include <engine3d/Core/backend/Vulkan/VulkanCommandQueue.h> | ||
#include <engine3d/Core/Layer.h> | ||
#include <array> | ||
#include <engine3d/Core/ApplicationInstance.h> | ||
|
||
namespace engine3d{ | ||
|
||
//! @note Our actual editor application | ||
class EditorApplication{ | ||
//! @note TODO -- Having a cenrtal application that will be used across both editor and the game(being developed) | ||
//! @note So when they're packaged, they can be shipped under one application excluding editor stuff and only things relevant to the game. | ||
class EditorApplication : public ApplicationInstance{ | ||
public: | ||
EditorApplication(); | ||
~EditorApplication(); | ||
|
||
void RunEditor(); | ||
EditorApplication(const std::string& debugName = "Engine3D Editor"); | ||
virtual ~EditorApplication(); | ||
private: | ||
void InitiateEditor(); | ||
void ShutdownEditor(); | ||
//! @note TODO -- Probably have a cleanup handler for this | ||
//! @note Such as WorldCleanup() or some API to make sure we can cleanly deallocate and delete things... | ||
// void ShutdownEditor(); | ||
void UpdateThisApplicationInstance() override; | ||
|
||
private: | ||
//! @note Editor application, Engine, UI Layer. | ||
std::array<Layer *, 1> m_Layers; | ||
float m_LastFrameTime = 0.0f; | ||
}; | ||
}; |
Oops, something went wrong.