Skip to content

Commit

Permalink
Fixed display issues caused by texture caching after switching scenes (
Browse files Browse the repository at this point in the history
  • Loading branch information
GengineJS authored Nov 14, 2023
1 parent 409b540 commit e50f378
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cocos/rendering/custom/define.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/*
Copyright (c) 2022-2023 Xiamen Yaji Software Co., Ltd.
Expand Down Expand Up @@ -1165,7 +1166,9 @@ function applyGlobalDescBinding (data: RenderData, layout: string, isUpdate = fa
const bindId = getDescBinding(key, descriptorSetData);
if (bindId === -1) { continue; }
const tex = descriptorSet.getTexture(bindId);
if (!tex || (isUpdate && value !== pipeline.defaultTexture)) {
if (!tex || (isUpdate && value !== pipeline.defaultTexture)
// @ts-ignore
|| (!tex.gpuTexture && !(tex.gpuTextureView && tex.gpuTextureView.gpuTexture))) {
bindGlobalDesc(descriptorSet, bindId, value);
}
}
Expand Down

0 comments on commit e50f378

Please sign in to comment.