From f54865e23dc609a1d6f7dfd0e07ca622f83bcdf2 Mon Sep 17 00:00:00 2001 From: oahc09 Date: Tue, 6 Jun 2023 18:46:16 +0800 Subject: [PATCH] fix:xr right eye render failed when using custom render pipeline (#15319) --- native/cocos/core/Root.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/native/cocos/core/Root.cpp b/native/cocos/core/Root.cpp index 6e5d15514a..928d838f28 100644 --- a/native/cocos/core/Root.cpp +++ b/native/cocos/core/Root.cpp @@ -561,7 +561,9 @@ void Root::doXRFrameMove(int32_t totalFrames) { if (_xr->isRenderAllowable()) { bool isSceneUpdated = false; int viewCount = _xr->getXRConfig(xr::XRConfigKey::VIEW_COUNT).getInt(); - bool forceUpdateSceneTwice = _xr->getXRConfig(xr::XRConfigKey::EYE_RENDER_JS_CALLBACK).getBool(); + // compatible native pipeline + static bool isNativePipeline = dynamic_cast(_pipelineRuntime.get()) != nullptr; + bool forceUpdateSceneTwice = isNativePipeline ? true : _xr->getXRConfig(xr::XRConfigKey::EYE_RENDER_JS_CALLBACK).getBool(); for (int xrEye = 0; xrEye < viewCount; xrEye++) { _xr->beginRenderEyeFrame(xrEye);