mach: Unified entry point and redesigned engine core #257

Merged
iddev5 merged 7 commits from ay-app-entry into main 2022-04-29 19:48:47 +00:00
iddev5 commented 2022-04-28 18:29:29 +00:00 (Migrated from github.com)

From https://matrix.to/#/!hPlvgnLQhMkTucKPrh:matrix.org/$_m_5exLov-5Ue5sGq-6_veTZ0k-RVJAZo9Lj5igjeXA?via=matrix.org


This PR implements:

  • Unified entry point which would be consistent across all backends (platforms). Right now, we only support desktops which has pub fn main as their entry point but it doesnt work in other environments like wasm (web) and android or require additional configurations, like in iOS. So instead ask the end application to provide a set of functions: init, deinit, update and resize (and more in future) which are used as per platform limitations behind the scenes
  • The bare bones of the Engine struct which would hold the actual engine functionality. It currently has core (window, events etc) and gpu_driver (webgpu structs). The goal is to provide a cross platform abstraction over these interfaces.

Additionally:

  • An App struct was added in root build.zig which acts as the build system SDK, Its point is to set up the complex build process behind the scenes.
  • The Options which were previously being passed to old App on init is now managed though an exported declaration in the app file using pub const options: mach,Engine.Options = {...};

This PR does not includes:

  • Tests, will need discussion on how to do it, in future (Note that even the old application code didnt had any tests)
  • All the examples and shader toy. This is because modifications of examples create ugly diffs and would make this PR difficult to review. In order to not regress the engine, I have ported the examples over in another branch, which I will PR soon keeping really short time difference between both. Or additionally, I can push it over to this branch as soon as review of these below commits are done.

Progress towards #18


  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
From https://matrix.to/#/!hPlvgnLQhMkTucKPrh:matrix.org/$_m_5exLov-5Ue5sGq-6_veTZ0k-RVJAZo9Lj5igjeXA?via=matrix.org --- This PR implements: - Unified entry point which would be consistent across all backends (platforms). Right now, we only support desktops which has ``pub fn main`` as their entry point but it doesnt work in other environments like wasm (web) and android or require additional configurations, like in iOS. So instead ask the end application to provide a set of functions: init, deinit, update and resize (and more in future) which are used as per platform limitations behind the scenes - The bare bones of the ``Engine`` struct which would hold the actual engine functionality. It currently has core (window, events etc) and gpu_driver (webgpu structs). The goal is to provide a cross platform abstraction over these interfaces. Additionally: - An ``App`` struct was added in root build.zig which acts as the build system SDK, Its point is to set up the complex build process behind the scenes. - The ``Options`` which were previously being passed to old ``App`` on init is now managed though an exported declaration in the app file using ``pub const options: mach,Engine.Options = {...};`` This PR does not includes: - Tests, will need discussion on how to do it, in future (Note that even the old application code didnt had any tests) - All the examples and shader toy. This is because modifications of examples create ugly diffs and would make this PR difficult to review. In order to not regress the engine, I have ported the examples over in another branch, which I will PR soon keeping really short time difference between both. Or additionally, I can push it over to this branch as soon as review of these below commits are done. Progress towards #18 --- - [X] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
emidoots commented 2022-04-29 19:48:00 +00:00 (Migrated from github.com)

I have a few thoughts about the core and gpu_driver structs, but I can imagine I don't have full picture of how they will be swapped out in a browser context yet so I'm happy to wait to discuss those.

This is a clear improvement over the status quo, so merging!

I have a few thoughts about the `core` and `gpu_driver` structs, but I can imagine I don't have full picture of how they will be swapped out in a browser context yet so I'm happy to wait to discuss those. This is a clear improvement over the status quo, so merging!
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!257
No description provided.