Aster cleanup.
This commit is contained in:
parent
12ab256a30
commit
ad6ee9a0e5
|
|
@ -11,41 +11,43 @@ find_package(VulkanMemoryAllocator CONFIG REQUIRED)
|
||||||
find_package(EASTL CONFIG REQUIRED)
|
find_package(EASTL CONFIG REQUIRED)
|
||||||
|
|
||||||
set(HEADER_FILES
|
set(HEADER_FILES
|
||||||
"constants.h"
|
"include/aster/core/global.h"
|
||||||
"config.h"
|
"include/aster/util/logger.h"
|
||||||
"logger.h"
|
"include/aster/core/constants.h"
|
||||||
"global.h"
|
"include/aster/core/config.h"
|
||||||
"context.h"
|
"include/aster/core/context.h"
|
||||||
"window.h"
|
"include/aster/core/physical_device.h"
|
||||||
"physical_device.h"
|
"include/aster/core/device.h"
|
||||||
"device.h"
|
"include/aster/core/swapchain.h"
|
||||||
"swapchain.h"
|
"include/aster/core/pipeline.h"
|
||||||
"pipeline.h"
|
"include/aster/core/queue_allocation.h"
|
||||||
"queue_allocation.h"
|
"include/aster/core/buffer.h"
|
||||||
"buffer.h"
|
"include/aster/core/image.h"
|
||||||
"image.h"
|
"include/aster/core/surface.h"
|
||||||
"surface.h"
|
"include/aster/core/size.h"
|
||||||
"size.h")
|
"include/aster/core/window.h"
|
||||||
|
"include/aster/aster.h")
|
||||||
|
|
||||||
set(SOURCE_FILES
|
set(SOURCE_FILES
|
||||||
"logger.cpp"
|
"src/aster/core/global.cpp"
|
||||||
"global.cpp"
|
"src/aster/util/logger.cpp"
|
||||||
"context.cpp"
|
"src/aster/core/context.cpp"
|
||||||
"window.cpp"
|
"src/aster/core/physical_device.cpp"
|
||||||
"physical_device.cpp"
|
"src/aster/core/device.cpp"
|
||||||
"device.cpp"
|
"src/aster/core/swapchain.cpp"
|
||||||
"swapchain.cpp"
|
"src/aster/core/pipeline.cpp"
|
||||||
"pipeline.cpp"
|
"src/aster/core/buffer.cpp"
|
||||||
"buffer.cpp"
|
"src/aster/core/image.cpp"
|
||||||
"image.cpp"
|
"src/aster/core/surface.cpp"
|
||||||
"surface.cpp")
|
"src/aster/core/window.cpp")
|
||||||
|
|
||||||
add_library(aster_core STATIC ${SOURCE_FILES} ${HEADER_FILES})
|
add_library(aster_core STATIC ${SOURCE_FILES} ${HEADER_FILES})
|
||||||
set_property(TARGET aster_core PROPERTY CXX_STANDARD 20)
|
set_property(TARGET aster_core PROPERTY CXX_STANDARD 20)
|
||||||
|
|
||||||
target_precompile_headers(aster_core PUBLIC global.h)
|
target_precompile_headers(aster_core PUBLIC "include/aster/aster.h")
|
||||||
|
|
||||||
target_include_directories(aster_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(aster_core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include/aster")
|
||||||
|
target_include_directories(aster_core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||||
|
|
||||||
target_link_libraries(aster_core PUBLIC glm::glm-header-only)
|
target_link_libraries(aster_core PUBLIC glm::glm-header-only)
|
||||||
target_link_libraries(aster_core PRIVATE glfw)
|
target_link_libraries(aster_core PRIVATE glfw)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
// =============================================
|
||||||
|
// Aster: aster.h
|
||||||
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
|
// =============================================
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/global.h"
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "logger.h"
|
#include "util/logger.h"
|
||||||
|
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "constants.h"
|
#include "core/constants.h"
|
||||||
#include <debugbreak.h>
|
#include <debugbreak.h>
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "core/buffer.h"
|
||||||
|
|
||||||
#include "device.h"
|
#include "core/device.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
Buffer::Destroy(const Device *device)
|
Buffer::Destroy(const Device *device)
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "context.h"
|
#include "core/context.h"
|
||||||
|
|
||||||
#include <EASTL/array.h>
|
#include <EASTL/array.h>
|
||||||
#include <EASTL/fixed_vector.h>
|
#include <EASTL/fixed_vector.h>
|
||||||
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "device.h"
|
#include "core/device.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include "core/context.h"
|
||||||
#include "physical_device.h"
|
#include "core/physical_device.h"
|
||||||
#include "queue_allocation.h"
|
#include "core/queue_allocation.h"
|
||||||
|
|
||||||
#include <EASTL/array.h>
|
#include <EASTL/array.h>
|
||||||
#include <EASTL/fixed_vector.h>
|
#include <EASTL/fixed_vector.h>
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "global.h"
|
#include "core/global.h"
|
||||||
|
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "image.h"
|
#include "core/image.h"
|
||||||
|
|
||||||
#include "device.h"
|
#include "core/device.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
Image::Destroy(const Device *device)
|
Image::Destroy(const Device *device)
|
||||||
|
|
@ -3,11 +3,10 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "physical_device.h"
|
#include "core/physical_device.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include "core/context.h"
|
||||||
#include "surface.h"
|
#include "core/surface.h"
|
||||||
#include "window.h"
|
|
||||||
|
|
||||||
[[nodiscard]] vk::SurfaceCapabilitiesKHR
|
[[nodiscard]] vk::SurfaceCapabilitiesKHR
|
||||||
GetSurfaceCapabilities(const vk::PhysicalDevice physicalDevice, const vk::SurfaceKHR surface)
|
GetSurfaceCapabilities(const vk::PhysicalDevice physicalDevice, const vk::SurfaceKHR surface)
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "pipeline.h"
|
#include "core/pipeline.h"
|
||||||
|
|
||||||
#include "device.h"
|
#include "core/device.h"
|
||||||
|
|
||||||
Pipeline::Pipeline(const Device *device, vk::PipelineLayout layout, vk::Pipeline pipeline,
|
Pipeline::Pipeline(const Device *device, vk::PipelineLayout layout, vk::Pipeline pipeline,
|
||||||
eastl::vector<vk::DescriptorSetLayout> &&setLayouts)
|
eastl::vector<vk::DescriptorSetLayout> &&setLayouts)
|
||||||
|
|
@ -3,10 +3,10 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "surface.h"
|
#include "core/surface.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include "core/context.h"
|
||||||
#include "window.h"
|
#include "core/window.h"
|
||||||
|
|
||||||
Surface::Surface(Context *context, const Window *window, cstr name)
|
Surface::Surface(Context *context, const Window *window, cstr name)
|
||||||
: m_Context(context)
|
: m_Context(context)
|
||||||
|
|
@ -3,12 +3,11 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// ==============================================
|
// ==============================================
|
||||||
|
|
||||||
#include "swapchain.h"
|
#include "core/swapchain.h"
|
||||||
|
|
||||||
#include "device.h"
|
#include "core/device.h"
|
||||||
#include "physical_device.h"
|
#include "core/physical_device.h"
|
||||||
#include "surface.h"
|
#include "core/surface.h"
|
||||||
#include "window.h"
|
|
||||||
|
|
||||||
[[nodiscard]] vk::Extent2D GetExtent(Size2D size, vk::SurfaceCapabilitiesKHR *surfaceCapabilities);
|
[[nodiscard]] vk::Extent2D GetExtent(Size2D size, vk::SurfaceCapabilitiesKHR *surfaceCapabilities);
|
||||||
|
|
||||||
|
|
@ -3,10 +3,10 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "window.h"
|
#include "core/window.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include "core/context.h"
|
||||||
#include "logger.h"
|
#include "util/logger.h"
|
||||||
|
|
||||||
std::atomic_uint64_t Window::m_WindowCount = 0;
|
std::atomic_uint64_t Window::m_WindowCount = 0;
|
||||||
std::atomic_bool Window::m_IsGlfwInit = false;
|
std::atomic_bool Window::m_IsGlfwInit = false;
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "logger.h"
|
#include "util/logger.h"
|
||||||
|
|
||||||
Logger g_Logger = Logger();
|
Logger g_Logger = Logger();
|
||||||
// ReSharper disable once CppInconsistentNaming
|
// ReSharper disable once CppInconsistentNaming
|
||||||
|
|
@ -5,12 +5,12 @@ cmake_minimum_required(VERSION 3.13)
|
||||||
find_package(imgui CONFIG REQUIRED)
|
find_package(imgui CONFIG REQUIRED)
|
||||||
|
|
||||||
add_library(util_helper STATIC
|
add_library(util_helper STATIC
|
||||||
helpers.h
|
"helpers.h"
|
||||||
helpers.cpp
|
"helpers.cpp"
|
||||||
frame.cpp
|
"frame.cpp"
|
||||||
frame.h
|
"frame.h"
|
||||||
gui.cpp
|
"gui.cpp"
|
||||||
gui.h)
|
"gui.h")
|
||||||
|
|
||||||
target_link_libraries(util_helper PRIVATE aster_core)
|
target_link_libraries(util_helper PRIVATE aster_core)
|
||||||
target_link_libraries(util_helper PRIVATE imgui::imgui)
|
target_link_libraries(util_helper PRIVATE imgui::imgui)
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@
|
||||||
|
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
|
|
||||||
#include "device.h"
|
#include "aster/core/device.h"
|
||||||
|
#include "aster/core/swapchain.h"
|
||||||
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "swapchain.h"
|
|
||||||
|
|
||||||
Frame::Frame(const Device *device, const u32 queueFamilyIndex, const u32 frameCount)
|
Frame::Frame(const Device *device, const u32 queueFamilyIndex, const u32 frameCount)
|
||||||
: m_FrameIdx(frameCount)
|
: m_FrameIdx(frameCount)
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
#include "size.h"
|
#include "aster/core/size.h"
|
||||||
|
|
||||||
#include <EASTL/fixed_vector.h>
|
#include <EASTL/fixed_vector.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
|
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
|
||||||
#include "context.h"
|
#include "aster/core/context.h"
|
||||||
#include "device.h"
|
#include "aster/core/device.h"
|
||||||
|
#include "aster/core/window.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "window.h"
|
|
||||||
|
|
||||||
#include <imgui_impl_glfw.h>
|
#include <imgui_impl_glfw.h>
|
||||||
#include <imgui_impl_vulkan.h>
|
#include <imgui_impl_vulkan.h>
|
||||||
|
|
@ -108,11 +108,11 @@ StartBuild()
|
||||||
ImGui_ImplGlfw_NewFrame();
|
ImGui_ImplGlfw_NewFrame();
|
||||||
NewFrame();
|
NewFrame();
|
||||||
|
|
||||||
// static ImGuiDockNodeFlags dockspaceFlags = ImGuiDockNodeFlags_None | ImGuiDockNodeFlags_PassthruCentralNode;
|
static ImGuiDockNodeFlags dockspaceFlags = ImGuiDockNodeFlags_None | ImGuiDockNodeFlags_PassthruCentralNode;
|
||||||
|
|
||||||
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
|
// We are using the ImGuiWindowFlags_NoDocking flag to make the parent window not dockable into,
|
||||||
// because it would be confusing to have two docking targets within each others.
|
// because it would be confusing to have two docking targets within each others.
|
||||||
ImGuiWindowFlags windowFlags = ImGuiWindowFlags_None; // ImGuiWindowFlags_NoDocking;
|
ImGuiWindowFlags windowFlags = ImGuiWindowFlags_None | ImGuiWindowFlags_NoDocking;
|
||||||
|
|
||||||
const ImGuiViewport *viewport = GetMainViewport();
|
const ImGuiViewport *viewport = GetMainViewport();
|
||||||
SetNextWindowPos(viewport->WorkPos);
|
SetNextWindowPos(viewport->WorkPos);
|
||||||
|
|
@ -130,18 +130,18 @@ StartBuild()
|
||||||
// all active windows docked into it will lose their parent and become undocked.
|
// all active windows docked into it will lose their parent and become undocked.
|
||||||
// We cannot preserve the docking relationship between an active window and an inactive docking, otherwise
|
// We cannot preserve the docking relationship between an active window and an inactive docking, otherwise
|
||||||
// any change of dockspace/settings would lead to windows being stuck in limbo and never being visible.
|
// any change of dockspace/settings would lead to windows being stuck in limbo and never being visible.
|
||||||
// PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
|
PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
|
||||||
// Begin("DockSpace Demo", nullptr, windowFlags);
|
Begin("DockSpace Demo", nullptr, windowFlags);
|
||||||
// PopStyleVar();
|
PopStyleVar();
|
||||||
|
|
||||||
// PopStyleVar(2);
|
PopStyleVar(2);
|
||||||
|
|
||||||
// DockSpace
|
// DockSpace
|
||||||
// if (GetIO().ConfigFlags & ImGuiConfigFlags_DockingEnable)
|
if (GetIO().ConfigFlags & ImGuiConfigFlags_DockingEnable)
|
||||||
// {
|
{
|
||||||
// const ImGuiID dockspaceId = GetID("MyDockSpace");
|
const ImGuiID dockspaceId = GetID("MyDockSpace");
|
||||||
// DockSpace(dockspaceId, ImVec2(0.0f, 0.0f), dockspaceFlags);
|
DockSpace(dockspaceId, ImVec2(0.0f, 0.0f), dockspaceFlags);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
|
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
#include "device.h"
|
#include "aster/core/device.h"
|
||||||
#include "physical_device.h"
|
#include "aster/core/physical_device.h"
|
||||||
|
|
||||||
#include <EASTL/array.h>
|
#include <EASTL/array.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
|
|
||||||
#include "queue_allocation.h"
|
#include "aster/core/queue_allocation.h"
|
||||||
|
|
||||||
#include "EASTL/span.h"
|
#include "EASTL/span.h"
|
||||||
#include <EASTL/vector.h>
|
#include <EASTL/vector.h>
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,16 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "aster/aster.h"
|
||||||
#include "constants.h"
|
|
||||||
#include "context.h"
|
|
||||||
#include "device.h"
|
|
||||||
#include "physical_device.h"
|
|
||||||
#include "window.h"
|
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/core/buffer.h"
|
||||||
#include "pipeline.h"
|
#include "aster/core/constants.h"
|
||||||
#include "swapchain.h"
|
#include "aster/core/context.h"
|
||||||
|
#include "aster/core/device.h"
|
||||||
|
#include "aster/core/physical_device.h"
|
||||||
|
#include "aster/core/window.h"
|
||||||
|
#include "aster/core/pipeline.h"
|
||||||
|
#include "aster/core/swapchain.h"
|
||||||
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
|
|
@ -74,8 +74,8 @@ main(int, char **)
|
||||||
{
|
{
|
||||||
MIN_LOG_LEVEL(Logger::LogType::eInfo);
|
MIN_LOG_LEVEL(Logger::LogType::eInfo);
|
||||||
|
|
||||||
Context context = {"Triangle", VERSION};
|
|
||||||
Window window = {"Triangle (Aster)", {640, 480}};
|
Window window = {"Triangle (Aster)", {640, 480}};
|
||||||
|
Context context = {"Triangle", VERSION};
|
||||||
Surface surface = {&context, &window, "Primary"};
|
Surface surface = {&context, &window, "Primary"};
|
||||||
|
|
||||||
PhysicalDevices physicalDevices = {&surface, &context};
|
PhysicalDevices physicalDevices = {&surface, &context};
|
||||||
|
|
|
||||||
|
|
@ -3,21 +3,22 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "aster/aster.h"
|
||||||
#include "constants.h"
|
|
||||||
#include "context.h"
|
#include "aster/core/buffer.h"
|
||||||
#include "device.h"
|
#include "aster/core/constants.h"
|
||||||
#include "global.h"
|
#include "aster/core/context.h"
|
||||||
#include "physical_device.h"
|
#include "aster/core/device.h"
|
||||||
#include "pipeline.h"
|
#include "aster/core/physical_device.h"
|
||||||
#include "swapchain.h"
|
#include "aster/core/pipeline.h"
|
||||||
#include "window.h"
|
#include "aster/core/swapchain.h"
|
||||||
|
#include "aster/core/window.h"
|
||||||
|
#include "aster/core/image.h"
|
||||||
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include "image.h"
|
|
||||||
#include "stb_image.h"
|
#include "stb_image.h"
|
||||||
|
|
||||||
#include <EASTL/array.h>
|
#include <EASTL/array.h>
|
||||||
|
|
@ -115,8 +116,8 @@ main(int, char **)
|
||||||
{
|
{
|
||||||
MIN_LOG_LEVEL(Logger::LogType::eInfo);
|
MIN_LOG_LEVEL(Logger::LogType::eInfo);
|
||||||
|
|
||||||
Context context = {"Box", VERSION};
|
|
||||||
Window window = {"Box (Aster)", {640, 480}};
|
Window window = {"Box (Aster)", {640, 480}};
|
||||||
|
Context context = {"Box", VERSION};
|
||||||
Surface surface = {&context, &window, "Primary"};
|
Surface surface = {&context, &window, "Primary"};
|
||||||
|
|
||||||
PhysicalDevices physicalDevices = {&surface, &context};
|
PhysicalDevices physicalDevices = {&surface, &context};
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,15 @@
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||||
|
|
||||||
#include "asset_loader.h"
|
#include "aster/core/buffer.h"
|
||||||
|
#include "aster/core/device.h"
|
||||||
|
#include "aster/core/image.h"
|
||||||
|
|
||||||
#include "EASTL/fixed_vector.h"
|
|
||||||
#include "buffer.h"
|
|
||||||
#include "device.h"
|
|
||||||
#include "gpu_resource_manager.h"
|
#include "gpu_resource_manager.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "image.h"
|
#include "asset_loader.h"
|
||||||
|
|
||||||
|
#include <EASTL/fixed_vector.h>
|
||||||
#include <EASTL/hash_map.h>
|
#include <EASTL/hash_map.h>
|
||||||
#include <glm/gtc/type_ptr.hpp>
|
#include <glm/gtc/type_ptr.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "aster/aster.h"
|
||||||
#include "global.h"
|
|
||||||
|
#include "aster/core/buffer.h"
|
||||||
|
|
||||||
#include "gpu_resource_manager.h"
|
#include "gpu_resource_manager.h"
|
||||||
#include "nodes.h"
|
#include "nodes.h"
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,11 @@
|
||||||
|
|
||||||
#include "gpu_resource_manager.h"
|
#include "gpu_resource_manager.h"
|
||||||
|
|
||||||
#include "buffer.h"
|
|
||||||
#include "device.h"
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "image.h"
|
|
||||||
|
#include "aster/core/buffer.h"
|
||||||
|
#include "aster/core/device.h"
|
||||||
|
#include "aster/core/image.h"
|
||||||
|
|
||||||
#include <EASTL/array.h>
|
#include <EASTL/array.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
|
|
||||||
#include <EASTL/deque.h>
|
#include <EASTL/deque.h>
|
||||||
#include <EASTL/vector_map.h>
|
#include <EASTL/vector_map.h>
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,17 @@
|
||||||
|
|
||||||
#include "ibl_helpers.h"
|
#include "ibl_helpers.h"
|
||||||
|
|
||||||
#include "EASTL/fixed_vector.h"
|
#include "aster/core/device.h"
|
||||||
#include "EASTL/tuple.h"
|
#include "aster/core/image.h"
|
||||||
|
|
||||||
#include "asset_loader.h"
|
#include "asset_loader.h"
|
||||||
#include "device.h"
|
|
||||||
#include "gpu_resource_manager.h"
|
#include "gpu_resource_manager.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "image.h"
|
|
||||||
#include "pipeline_utils.h"
|
#include "pipeline_utils.h"
|
||||||
|
|
||||||
|
#include <EASTL/fixed_vector.h>
|
||||||
|
#include <EASTL/tuple.h>
|
||||||
|
|
||||||
constexpr cstr EQUIRECT_TO_CUBE_SHADER_FILE = "shader/eqrect_to_cube.cs.hlsl.spv";
|
constexpr cstr EQUIRECT_TO_CUBE_SHADER_FILE = "shader/eqrect_to_cube.cs.hlsl.spv";
|
||||||
constexpr cstr DIFFUSE_IRRADIANCE_SHADER_FILE = "shader/diffuse_irradiance.cs.hlsl.spv";
|
constexpr cstr DIFFUSE_IRRADIANCE_SHADER_FILE = "shader/diffuse_irradiance.cs.hlsl.spv";
|
||||||
constexpr cstr PREFILTER_SHADER_FILE = "shader/prefilter.cs.hlsl.spv";
|
constexpr cstr PREFILTER_SHADER_FILE = "shader/prefilter.cs.hlsl.spv";
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
#include "gpu_resource_manager.h"
|
#include "gpu_resource_manager.h"
|
||||||
|
|
||||||
#include <EASTL/tuple.h>
|
|
||||||
|
|
||||||
struct Pipeline;
|
struct Pipeline;
|
||||||
struct Texture;
|
struct Texture;
|
||||||
struct TextureCube;
|
struct TextureCube;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "light_manager.h"
|
#include "light_manager.h"
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "aster/core/buffer.h"
|
||||||
#include "glm/ext/matrix_transform.hpp"
|
#include "glm/ext/matrix_transform.hpp"
|
||||||
|
|
||||||
struct Light
|
struct Light
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
|
|
||||||
// TODO: Separate files so you only import handles.
|
// TODO: Separate files so you only import handles.
|
||||||
#include "gpu_resource_manager.h"
|
#include "gpu_resource_manager.h"
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,17 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "aster/aster.h"
|
||||||
#include "constants.h"
|
|
||||||
#include "context.h"
|
#include "aster/core/buffer.h"
|
||||||
#include "device.h"
|
#include "aster/core/constants.h"
|
||||||
#include "global.h"
|
#include "aster/core/context.h"
|
||||||
#include "image.h"
|
#include "aster/core/device.h"
|
||||||
#include "physical_device.h"
|
#include "aster/core/image.h"
|
||||||
#include "pipeline.h"
|
#include "aster/core/physical_device.h"
|
||||||
#include "swapchain.h"
|
#include "aster/core/pipeline.h"
|
||||||
#include "window.h"
|
#include "aster/core/swapchain.h"
|
||||||
|
#include "aster/core/window.h"
|
||||||
|
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
@ -133,8 +134,8 @@ main(int, char **)
|
||||||
{
|
{
|
||||||
MIN_LOG_LEVEL(Logger::LogType::eInfo);
|
MIN_LOG_LEVEL(Logger::LogType::eInfo);
|
||||||
|
|
||||||
Context context = {"ModelRender", VERSION};
|
|
||||||
Window window = {"ModelRender (Aster)", {INIT_WIDTH, INIT_HEIGHT}};
|
Window window = {"ModelRender (Aster)", {INIT_WIDTH, INIT_HEIGHT}};
|
||||||
|
Context context = {"ModelRender", VERSION};
|
||||||
Surface surface = {&context, &window, "Primary Surface"};
|
Surface surface = {&context, &window, "Primary Surface"};
|
||||||
|
|
||||||
PhysicalDevices physicalDevices = {&surface, &context};
|
PhysicalDevices physicalDevices = {&surface, &context};
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
|
|
||||||
#include "EASTL/vector.h"
|
#include <EASTL/vector.h>
|
||||||
|
|
||||||
struct Nodes
|
struct Nodes
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@
|
||||||
|
|
||||||
#include "pipeline_utils.h"
|
#include "pipeline_utils.h"
|
||||||
|
|
||||||
#include "device.h"
|
#include "aster/core/device.h"
|
||||||
|
#include "aster/core/pipeline.h"
|
||||||
|
|
||||||
#include "gpu_resource_manager.h"
|
#include "gpu_resource_manager.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
#include "pipeline.h"
|
|
||||||
|
|
||||||
struct GpuResourceManager;
|
struct GpuResourceManager;
|
||||||
struct Swapchain;
|
struct Swapchain;
|
||||||
struct Device;
|
struct Device;
|
||||||
|
struct Pipeline;
|
||||||
|
|
||||||
constexpr auto VERTEX_SHADER_FILE = "shader/model.vs.hlsl.spv";
|
constexpr auto VERTEX_SHADER_FILE = "shader/model.vs.hlsl.spv";
|
||||||
constexpr auto FRAGMENT_SHADER_FILE = "shader/model.ps.hlsl.spv";
|
constexpr auto FRAGMENT_SHADER_FILE = "shader/model.ps.hlsl.spv";
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@
|
||||||
|
|
||||||
#include "asset_loader.h"
|
#include "asset_loader.h"
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "aster/core/buffer.h"
|
||||||
#include "device.h"
|
#include "aster/core/device.h"
|
||||||
#include "image.h"
|
#include "aster/core/image.h"
|
||||||
|
|
||||||
#include "core_components.h"
|
#include "core_components.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
@ -870,7 +870,7 @@ AssetLoader::LoadModelToGpu(cstr path, cstr name)
|
||||||
}
|
}
|
||||||
else if (material->alphaMode == "MASK")
|
else if (material->alphaMode == "MASK")
|
||||||
{
|
{
|
||||||
alphaBlendValue = material->alphaCutoff;
|
alphaBlendValue = Cast<f32>(material->alphaCutoff);
|
||||||
}
|
}
|
||||||
|
|
||||||
materials.push_back({
|
materials.push_back({
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "aster/core/buffer.h"
|
||||||
#include "render_resource_manager.h"
|
#include "render_resource_manager.h"
|
||||||
|
|
||||||
#include "ecs_adapter.h"
|
#include "ecs_adapter.h"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
|
|
||||||
struct Camera
|
struct Camera
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
|
|
||||||
template <typename TComponent>
|
template <typename TComponent>
|
||||||
struct CDirty
|
struct CDirty
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,17 @@
|
||||||
|
|
||||||
#include "ibl_helpers.h"
|
#include "ibl_helpers.h"
|
||||||
|
|
||||||
#include "EASTL/fixed_vector.h"
|
#include "aster/core/device.h"
|
||||||
#include "EASTL/tuple.h"
|
#include "aster/core/image.h"
|
||||||
|
|
||||||
#include "asset_loader.h"
|
#include "asset_loader.h"
|
||||||
#include "device.h"
|
|
||||||
#include "render_resource_manager.h"
|
#include "render_resource_manager.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "image.h"
|
|
||||||
#include "pipeline_utils.h"
|
#include "pipeline_utils.h"
|
||||||
|
|
||||||
|
#include <EASTL/fixed_vector.h>
|
||||||
|
#include <EASTL/tuple.h>
|
||||||
|
|
||||||
constexpr cstr EQUIRECT_TO_CUBE_SHADER_FILE = "shader/eqrect_to_cube.cs.hlsl.spv";
|
constexpr cstr EQUIRECT_TO_CUBE_SHADER_FILE = "shader/eqrect_to_cube.cs.hlsl.spv";
|
||||||
constexpr cstr DIFFUSE_IRRADIANCE_SHADER_FILE = "shader/diffuse_irradiance.cs.hlsl.spv";
|
constexpr cstr DIFFUSE_IRRADIANCE_SHADER_FILE = "shader/diffuse_irradiance.cs.hlsl.spv";
|
||||||
constexpr cstr PREFILTER_SHADER_FILE = "shader/prefilter.cs.hlsl.spv";
|
constexpr cstr PREFILTER_SHADER_FILE = "shader/prefilter.cs.hlsl.spv";
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
#include "render_resource_manager.h"
|
#include "render_resource_manager.h"
|
||||||
|
|
||||||
struct Pipeline;
|
struct Pipeline;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "light_manager.h"
|
#include "light_manager.h"
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "aster/core/buffer.h"
|
||||||
#include "ibl_helpers.h"
|
#include "ibl_helpers.h"
|
||||||
#include "glm/ext/matrix_transform.hpp"
|
#include "glm/ext/matrix_transform.hpp"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
|
|
||||||
// TODO: Separate files so you only import handles.
|
// TODO: Separate files so you only import handles.
|
||||||
#include "render_resource_manager.h"
|
#include "render_resource_manager.h"
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,16 @@
|
||||||
// Copyright (c) 2020-2024 Anish Bhobe
|
// Copyright (c) 2020-2024 Anish Bhobe
|
||||||
// =============================================
|
// =============================================
|
||||||
|
|
||||||
#include "context.h"
|
#include "aster/core/context.h"
|
||||||
#include "device.h"
|
#include "aster/core/device.h"
|
||||||
|
#include "aster/core/physical_device.h"
|
||||||
|
#include "aster/core/swapchain.h"
|
||||||
|
#include "aster/core/window.h"
|
||||||
|
#include "aster/core/image.h"
|
||||||
|
#include "aster/core/pipeline.h"
|
||||||
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "physical_device.h"
|
|
||||||
#include "render_resource_manager.h"
|
#include "render_resource_manager.h"
|
||||||
#include "swapchain.h"
|
|
||||||
#include "window.h"
|
|
||||||
|
|
||||||
#include "asset_loader.h"
|
#include "asset_loader.h"
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
|
|
@ -19,8 +22,6 @@
|
||||||
#include "ecs_adapter.h"
|
#include "ecs_adapter.h"
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include "ibl_helpers.h"
|
#include "ibl_helpers.h"
|
||||||
#include "image.h"
|
|
||||||
#include "pipeline.h"
|
|
||||||
|
|
||||||
#include "pipeline_utils.h"
|
#include "pipeline_utils.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
#include "pipeline_utils.h"
|
#include "pipeline_utils.h"
|
||||||
|
|
||||||
#include "device.h"
|
#include "aster/core/device.h"
|
||||||
|
|
||||||
#include "render_resource_manager.h"
|
#include "render_resource_manager.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
#include "pipeline.h"
|
#include "aster/core/pipeline.h"
|
||||||
|
|
||||||
struct RenderResourceManager;
|
struct RenderResourceManager;
|
||||||
struct Swapchain;
|
struct Swapchain;
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,11 @@
|
||||||
|
|
||||||
#include "render_resource_manager.h"
|
#include "render_resource_manager.h"
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "aster/core/buffer.h"
|
||||||
#include "device.h"
|
#include "aster/core/device.h"
|
||||||
|
#include "aster/core/image.h"
|
||||||
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "image.h"
|
|
||||||
|
|
||||||
#include <EASTL/array.h>
|
#include <EASTL/array.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "global.h"
|
#include "aster/aster.h"
|
||||||
|
|
||||||
#include <EASTL/deque.h>
|
#include <EASTL/deque.h>
|
||||||
#include <EASTL/vector_map.h>
|
#include <EASTL/vector_map.h>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue