Skip to content

[macOS] Use occlusionState instead of isOnActiveSpace to determine when window is drawable.#83096

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
bruvzg:macos_leak
Oct 10, 2023
Merged

[macOS] Use occlusionState instead of isOnActiveSpace to determine when window is drawable.#83096
akien-mga merged 1 commit intogodotengine:masterfrom
bruvzg:macos_leak

Conversation

@bruvzg
Copy link
Copy Markdown
Member

@bruvzg bruvzg commented Oct 10, 2023

Fixes #82769

Might fix this one as well, but I can't reproduce the issue - #64708
Bugsquad edit: Closes #64708

@akien-mga
Copy link
Copy Markdown
Member

Is the empty entitlements file meant to be there?

@bruvzg
Copy link
Copy Markdown
Member Author

bruvzg commented Oct 10, 2023

Is the empty entitlements file meant to be there?

No, removed.

@bitsawer
Copy link
Copy Markdown
Member

This could possibly also fix #81953. The SurfaceTool and mesh creation code might in theory be a red herring and the demo could leak even without it, caused by the issues this PR is fixing. I don't have a Mac, so I can't test it. I couldn't repro the leak on Windows 10.

@bruvzg
Copy link
Copy Markdown
Member Author

bruvzg commented Oct 10, 2023

This could possibly also fix #81953.

This seems to be unrelated:

_objc_rootAllocWithZone	
-[AGXG13GFamilyCommandQueue commandBufferWithDescriptor:]	
MVKQueue::getMTLCommandBuffer(MVKCommandUse, bool)	
MVKQueue::waitIdle(MVKCommandUse)	
MVKDevice::waitIdle()	
vkDeviceWaitIdle	
VulkanContext::flush(bool, bool)	
RenderingDeviceVulkan::_flush(bool)	
RenderingDeviceVulkan::buffer_get_data(RID, unsigned int, unsigned int)	
RendererRD::MeshStorage::mesh_get_surface(RID, int) const	
RenderingServer::mesh_surface_get_arrays(RID, int) const	
SurfaceTool::_create_list(Ref<Mesh> const&, int, LocalVector<SurfaceTool::Vertex, unsigned int, false, false>*, LocalVector<int, unsigned int, false, false>*, unsigned long long&)	
SurfaceTool::append_from(Ref<Mesh> const&, int, Transform3D const&)	
void call_with_variant_args_helper<__UnexistingClass, Ref<Mesh> const&, int, Transform3D const&, 0ul, 1ul, 2ul>(__UnexistingClass*, void (__UnexistingClass::*)(Ref<Mesh> const&, int, Transform3D const&), Variant const**, Callable::CallError&, IndexSequence<0ul, 1ul, 2ul>)	
void call_with_variant_args_dv<__UnexistingClass, Ref<Mesh> const&, int, Transform3D const&>(__UnexistingClass*, void (__UnexistingClass::*)(Ref<Mesh> const&, int, Transform3D const&), Variant const**, int, Callable::CallError&, Vector<Variant> const&)	
MethodBindT<Ref<Mesh> const&, int, Transform3D const&>::call(Object*, Variant const**, int, Callable::CallError&) const	
Object::callp(StringName const&, Variant const**, int, Callable::CallError&)	
Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&)	
GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*)	
GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&)	
bool Node::_gdvirtual__process_call<false>(double)	
Node::_notification(int)	
Node::_notificationv(int, bool)	
Object::notification(int, bool)	
SceneTree::_process_group(SceneTree::ProcessGroup*, bool)	
SceneTree::_process(bool)	
SceneTree::process(double)	
Main::iteration()	

@bruvzg bruvzg marked this pull request as ready for review October 10, 2023 17:33
@bruvzg bruvzg requested a review from a team as a code owner October 10, 2023 17:33
@akien-mga
Copy link
Copy Markdown
Member

Thanks!

@lawnjelly
Copy link
Copy Markdown
Member

Reminder this may need a 3.x version / cherry picking to 3.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[3.x] Game consumes 100% CPU if the window is covered by another OS window (macOS) Godot leaking massive memory just by itself

4 participants