Skip to content

[4.4] Merge commit godotengine/godot@4d7c448#997

Merged
Spartan322 merged 135 commits intoRedot-Engine:4.4from
Spartan322:4.4-merge/4d7c448
Apr 22, 2025
Merged

[4.4] Merge commit godotengine/godot@4d7c448#997
Spartan322 merged 135 commits intoRedot-Engine:4.4from
Spartan322:4.4-merge/4d7c448

Conversation

@Spartan322
Copy link
Contributor

No description provided.

akien-mga and others added 30 commits March 3, 2025 18:21
(cherry picked from commit 70bace7)
…is enabled

This aims to fix the idle CPU utilization regression from 4.3 to 4.4
by reverting to the previous approach, but only when low-processor mode
is enabled.

(cherry picked from commit 03b4e0d)
Avoids updating the platform-specific `TargetFramework` properties if they already match the minimum required version.

(cherry picked from commit 57d5b66)
If the allocation is small enough that it enters the

if (p_size <= SMALL_ALLOCATION_MAX_SIZE) {} block, Godot would call
vmaFindMemoryTypeIndexForBufferInfo with the wrong parameters.

This can cause vmaFindMemoryTypeIndexForBufferInfo to potentially
misbehave on some cards or drivers.

Fixes regression introduced in #102830
Might potentially reopen #101850 (I doubt it, but it's possible)

Must be backported to 4.4

(cherry picked from commit c543c56)
…ical

Fixes #103522

Persistent window state doesn't work if your window is 'tiled' in X11
gnome

3.x checks for `horz && vert`
https://github.com/godotengine/godot/blob/4396e98834f159da59ec790f2ff64fb65dacd9ce/platform/x11/os_x11.cpp#L1708

4.x also checked `horz && vert` until this change where it was switched
to `horz || vert`
godotengine/godot@524f061#diff-05f85bc3bf96d384f6b96260c758e63e10bbdd52b04f8ccb34649372e7bc1f48R1382

The corrected logic is:
Check `horz && vert` for 'is_maximized'
Check `horz || vert` for 'can_maximize'

(cherry picked from commit 4f14f72)
…onary` that regressed

(cherry picked from commit f52b2e4)
Fixes #103294

(cherry picked from commit 89ea5b3)
The app was restarting unexpectedly due to missing configChanges flags.
Added "locale|layoutDirection" to AndroidManifest.xml to prevent activity recreation.

(cherry picked from commit 1c02316)
Fixes #103516.

(cherry picked from commit a7dd4ad)
- Allow mouse capture to be enabled in `_ready`
- Update the input handler logic to avoid dropping mouse captured motion events

(cherry picked from commit bea6472)
(cherry picked from commit fcd785a)
(cherry picked from commit 0c57232)
And anything that uses luminance.

The class Luminance in luminance.cpp is in charge of averaging the
luminance of all pixels.
It performs multiple passes until it reaches a 1x1 texture containing
the total average. This is standard luminance averaging on GPU.

Then the "result" of this frame and the "prev_frame_result" are averaged
together at a certain speed to mimic eye adaptation.

Then this avarege becomes the "source" for the next frame. This is done
here:

```cpp
SWAP(p_luminance_buffers->current,
p_luminance_buffers->reduce.write[p_luminance_buffers->reduce.size() -
1]);
```

So far pretty normal stuff.

**The problem is: prev_frame_result IS UNINITIALIZED**. Therefore it's
possible for prev_frame_result to contain garbage values like -5+e15
which causes the screen to stay black for a minute until eye adaptation
catches up.

Windows will always force allocations to be reset to 0, but Linux does
not do that.
However Windows just delays the bug; because it's possible for VMA to
reuse a block.

You can repro this bug by downloading Bistro, creating a camera,
selecting a default scene; and then launching Bistro.

Everything will work fine.
Until you decide to resize the window. It takes a few tries on Godot,
but eventually the screen becomes black.

If you wait around a minute, the screen will "unblack" itself back to
normal.

Even if it's not stuck in black after resize, you may notice that every
resize is inconsistent in how the eye adaptation catches up (i.e.
sometimes it flashes to white, sometimes it does not).

If you can't repro the bug, you need to try harder by doing arbitrary
resizes until it triggers.
Also, I advise to try this on Linux; since Windows' sanitization of
memory gets in the way.

There's probably multiple tickets already filled around issues that were
rooted in luminance calculations starting from uninitialized memory.

This PR sets a default value of 0, which causes the screen to always
flash white after resize. Setting a different value like 0.1 makes the
flash effect weaker. Setting it to a high value like 5.0 makes the
screen flash from dark instead.

This bug can be backported to 4.3. I don't know if it can be backported
to earlier; as the render graph makes sure the texture_clear() calls
gets issued in the right place; whereas in <= 4.2 it might be
problematic depending on when Luminance::LuminanceBuffers::configure is
being called.

(cherry picked from commit 8888f9e)
Extend max level to include i for writing and so fb is complete and avoid resulting errors like:
"Framebuffer is incomplete: Attachment level is not in the [base level, max level] range".

(cherry picked from commit e9bbe6f)
(cherry picked from commit cdcee78)
Grublady and others added 23 commits March 19, 2025 12:58
[4.4] Cherry-picks for the 4.4 branch (future 4.4.1) - 3rd batch
Fixes #104193

In OpenXR the viewport location is not centered on the transform origin

(cherry picked from commit 8e3e2a8)
(cherry picked from commit 0b0655a)
We got this from RenderDoc which had an issue with it 5 years ago, but it's
not a given that Godot is also affected.

This layer is actually quite convenient to be able to change what default Vulkan
capable GPU should be used for applications via environment variables:
https://docs.mesa3d.org/envvars.html#vulkan-mesa-device-select-layer-environment-variables

(cherry picked from commit c9f0ab6)
Already activated plugins do not need to be added again to `editor_plugins_over`.

`fold_resource()` changes `active_plugins` and is unsafe to call while iterating
over `active_plugins`.

(cherry picked from commit 411f476)
Somehow missed in the previous commit.
Partial revert of the change in #102880, cherry-picked to 4.4.1.

Co-authored-by: Pāvels Nadtočajevs <[email protected]>
[4.4] [Core] Fix performance issues in some `CowData` methods
@Spartan322 Spartan322 merged commit 1a17b61 into Redot-Engine:4.4 Apr 22, 2025
20 checks passed
@Spartan322 Spartan322 deleted the 4.4-merge/4d7c448 branch April 22, 2025 02:29
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.