-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added resource module with packer target, implemented resource packing across examples #66
Open
jonjondev
wants to merge
13
commits into
main
Choose a base branch
from
feature/resource-packing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
jonjondev
added
core
Relating to the engine's core
build
Relating to the engine's build system
labels
Mar 17, 2024
jonjondev
force-pushed
the
feature/resource-packing
branch
2 times, most recently
from
March 17, 2024 11:11
65c493e
to
c1e053a
Compare
jonjondev
force-pushed
the
feature/resource-packing
branch
from
March 17, 2024 11:21
c1e053a
to
d86a055
Compare
jonjondev
force-pushed
the
feature/resource-packing
branch
from
March 19, 2024 12:52
4610f1f
to
841d3cc
Compare
jonjondev
force-pushed
the
feature/resource-packing
branch
from
April 21, 2024 14:01
d09d11f
to
7a4ae1c
Compare
jonjondev
force-pushed
the
feature/resource-packing
branch
from
April 21, 2024 14:04
7a4ae1c
to
0236641
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a new resource packing system to the engine, extracting many dependencies such as
tinyobjectloader
andstb_image
from the engine, and ensuring source asset files do not get packaged up alongside the executable.This functionality is achieved via a meta-program, the "packer", which is a newly added target, compiled before the runtime engine targets. It is called from the project Makefiles with the paths of assets for package, and will output a a
.pck
file that can be mounted and queried at runtime using the original file paths.The structure of the
.pck
file is as follows:Under this structure, the header will contain an offset to the Table of Contents Entries, which each know their own size, and can be indexed via file path once parsed, and each entry contains an offset (from the start of the Body Entries) to its related entry along with it's length.
The resource packing system currently supports the following resources:
StaticMeshData
from.obj
filesTexture2DData
from.png
,.jpg
, and.jpeg
files (more types are technically supported but not searched for)ShaderData
from.spv
filesFontData
from.ttf
filesSceneData
andfromSceneEntityData
.scene
,andfiles respectively (entities are now being packed directly into their related scenes to reduce indirection).entity
The resource packing system currently does not support the following resources:
Scene data from.scene
filesUpdates must be made to the scene system to support read-only mode so that it does not try to write back to the pack file or some random location on your disk. Right now, I have added a stopgap that will allow tests to continue to function as intended.
In addition, it is important to note that the packing method disables padding (using
#pragma pack(push, 1)
) for simplicity, so it's important to keep in mind that it may result in unaligned reads.There are currently no tests setup for the resource system as very little can be unit tested. A scheme will need to be devised to support integration-level testing.This has now been setup. It's not quite unit tested, but it's being tested just about as well as we can hope for right now.The PR has been...
The code has been...
master
(according to GitHub)package
targets