-
Notifications
You must be signed in to change notification settings - Fork 16
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
Shader lazy load #382
Shader lazy load #382
Conversation
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.
Overall, it looks that you limit Init
to create CPU data and add CreateGraphicsResources
interface to submit cpu data to gpu.
- [Optional]
Submit
maybe a better name to presentCreateGraphicsResources
? - [Optional] You can wrap all renderer or renderpass logics to a new data structure such as
engine::RenderPipeline
and EditorApp can simply hold m_editorRenderPipeline and m_engineRenderPipeline. The pipeline concept is a series of Renderer/RenderPass in order. Multiple RenderPipelines(Rasterize, RayTrace, Compute, ...) contribute to the final rendering world. - Currently, we have an user-visible entity named shader collection. It seems not very reasonable.
|
Indeed it is a bit strange to think of SVC as a component. |
In project serialization, the main part is Entity/Component data but also allow to add other data such as SVC. It seems an asset, not a component in the unity document. |
feb0da8
to
fd37097
Compare
Projects/Shared | ||
Projects/Shared/* | ||
Projects/Test/* | ||
!Projects/Test/*/ | ||
Projects/Test/Textures/* | ||
!Projects/Test/Textures/*/ | ||
|
||
# Precompiled Shader | ||
!Projects/Shared/BuiltInShaders | ||
Projects/Shared/BuiltInShaders/* | ||
!Projects/Shared/BuiltInShaders/Direct3D11 | ||
Projects/Shared/BuiltInShaders/Direct3D11/* | ||
!Projects/Shared/BuiltInShaders/Direct3D11/vs_imgui.bin | ||
!Projects/Shared/BuiltInShaders/Direct3D11/fs_imgui.bin |
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.
Upload vs_imgui.bin and fs_imgui.bin to github.
Seems that i cant just write something like
Projects/Shared/*
!Projects/Shared/BuiltInShaders/Direct3D11/vs_imgui.bin
to upload vs_imgui.bin but ignore other files under Shared.
You can add a launch option which let editor pre-compile all shaders? Sometimes it will be helpful. For example, a user doesn't edit any shader, just make a game level which doesn't need to wait in a random timepoint. |
Compiling and loading shaders like this, instead of compiling all shader variants at once:
Heres an example of the Renderer frame:
Click here if you want to check every variant of your uber shader compiling.