Commit Graph

108 Commits

Author SHA1 Message Date
lawnjelly
8a8c4c7982 Fix fragcolor write locations in scene shaders 2024-07-14 08:35:26 +02:00
f09ab537e0 Clang-format everything. 2024-04-21 15:27:36 +02:00
6d0c43dbf0 Fix error found by static analysis tools. 2024-04-19 18:32:49 +02:00
2934369381 Added a new canvas_item_add_texture_rect_animation() method to the RenderingServer. 2024-03-11 18:21:05 +01:00
5604071bb4 Fix 2d mesh transforms and colors. 2024-03-11 12:45:36 +01:00
0fccc9f393 Added S3TC_NOT_SUPPORTED define to be used by platforms externally. 2024-02-17 19:07:14 +01:00
cdb3f03e61 Added optional GLES2_LOAD_EXT_NO_DLCFN_AVAILABLE define for the rasterizer storage. 2024-02-17 19:04:57 +01:00
1d22053020 Moved dlfcn.h include in RasterizerStorageGLES2 to it's proper place according to the comment above it. 2024-02-17 18:57:33 +01:00
ae7409bf52 Ported: Fix signed distance field font rendering
This fix works in both GLES3 and GLES2.
The rendering formula in the shader was adjusted to further improve the
sharpness/antialiasing quality balance.
- lawnjelly and Calinou
bc607fb607
2024-02-08 19:11:34 +01:00
lawnjelly
3a04d5adfe GLES2 / GLES3 - Use gl_FragColor temporary
On some hardware, modifying gl_FragColor multiple times can cause large performance drops. This PR writes to a standard temporary variable instead, and copies across to gl_FragColor once only at the end of the fragment shader.

This could potentially lead to large gains in performance on affected hardware.
2024-02-08 14:58:12 +01:00
Bartłomiej T. Listwon
7101e4aed7 Prevent shuffling custom shader functions (shader cache requires determinism) 2024-02-08 14:48:50 +01:00
Caroline Joy Bell
0f099eca32 Fix #if *_ENABLED inconsistencies, should check if defined
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-02-08 14:16:03 +01:00
Alessandro Famà
57c4c9455a Fix Dummy audio driver initialization issue on WASAPI output device initialization failure 2024-02-08 14:09:49 +01:00
Rémi Verschelde
1c70f86950 Fix various GCC 13 warnings
Fixes occurrences of `-Wtype-limits`, `-Wmaybe-uninitialized`,
`-Wduplicated-branches`.
2023-12-20 22:57:54 +01:00
lawnjelly
96d23e1f29 Fix glGet overflows by using 64 bit versions
Certain glGet operations require 64 bit versions according to the GLES spec.
The previous code was susceptible to overflow bugs,  especially running under ANGLE.
2023-12-20 22:39:02 +01:00
lawnjelly
88fd023a06 Workaround GCC warning in rasterizer_canvas_batcher
`-Werror=array-bounds` flags when creating a new batch, possibly due to the possibility of the malloc failing (out of memory).
This PR adds an explicit `CRASHNOW` in the hope the compiler will recognise this case is not intended to be recoverable.
2023-12-20 22:25:40 +01:00
99621357a0 File copyright header updates pt4. 2023-12-17 22:50:00 +01:00
88e9ad04f2 Moved back the servers and resources from core. 2023-12-10 23:11:07 +01:00
238bf1b331 Moved the RenderingServer to core. 2023-12-10 19:04:24 +01:00
763f662263 Moved meshes to a new subfolder. 2023-12-10 15:22:09 +01:00
59ae5c4662 Ported from godot: add support for 3 dir shadow splits
- Ansraer
54bc6a300e
2023-10-02 18:12:54 +02:00
e98b2a954b Don't use ERR_FAIL in SubProcessUnix::stop(). 2023-09-10 22:26:30 +02:00
8dab74a7d2 Fix missing include. 2023-09-10 14:05:09 +02:00
d9f09d86d3 Made emscripten guards consistent in SubProcessUnix. 2023-09-10 13:32:47 +02:00
4a6868b79d Removed commented code. Also call stop() in SubProcessUnix's destructor. 2023-09-10 13:28:06 +02:00
a0a84c4987 Return early in SubProcessUnix::start() if the executable path is empty. 2023-09-10 12:39:29 +02:00
5fd0326745 Added a new SubProcess class with a Uniz backend for better process control. 2023-09-10 12:19:51 +02:00
62e2b1623a Use NULLs. 2023-08-30 13:24:46 +02:00
5d93975c8d Ported: Fix custom res caching sub-res even if no-cache
-Razoric480
2ceb93bbef
2023-08-30 12:55:37 +02:00
kobewi
3c4fc036a1 Add mono audio support to WASAPI
(cherry picked from commit 8d010b44c16766331aa92e1a45a03a4cef1466e0)
2023-08-30 11:02:57 +02:00
05c264c83c Ported: Initialize GLWrapper earlier in Storage::initialize()
Make sure `GLWrapper` is initialized before `glActiveTexture` is called by other parts of the storage initialize(), to prevent benign warnings.
- lawnjelly
857d884026
2023-08-27 22:20:14 +02:00
fb142ed6f8 Ported: Unbind texture slots when changing framebuffer
Prevent bugs whereby texture still in use.
- lawnjelly
5e197fd21e
2023-08-27 22:19:07 +02:00
33d5dcf399 Ported: Hierarchical culling - Add extra check to skeleton_attach_canvas_item
Although this check shouldn't be able to fail currently, it provides a small level of extra logic checking at only small cost in DEV builds.
- lawnjelly
d7cca42ef6
2023-08-27 22:03:35 +02:00
26bb16d86e Ported: Fix 2D MultiMesh hierarchical culling
Fixes updating local bounds for MultiMeshes used in canvas items by introducing a back link.
- lawnjelly
ad577e3c7e
2023-08-27 21:28:30 +02:00
The Benedani
d0972a7e36 GLES2: Make GPU skinning more consistent 2023-08-27 12:18:05 +02:00
Luke Hubmayer-Werner
f80e276363 PulseAudio: Remove get_latency() caching 2023-08-27 12:14:00 +02:00
Fabio Alessandrelli
e56567ff4d Explicitly handle buffer errors in send/recv 2023-08-27 11:46:27 +02:00
4bb48a4a5c Ported from godot4: Fix reading Unicode from stdio.
- bruvzg
3d8a942a56
2023-08-05 20:33:48 +02:00
834cbe8cef Ported: Single Compilation Unit build.
Adds support for simple SCU build.
This speeds up compilation by compiling multiple cpp files within a single translation unit.
- lawnjelly
43e181a00a
2023-07-11 16:07:36 +02:00
5b869f8b54 Ported from godot: Canvas item hierarchical culling
Adds optional hierarchical culling to the 2D rendering (within VisualServer).
Each canvas item maintains a bound in local space of the item itself and all child / grandchild items. This allows branches to be culled at once when they don't intersect a viewport.
- lawnjelly
b777a9e5f9
2023-06-28 20:25:48 +02:00
c46c527f01 Backported: [3.x] Fix NODE_POSITION_VIEW Shader Built-In
- paddy-exe
67d3fe4075
2023-06-11 09:38:19 +02:00
552226ab5d Backported: Backport spatial shader built-ins
Backport of this PR: godotengine#63597
This adds these as new Built-Ins to Spatial Shaders
* Object's Position in World Space
* Camera Position in World Space
* Camera Direction in World Space
* Object's Position in View Space
- paddy-exe
be3d331f26
2023-06-11 09:37:10 +02:00
1263101396 Ported: Batching - Add MultiRect command
Large groups of similar rects can be processed more efficiently using the MultiRect command. Processing common to the group can be done as a one off, instead of per rect.

