bevy_render: Centralize shader View uniform type #5535
Closed
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
ViewUniform
struct in one place, inbevy_render
Solution
View
struct to a shader import atbevy_render::view_types
bevy_render::view_bindings
- note that this itself importsbevy_render::view_types
for convenience as we have done elsewhereView
struct frommesh_view_types.wgsl
inbevy_pbr
,mesh2d_view_types.wgsl
andsprite.wgsl
inbevy_sprite
andui.wgsl
inbevy_ui
and instead make use of the above imports.Changelog
bevy_sprite::mesh2d_view_types
andbevy_sprite::mesh2d_view_bindings
bevy_render::view_types
andbevy_render::view_bindings
bevy_pbr
,bevy_sprite
, andbevy_ui
now usebevy_render::view_types
andbevy_render::view_bindings
to keep the shaderView
struct in-syncMigration Guide
If you were using the
bevy_sprite::mesh2d_view_types
and/orbevy_sprite::mesh2d_view_bindings
shader imports, now usebevy_render::view_types
and/orbevy_render::view_bindings
instead.