-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Separate bevy_gpu from bevy_render #7000
Conversation
As mentioned in the original description, this is a large breaking change. It's prone to merge conflicts, and difficult to review. Is it possible to break this down into smaller parts and piecewise migrate everything to the new crate? Marking this down as complex due to the scale of the refactor. |
I could split this PR into two parts, one for the move of If the reviews agree that the split into two parts makes their lives easier, then I will take the time and redo this PR. Otherwise, I would be glad to only rebase this one a couple of times until it is ready to be merged. |
I am also unsure whether it would be easier to just review and merge this PR in its entirety instead of performing the rename (of the parent PR) first. 6 would have multiple breaking changes in a row affecting the same types, which would be very annoying. |
…ce, Context} to GPU{Device, Queue, Adapter, AdapterInfo, Instance, Context} renamed variable names render_{device, queue, adapter, adapter_info, instance, context} to gpu_{device, queue, adapter, adapter_info, instance, context}
…UDevice` to `gpu_device` renamed occurrences of the variable name `queue` that refer to a `GPUQueue` to `gpu_queue`
fixed GPU* in docs type aliased GpuCommandEncoder renamed GpuContext::command_encoder to GpuContext::gpu_command_encoder
extracted the gpu code into a separate crate renamed GPU* to Gpu* renamed occurrences of the variable name `device` that refer to a `GPUDevice` to `gpu_device` renamed occurrences of the variable name `queue` that refer to a `GPUQueue` to `gpu_queue` renamed type names Render{Device, Queue, Adapter, AdapterInfo, Instance, Context} to GPU{Device, Queue, Adapter, AdapterInfo, Instance, Context} renamed variable names render_{device, queue, adapter, adapter_info, instance, context} to gpu_{device, queue, adapter, adapter_info, instance, context}
3064a75
to
a650d23
Compare
Yeah, there's a lot of noise right now because of the rename, but once that PR gets merged this one should be easy enough to review IMO |
Closed in favor of #7111 |
Objective
bevy_render
is a very large crate and there have been discussions about whether to split it into multiple smaller cratesRational
Solution
bevy_gpu
crate.bevy_render
crate does not depend on these libraries directly anymore.Details
This separation was actually quite painless (except for the hundreds of renames in comments and use statements).
A couple of small tweaks had to be made to split the two crates properly.
The
PipelineCache::extract_shaders
method depends on the Extract Param of the render module. Thus I moved it out of bevy_gpu. I am still unsure where to put this code. For now, it lives inbevy_render::lib
.The
AsBindGroup
trait is a render abstraction and thus had to be moved out of bevy_gpu.The
SpecializedMeshPipeline
was moved out of thebevy_gpu::gpu_resource
module into thebevy_render::mesh
module. This is more in line with what we do for other specialized pipelines as well.Finally, I removed two or three references in the documentation of
bevy_gpu
, which linked back intobevy_render
.IMO these were not necessary and they keep the dependency tree clean.
How to Merge
This will be a large breaking change. If we want to go through with this PR it would probably be best to do it soon and not wait for another year.
If we decide that this is something we want then I will need help configuring the cargo features and dependencies, etc correctly.
We could merge this PR on top of, or after #6968. I would prefer the former to keep the rebasing to a minimum.
If there is anything about the new API that you want to see renamed/moved, please let me know!
Changelog
Migration Guide