-
-
Notifications
You must be signed in to change notification settings - Fork 967
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Change MaterialAssetCompilers build dependency type to other materials (#1477) #1478
Open
laske185
wants to merge
1
commit into
stride3d:master
Choose a base branch
from
laske185:AssetCompilerMaterialReference
base: master
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.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to understand the effect of this change to determine if it's fine to merge this PR and resolve the issue referenced.
I managed to find the following deeper explanation:
BuildDependencyType.Runtime
- the referenced asset is not needed to compile this asset, but it's needed at runtime to use the compiled content (eg. Models need Materials, who need Textures. But you can compile Models, Materials and Textures independently).BuildDependencyType.CompileContent
- the referenced asset needs to be compiled before this asset, and the compiler of this asset needs to load the corresponding content generated from the referenced asset (eg. A prefab model, which aggregates multiple models together, needs the compiled version of each model it's referencing to be able to merge them).BuildDependencyType.CompileAsset
- the referenced asset is read when compiling this asset because it depends on some of its parameter, but the referenced asset itself doesn't need to be compiled first (eg. Navigation Meshes need to read the scene asset they are related to in order to gather static colliders it contains, but they don't need to compile the scene itself).From this I'm understanding that currently when you build a material asset it may look into other referenced material assets and read some of their parameters. Switching to Runtime mode will potentially change it in a way where those parameters aren't always available (not sure, tbh).
Something I've seen done is a combination
BuildDependencyType.Runtime | BuildDependencyType.CompileAsset
- if the issue would still be resolved with that I think it would be preferred with a comment added to investigate it further and referencing the issue and PR for context.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the uses of
CompileAsset
I see is in the dependency analysis up-to-date check. I'm not sure when this can occur (referenced material changes after a first compilation pass which results in the recompilation of referencing material), but we should try to preserve this behavior.stride/sources/assets/Stride.Core.Assets/Analysis/BuildAssetNode.cs
Lines 148 to 155 in a4985e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error is also fixed with the combination
BuildDependencyType.Runtime | BuildDependencyType.CompileAsset
.