The issue is primarily due to `RSG::texture_storage->render_target_was_used()`
returning inconsistent results in the editor and exported projects.
(cherry picked from commit 59d0fdbacc)
If user try to use a global shader variable in a fog type shader we are getting shader error. The reason of this there is a typo in the fog.cpp. I other well working shaders types like sky the "action.global_buffer_array_variable" is "global_shader_uniforms.data".
The investigation tracked here:
https://discord.com/channels/212250894228652034/1158918161337434172
(cherry picked from commit e906eb8433)
TAA + MSAA would make Godot request unnecessary flags for an MSAA
velocity texture. flags that were not even actually needed.
This was causing:
1. Unsupported GPUs to fail completely (e.g. Intel Arc 770)
2. Wrong codepaths to be followed (causing validation errors, possibly
crashes or glitches)
3. Unnecessary performance impact in all GPUs.
See
https://github.com/godotengine/godot/issues/71929#issuecomment-1722274359
(cherry picked from commit 4de0ed4adf)
See Issue #69528. When building with precision=double, the TAA pass would break due to the motion vectors being corrupted. It was apparent the origin of the camera itself was corrupted in the UBO for the previous frame because the camera origin was only being split correctly for the current block but not for the previous block (to effectively support the double precision float on the shader).
(cherry picked from commit 77776f5313)
Add the capability of resizing the transforms buffer for particles to be double its size and alternate where the current output is written to. Only works for particles that use index as their draw order.
(cherry picked from commit 293302ccd8)
There was an error in the other branch of the refactored function where the size of the array was not properly multiplied by the size of the float to check against the buffer size. This was only an error in the error-checking itself and not the functionality. There was also an error where the proper notification was not emitted whenever the buffer for the multimesh is recreated to invalidate the previous references the renderer might've created to it. This fixes CPU Particles getting corrupted when they're created without emission being enabled.
(cherry picked from commit 420f3890b0)
Fixes#67287. There was a subtle error where due to how enabling motion vectors for multi-meshes was handled, only the first instance would have a valid transforms buffer and the rest would point to an invalid buffer. This change moves over the responsibility of enabling motion vectors only when changes happen to the individual 3D transforms or the entire buffer itself. It also fixes an unnecessary download of the existing buffer that'd get overwritten by the current cache if it exists. Another fix is handling the case where the buffer was not set, and enabling motion vectors would not cause the buffer to be recreated correctly.
(cherry picked from commit 5155870d64)
The code wanted to divide and round up:
- 0 / 64 = 0
- 63 / 64 = 1
- 64 / 64 = 1
- 65 / 64 = 2
However when the dividend was exactly 0 it would underflow and produce
67108864 instead.
This caused TDRs on empty scenes or extremely slow performance
Fix#80286
(cherry picked from commit e783e32108)
Explicitly clear the separate specular buffer when the background mode is canvas and screen space effects (and thus a separate specular buffer) are used.
(cherry picked from commit af9d1743f3)