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.
Objective
As it stands,
bevy_render
is currently very monolithic.It is impossible to "just" use bevy's mid-level rendering abstractions - i.e. the render graph, render world and corresponding scheduling (extract, prepare, etc.). Instead, the
RenderPlugin
pulls in a lot of high-level features such as transforms, hierarchy, cameras, views, visiblity, materials, meshes, mesh generation, colors and possibly more. To my knowledge there's currently no way to opt out of these.Solution
Split the
RenderPlugin
into a separate pluginRenderGraphPlugin
. This plugin is also used by theRenderPlugin
to prevent code duplication.Changelog
RenderGraphPlugin
RenderPlugin
depend onRenderGraphPlugin
Additional notes
I previously tried to separate the render graph into it's own crate. It worked but the diff was too noisy to review and there were a lot of unresolved questions (what abstractions should be part of each crate). Here are some random notes about things I've encountered for anyone interested. None of these are addressed in this PR.
notes
src/mesh/mesh
and mesh generationsrc/mesh/shape
src/color
seem unrelated tobevy_render
Wgpu::Color
is enough forbevy_render
internal useVec2
insrc/texture
seems out of placeu32
bevy_math
insrc/texture
texture
andimage
Texture
is insrc/render_resource
src/texture
containsImage
and related formatsbevy_render
ExtractComponentPlugin::only_extract_visible
)src/view
but seems unrelated (views should be able to exist without visibility)