This PR adds the code necessary to correctly free environments in GLES2, which was previously missing causing them to leak.
(cherry picked from commit 7134ef90bb)
The RID Handles PR introduced a couple of bug fixes, they are added here without the RID handles functionality in order to keep 3.4 and 3.x roughly in sync, allowing further fixes to RID lifetimes to be backported.
This error message was often displayed for no good reason when PCK
files were loaded in the editor.
Since file modification dates are secondary metadata, it's not
very important if it can't be retrieved successfully anyway.
(cherry picked from commit 5acb8a253e)
The "webgl/webgl2.h" include provides that function, but it's not
available in emscripten versions < 2.0.17 .
Since we need to support emscripten 1.39.9 (mono builds), this commit
adds a JS function in library_godot_display.js as a compatibility layer
for it, and implement glGetBufferSubData by funneling the call to that
function (so we don't have name collisions JS-side with recent emcc).
All those hacks are now moved to the platform directory instead of being
ifdefs inside the drivers implementations.
(cherry picked from commit bbfe054175)
This is useful information to have for troubleshooting, and it's
said to sidestep a possible race condition issue that breaks
microphone recording on Linux.
(cherry picked from commit de912a8bd9)
For octahedral compressed normals/tangents, we use vec4 in the shader
regardless of whether a normal/tangent does/doesn't exist
For the case where we only have a normal vector, we need to specify that
there are only two components being used when calling glVertexAttrib
Before we would always specify that there were 4 components, and used
offsets to determine where in the vertex buffer to read data from but
this doesn't work on all platforms
(cherry picked from commit 8a43b222c7)
Replaced some in-loop uses of Vector.write with an out of loop ptrw,
to avoid a lot of superfluous reads on the CowData ref count.
(cherry picked from commit 47496a55bc)
Sets `AlignOperands` to `DontAlign`.
`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
Immediate meshes do not have geometry of type Surface so we check
to see the mesh isn't immediate before trying to cast to surface
to check for octahedral compression
This patch fixes rendering of multiple reflection probes for a single
mesh in the GLES2 renderer. If there were two reflection probes, one of
them would always have the `interior` option flipped, resulting in
broken blending between probes and flickering of ambient reflection.
Also make note of GLES2 reflection probe limit
This provides more realistic lighting with a very small performance cost.
The option is available in both GLES3 and GLES2, and can be enabled in
the Project Settings. This goes well with the ACES Fitted tonemapping mode
that was recently added.
When enabled, this also makes upgrading Godot 3.x projects to Godot 4.0 easier,
since lighting in 3.x will better match how it'll look in Godot 4.0.
Change the existing DEV_ASSERT function to be switched on and off by the DEV_ENABLED define. DEV_ASSERT breaks into the debugger as soon as hit.
Add error macros DEV_CHECK and DEV_CHECK_ONCE to add an alternative check that ERR_PRINT when a condition fails, again only enabled in DEV_ENABLED builds.