From 6aeafbea014d7da43b000c44bcb548cf41129c87 Mon Sep 17 00:00:00 2001 From: GengineJS <476393671@qq.com> Date: Thu, 12 Sep 2024 18:14:06 +0800 Subject: [PATCH] Changed hash --- cocos/rendering/custom/scene-culling.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cocos/rendering/custom/scene-culling.ts b/cocos/rendering/custom/scene-culling.ts index 3b3fe11bc47..66ce44f628a 100644 --- a/cocos/rendering/custom/scene-culling.ts +++ b/cocos/rendering/custom/scene-culling.ts @@ -7,7 +7,7 @@ import { CSMLevel, Camera, DirectionalLight, Light, LightType, Model, PointLight ReflectionProbe, SKYBOX_FLAG, ShadowType, Shadows, SphereLight, SpotLight } from '../../render-scene/scene'; import { Layers, Node } from '../../scene-graph'; import { PipelineSceneData } from '../pipeline-scene-data'; -import { getSubpassOrPassID, bool, AlignUp, SetLightUBO } from './define'; +import { getSubpassOrPassID, bool, AlignUp, SetLightUBO, hashCombineKey } from './define'; import { LayoutGraphData } from './layout-graph'; import { CullingFlags, RenderGraph, RenderGraphValue, SceneData, RenderQueue as RenderQueue0 } from './render-graph'; import { SceneFlags } from './types'; @@ -47,13 +47,13 @@ function computeCullingKey ( const lightLevel = sceneData.light.level; const reflectProbe = sceneData.light.probe!; const shadeLight = sceneData.shadingLight; - cullingKeys += `${camera ? objectID(camera) : 0}-`; - cullingKeys += `${reflectProbe ? objectID(reflectProbe) : 0}-`; - cullingKeys += `${(refId === -1 && light) ? objectID(light) : 0}-`; - cullingKeys += `${(refId !== -1 && shadeLight) ? objectID(shadeLight) : 0}-`; - cullingKeys += `${refId === -1 ? lightLevel : 0}-`; - cullingKeys += `${castShadows ? 1 : 0}-`; - cullingKeys += `${refId}`; + cullingKeys += hashCombineKey(camera ? objectID(camera) : 0); + cullingKeys += hashCombineKey(reflectProbe ? objectID(reflectProbe) : 0); + cullingKeys += hashCombineKey((refId === -1 && light) ? objectID(light) : 0); + cullingKeys += hashCombineKey((refId !== -1 && shadeLight) ? objectID(shadeLight) : 0); + cullingKeys += hashCombineKey(refId === -1 ? lightLevel : 0); + cullingKeys += hashCombineKey(castShadows ? 1 : 0); + cullingKeys += hashCombineKey(refId); return cullingKeys; }