Skip to content

Refactor the project layout#33

Closed
AR-DEV-1 wants to merge 1 commit into
Redot-Engine:masterfrom
AR-DEV-1:project-layout-refactor
Closed

Refactor the project layout#33
AR-DEV-1 wants to merge 1 commit into
Redot-Engine:masterfrom
AR-DEV-1:project-layout-refactor

Conversation

@AR-DEV-1

@AR-DEV-1 AR-DEV-1 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • Refactor

    • Reorganized engine module structure to improve code organization and separation
    • Updated internal build system architecture
  • Chores

    • Modified build configuration paths to reflect new directory structure
    • Relocated third-party dependencies to centralized locations
    • Updated versions of multiple third-party libraries including graphics and input frameworks

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 95df98aa-a162-43ac-a1a7-f582e5362f47

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR restructures the project's build system by splitting the monolithic native module into independent platform, core, input, and runtime modules. Third-party submodules are relocated from engine/native/thirdparty/ to engine/thirdparty/, and the main draconic executable is updated to use runtime-based sources and dependencies.

Changes

Build System Modularization and Submodule Relocation

Layer / File(s) Summary
Third-party submodule path relocation
.gitmodules, cmake/Modules.cmake
Submodule checkout paths move from engine/native/thirdparty/* to engine/thirdparty/*; NATIVE_SOURCE_DIR CMake variable is updated from engine/native to engine.
Module architecture reorganization
engine/CMakeLists.txt, engine/runtime/CMakeLists.txt
native module is replaced with four new modules—platform, core (SHARED), input, runtime—each with explicit link dependencies; rendering and scene modules are added to runtime with their respective component dependencies.
Executable and build path updates
CMakeLists.txt, cmake/Shaders.cmake
draconic executable switches source from engine/native/main/main.cpp to engine/runtime/main/main.cpp and links runtime instead of native; shader and BGFX include paths updated to engine/runtime/rendering/shaders and engine/thirdparty/bgfx/src.
Third-party dependency version pins
engine/thirdparty/bgfx, engine/thirdparty/bimg, engine/thirdparty/bx, engine/thirdparty/sdl
Submodule commit references are updated to pinned upstream versions in the relocated engine/thirdparty/ paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • OldDev78
  • Arctis-Fireblight
  • mcdubhghlas

Poem

🐰 The native nest now splits in four,
Platform, core, input, and more!
Submodules skip to thirdparty ground,
Runtime builds the draconic sound.
Modules dance in harmony's choir,
Architecture climbs ever higher! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Refactor the project layout' accurately summarizes the main change—reorganizing the project structure from engine/native to engine/runtime and engine/thirdparty paths.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AR-DEV-1 AR-DEV-1 force-pushed the project-layout-refactor branch from a06a68f to c8b1847 Compare June 12, 2026 17:42
@AR-DEV-1 AR-DEV-1 marked this pull request as draft June 12, 2026 17:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmake/Shaders.cmake`:
- Around line 3-5: BGFX_INCLUDE currently points to a missing path; change it to
the actual location of BGFX shader headers (or add a fallback check) so shaderc
-i can find includes referenced from SHADER_SRC_DIR; specifically update the
BGFX_INCLUDE variable (in cmake/Shaders.cmake) to the real directory that
contains bgfx shader headers (e.g. the runtime thirdparty copy such as
"${CMAKE_SOURCE_DIR}/engine/runtime/thirdparty/bgfx/src" or
"${CMAKE_SOURCE_DIR}/engine/runtime/thirdparty/bgfx"), and add a CMake check
that verifies the directory exists and fails with a clear message if not,
leaving SHADER_SRC_DIR and SHADER_BIN_DIR unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48fec280-4cf2-474e-83ed-e0317877ce60

📥 Commits

Reviewing files that changed from the base of the PR and between 28e62ca and a06a68f.

⛔ Files ignored due to path filters (3)
  • engine/thirdparty/cmake/bgfx/generated/bounds.cpp.in is excluded by !**/generated/**
  • engine/thirdparty/cmake/bgfx/generated/shader.cpp.in is excluded by !**/generated/**
  • engine/thirdparty/cmake/bgfx/generated/vertexlayout.cpp.in is excluded by !**/generated/**
📒 Files selected for processing (146)
  • .gitmodules
  • CMakeLists.txt
  • cmake/Modules.cmake
  • cmake/Shaders.cmake
  • engine/CMakeLists.txt
  • engine/core/CMakeLists.txt
  • engine/core/core.cppm
  • engine/core/definitions/definitions.cppm
  • engine/core/definitions/stdtypes.cppm
  • engine/core/definitions/version.cppm
  • engine/core/io/filesystem.cpp
  • engine/core/io/filesystem.cppm
  • engine/core/io/image_loader.cpp
  • engine/core/io/image_loader.cppm
  • engine/core/io/io.cppm
  • engine/core/math/constants.cppm
  • engine/core/math/functions.cppm
  • engine/core/math/math.cppm
  • engine/core/math/math.test.cpp
  • engine/core/math/transform.cpp
  • engine/core/math/transform.cppm
  • engine/core/math/types.cppm
  • engine/core/math/types_common.cppm
  • engine/core/math/vector2.cppm
  • engine/core/math/vector3.cppm
  • engine/core/math/vector4.cppm
  • engine/core/memory/allocator.cpp
  • engine/core/memory/allocator.cppm
  • engine/core/memory/bumpAllocator.cpp
  • engine/core/memory/bumpAllocator.cppm
  • engine/core/memory/bumpAllocator.test.cpp
  • engine/core/memory/fixedAllocator.cpp
  • engine/core/memory/fixedAllocator.cppm
  • engine/core/memory/fixedAllocator.test.cpp
  • engine/core/memory/handle.cppm
  • engine/core/memory/handle_registry.cppm
  • engine/core/memory/pageAllocator.cpp
  • engine/core/memory/pageAllocator.cppm
  • engine/core/memory/root.cppm
  • engine/core/memory/slice.cppm
  • engine/core/memory/slot_array.cppm
  • engine/core/memory/trackingAllocator.cpp
  • engine/core/memory/trackingAllocator.cppm
  • engine/core/memory/trackingAllocator.test.cpp
  • engine/input/input.cpp
  • engine/input/input.cppm
  • engine/native/CMakeLists.txt
  • engine/native/thirdparty/bgfx
  • engine/native/thirdparty/bimg
  • engine/native/thirdparty/bx
  • engine/native/thirdparty/sdl
  • engine/platform/CMakeLists.txt
  • engine/platform/cpu/cpu_info.h
  • engine/platform/cpu/cpu_info_neon.cpp
  • engine/platform/cpu/cpu_info_x64.cpp
  • engine/platform/impl/CMakeLists.txt
  • engine/platform/impl/linux/linux.cpp
  • engine/platform/impl/mac/mac.mm
  • engine/platform/impl/platform_impl.h
  • engine/platform/impl/win32/win32.cpp
  • engine/platform/platform.cppm
  • engine/platform/simd.h
  • engine/runtime/CMakeLists.txt
  • engine/runtime/draconic.cppm
  • engine/runtime/main/main.cpp
  • engine/runtime/rendering/CMakeLists.txt
  • engine/runtime/rendering/material/material.cppm
  • engine/runtime/rendering/mesh/mesh.cpp
  • engine/runtime/rendering/mesh/mesh.cppm
  • engine/runtime/rendering/quad_renderer/quad_renderer.cpp
  • engine/runtime/rendering/quad_renderer/quad_renderer.cppm
  • engine/runtime/rendering/renderer/renderer.cpp
  • engine/runtime/rendering/renderer/renderer.cppm
  • engine/runtime/rendering/rendergraph/rendergraph.cpp
  • engine/runtime/rendering/rendergraph/rendergraph.cppm
  • engine/runtime/rendering/rendering.cppm
  • engine/runtime/rendering/rhi/buffers.cpp
  • engine/runtime/rendering/rhi/commands.cpp
  • engine/runtime/rendering/rhi/core.cpp
  • engine/runtime/rendering/rhi/macros.h
  • engine/runtime/rendering/rhi/pipelines.cpp
  • engine/runtime/rendering/rhi/rhi.cppm
  • engine/runtime/rendering/rhi/texture.cpp
  • engine/runtime/rendering/rhi/uniform_registry.cppm
  • engine/runtime/rendering/rhi/vertex.cppm
  • engine/runtime/rendering/shaders/fs.sc
  • engine/runtime/rendering/shaders/fs_quad.sc
  • engine/runtime/rendering/shaders/varying.def.sc
  • engine/runtime/rendering/shaders/varying_quad.def.sc
  • engine/runtime/rendering/shaders/vs.sc
  • engine/runtime/rendering/shaders/vs_quad.sc
  • engine/runtime/scene/CMakeLists.txt
  • engine/runtime/scene/camera/camera_controller.cpp
  • engine/runtime/scene/camera/camera_controller.cppm
  • engine/runtime/scene/renderable/renderable.cppm
  • engine/runtime/scene/scene.cppm
  • engine/runtime/scene/transform_component/transform_component.cpp
  • engine/runtime/scene/transform_component/transform_component.cppm
  • engine/thirdparty/CMakeLists.txt
  • engine/thirdparty/bgfx
  • engine/thirdparty/bimg
  • engine/thirdparty/bx
  • engine/thirdparty/cmake/Config.cmake.in
  • engine/thirdparty/cmake/bgfx/3rdparty/dear-imgui.cmake
  • engine/thirdparty/cmake/bgfx/3rdparty/fcpp.cmake
  • engine/thirdparty/cmake/bgfx/3rdparty/glsl-optimizer.cmake
  • engine/thirdparty/cmake/bgfx/3rdparty/glslang.cmake
  • engine/thirdparty/cmake/bgfx/3rdparty/meshoptimizer.cmake
  • engine/thirdparty/cmake/bgfx/3rdparty/spirv-cross.cmake
  • engine/thirdparty/cmake/bgfx/3rdparty/spirv-opt.cmake
  • engine/thirdparty/cmake/bgfx/3rdparty/tint.cmake
  • engine/thirdparty/cmake/bgfx/3rdparty/webgpu.cmake
  • engine/thirdparty/cmake/bgfx/CMakeLists.txt
  • engine/thirdparty/cmake/bgfx/bgfx.cmake
  • engine/thirdparty/cmake/bgfx/examples.cmake
  • engine/thirdparty/cmake/bgfx/geometryc.cmake
  • engine/thirdparty/cmake/bgfx/geometryv.cmake
  • engine/thirdparty/cmake/bgfx/shaderc.cmake
  • engine/thirdparty/cmake/bgfx/shared.cmake
  • engine/thirdparty/cmake/bgfx/texturev.cmake
  • engine/thirdparty/cmake/bgfx/util/ConfigureDebugging.cmake
  • engine/thirdparty/cmake/bgfxToolUtils.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/astc_encoder.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/edtaa3.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/etc1.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/etc2.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/iqa.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/libsquish.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/loadpng.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/miniz.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/nvtt.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/pvrtc.cmake
  • engine/thirdparty/cmake/bimg/3rdparty/tinyexr.cmake
  • engine/thirdparty/cmake/bimg/CMakeLists.txt
  • engine/thirdparty/cmake/bimg/bimg.cmake
  • engine/thirdparty/cmake/bimg/bimg_decode.cmake
  • engine/thirdparty/cmake/bimg/bimg_encode.cmake
  • engine/thirdparty/cmake/bimg/texturec.cmake
  • engine/thirdparty/cmake/bx/CMakeLists.txt
  • engine/thirdparty/cmake/bx/bin2c.cmake
  • engine/thirdparty/cmake/bx/bx.cmake
  • engine/thirdparty/cmake/version.cmake
  • engine/thirdparty/doctest/doctest.h
  • engine/thirdparty/sdl
  • engine/thirdparty/stb/CMakeLists.txt
  • engine/thirdparty/stb/stb_image.h
💤 Files with no reviewable changes (5)
  • engine/native/thirdparty/sdl
  • engine/native/thirdparty/bx
  • engine/native/thirdparty/bgfx
  • engine/native/thirdparty/bimg
  • engine/native/CMakeLists.txt

Comment thread cmake/Shaders.cmake
@AR-DEV-1

Copy link
Copy Markdown
Contributor Author

@OldDev78 Will open a new PR with the refactor

@AR-DEV-1 AR-DEV-1 closed this Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant