You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Add GLOBAL_GET cached macros.
GLOBAL_GET is an expensive operation which should not be used each frame / tick. This PR adds macros which do a cheaper revision check, and only call the expensive GLOBAL_GET when project settings have changed. Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
This commit is contained in:
@@ -276,7 +276,7 @@ JNIEXPORT jboolean JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env,
|
||||
// Unlike PCVR, there's no additional 2D screen onto which to render the boot logo,
|
||||
// so we skip this step if xr is enabled.
|
||||
if (XRServer::get_xr_mode() == XRServer::XRMODE_DEFAULT) {
|
||||
xr_enabled = GLOBAL_GET("xr/shaders/enabled");
|
||||
xr_enabled = GLOBAL_GET_CACHED(bool, "xr/shaders/enabled");
|
||||
} else {
|
||||
xr_enabled = XRServer::get_xr_mode() == XRServer::XRMODE_ON;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user