Adds the new API to VisualServerCanvas, and uses the new functionality from Font, BitmapFont, DynamicFont and TileMap, via the VisualServerCanvasHelper class.

- lawnjelly

910ddd13c4
2023-04-20 23:09:37 +02:00
43d1126b73 Ported: fix shadows pass viewport calculation.
([3.x] Fix shadows when using 2 directional lights)
- Ansraer
0227fcc4cc
2023-03-12 19:48:33 +01:00
79842beb9a Ported: Expose OS.read_string_from_stdin() to the scripting API
This can be used in scripts to read user input in a blocking manner.
This also removes the unused `block` argument, which is always `true`.
- Calinou
badcfa2523
2023-02-07 01:07:31 +01:00
30d7a3c5a7 Backported: GLES2 fix octahedral half float unpacking
The strides in _unpack_half_floats() were incorrectly calculated in the case where octahedral normals and tangents were in use.
- lawnjelly
c6a428b3d6
2023-02-07 01:01:48 +01:00
2cd4e4d828 Renamed Set to RBSet. 2023-01-15 19:42:08 +01:00
1b0aac6028 Renamed Map to RBMap. 2023-01-15 19:12:50 +01:00
91e598aa7b Ported: SCons: Cleanup DEBUG, _DEBUG and NDEBUG defines
- `_DEBUG` is MSVC specific so it didn't make much sense to define for
  Android and iOS builds.
- iOS was the only platform to define `DEBUG`. We don't use it anywhere
  outside thirdparty code, which we usually don't intend to debug, so it
  seems better to be consistent with other platforms.
- Consistently define `NDEBUG` to disable assert behavior in both `release`
  and `release_debug` targets. This used to be set for `release` for all
  platforms, and `release_debug` for Android and iOS only.
- Due to the above, I removed the only use we made of `assert()` in Godot
  code, which was only implemented for Unix anyway, should have been
  `DEV_ENABLED`, and is in PoolAllocator which we don't actually use.
- The denoise and recast modules keep defining `NDEBUG` even for the `debug`
  target as we don't want OIDN and Embree asserting all over the place.
- akien-mga
b0b759e6da
2022-12-22 17:42:54 +01:00
norrath-hero
e1081d3d33 Fix GLES 2 Spotlight Bug
Fixes https://github.com/godotengine/godot/issues/69759
Fixes https://github.com/godotengine/godot/issues/54343
Fixes https://github.com/godotengine/godot/issues/25526
2022-12-22 14:38:33 +01:00