-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dynamic vertex buffer layouts to resolve sorting issues
- Vertex buffer layoutss are set on `Mesh` for shader specialization. `Mesh` knows how to specialize its own vertex buffer because it owns the vertex data. - The `RenderAsset` implementation for `Mesh` copies the vertex buffer layout to the `GpuMesh` render asset. The pbr2 renderer uses it for pipeline specialization. - The sprite2 renderer uses hardcoded vertex buffer layouts. Passing it from `Sprite` down to shader specialization is more work: - `SpriteMeta` currently owns the vertex buffers. - Requires `extract_sprite()` to copy the descriptor to its output (`ExtractedSprites`) and then `prepare_sprite` would copy it to its output (`SpriteMeta`) and finally `queue_sprite` could create the specialized shader. - I experimented with using the pipeline cache, and it felt awfully forced. The shader pipelines and caches know nothing about the resources which own the vertex buffer data, and teaching them how to get along was causing many problems with dependency management, introducing new race conditions, and just plain bad code. - `SpecializedPipeline::specialize` accepts an argument for the vertex attribute buffer descriptor. - Discussion: https://discord.com/channels/691052431525675048/743663924229963868/908484759833960489
- Loading branch information
Showing
10 changed files
with
268 additions
and
212 deletions.
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
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
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
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
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
Oops, something went wrong.