You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +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:
@@ -4210,7 +4210,7 @@ bool RenderingDevice::compute_pipeline_is_valid(RID p_pipeline) {
|
||||
/****************/
|
||||
|
||||
uint32_t RenderingDevice::_get_swap_chain_desired_count() const {
|
||||
return MAX(2U, uint32_t(GLOBAL_GET("rendering/rendering_device/vsync/swapchain_image_count")));
|
||||
return MAX(2U, uint32_t(GLOBAL_GET_CACHED(uint32_t, "rendering/rendering_device/vsync/swapchain_image_count")));
|
||||
}
|
||||
|
||||
Error RenderingDevice::screen_create(DisplayServer::WindowID p_screen) {
|
||||
|
||||
Reference in New Issue
Block a user