From 3c0ff56967aa46a07941bff19604cc9141e08f62 Mon Sep 17 00:00:00 2001 From: Zhou Zhenglong Date: Tue, 10 Oct 2023 18:06:43 +0800 Subject: [PATCH] add empty light buffer guard --- native/cocos/renderer/pipeline/custom/NativeSceneCulling.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/native/cocos/renderer/pipeline/custom/NativeSceneCulling.cpp b/native/cocos/renderer/pipeline/custom/NativeSceneCulling.cpp index 36e43830185..0b98b9a502e 100644 --- a/native/cocos/renderer/pipeline/custom/NativeSceneCulling.cpp +++ b/native/cocos/renderer/pipeline/custom/NativeSceneCulling.cpp @@ -775,6 +775,9 @@ void LightResource::clear() { } void LightResource::buildLightBuffer(gfx::CommandBuffer* cmdBuffer) const { + if(lights.empty()) { + return; + } cmdBuffer->updateBuffer( lightBuffer, cpuBuffer.data(),