RenderUiSystem::ExtractTextureSlice (#15332)

# Objective

Fixes #15330

## Solution
1. Add an `ExtractTextureSlice` variant to `RenderUiSystem`.
2. Add `RenderUiSystem::ExtractTextureSlice` to the `ExtractSchedule`
between `ExtractImages` and `ExtractBorders`.
3. Add `extract_ui_texture_slices` to the new `ExtractTextureSlice`
system set.

Which results in texture slice nodes being extracted before borders. No
more z-fighting, borders will always be drawn on top of texture-sliced
images.
This commit is contained in:
ickshonpe 2024-09-21 00:55:11 +01:00 committed by GitHub
parent 661ab1ab41
commit 48f2bd410b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -70,6 +70,7 @@ pub const UI_SHADER_HANDLE: Handle<Shader> = Handle::weak_from_u128(130128470471
pub enum RenderUiSystem {
ExtractBackgrounds,
ExtractImages,
ExtractTextureSlice,
ExtractBorders,
ExtractText,
}
@ -95,6 +96,7 @@ pub fn build_ui_render(app: &mut App) {
(
RenderUiSystem::ExtractBackgrounds,
RenderUiSystem::ExtractImages,
RenderUiSystem::ExtractTextureSlice,
RenderUiSystem::ExtractBorders,
RenderUiSystem::ExtractText,
)

View File

@ -53,7 +53,7 @@ impl Plugin for UiTextureSlicerPlugin {
.init_resource::<SpecializedRenderPipelines<UiTextureSlicePipeline>>()
.add_systems(
ExtractSchedule,
extract_ui_texture_slices.after(extract_uinode_images),
extract_ui_texture_slices.in_set(RenderUiSystem::ExtractTextureSlice),
)
.add_systems(
Render,