Fix CAS toggle broken by retained render world (#16533)
# Objective Fixes #16531 I also added change detection when creating the pipeline, which technically isn't needed but it felt weird leaving it as is. ## Solution Remove the pipeline if CAS is disabled. The uniform was already being removed, which caused flickering / weirdness. ## Testing Tested the anti_alias example by toggling CAS a bunch on/off.
This commit is contained in:
parent
e4c8bb92db
commit
923b9a9893
@ -243,14 +243,22 @@ fn prepare_cas_pipelines(
|
|||||||
pipeline_cache: Res<PipelineCache>,
|
pipeline_cache: Res<PipelineCache>,
|
||||||
mut pipelines: ResMut<SpecializedRenderPipelines<CasPipeline>>,
|
mut pipelines: ResMut<SpecializedRenderPipelines<CasPipeline>>,
|
||||||
sharpening_pipeline: Res<CasPipeline>,
|
sharpening_pipeline: Res<CasPipeline>,
|
||||||
views: Query<(Entity, &ExtractedView, &DenoiseCas), With<CasUniform>>,
|
views: Query<
|
||||||
|
(Entity, &ExtractedView, &DenoiseCas),
|
||||||
|
Or<(Added<CasUniform>, Changed<DenoiseCas>)>,
|
||||||
|
>,
|
||||||
|
mut removals: RemovedComponents<CasUniform>,
|
||||||
) {
|
) {
|
||||||
for (entity, view, cas) in &views {
|
for entity in removals.read() {
|
||||||
|
commands.entity(entity).remove::<ViewCasPipeline>();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (entity, view, denoise_cas) in &views {
|
||||||
let pipeline_id = pipelines.specialize(
|
let pipeline_id = pipelines.specialize(
|
||||||
&pipeline_cache,
|
&pipeline_cache,
|
||||||
&sharpening_pipeline,
|
&sharpening_pipeline,
|
||||||
CasPipelineKey {
|
CasPipelineKey {
|
||||||
denoise: cas.0,
|
denoise: denoise_cas.0,
|
||||||
texture_format: if view.hdr {
|
texture_format: if view.hdr {
|
||||||
ViewTarget::TEXTURE_FORMAT_HDR
|
ViewTarget::TEXTURE_FORMAT_HDR
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user