Commit Graph

4161 Commits

Author SHA1 Message Date
Fabio Alessandrelli
c831f635fe [Web] Implement dummy IPWeb instead of IPUnix
Note: This commit ties the IPUnix to the UNIX_SOCKET_UNAVAILABLE define,
disabling it when set. It is maybe not semantically correct (getifaddrs)
is not part of the "socket" API, but it's reasonable to expect that a
platform not supporting Unix-style sockets, would also not support other
Unix network functions.
2024-11-28 20:47:18 +01:00
Thaddeus Crews
6e533b5ee4
Merge pull request #99606 from jamie-pate/fix_99592
Fix gl_compatibility lightmap uniforms not being set
2024-11-27 10:46:58 -06:00
mrsaturnsan
627d10e4c4 Fix vsync on macOS getting disabled when using afterMinimumDuration 2024-11-26 15:38:32 -06:00
Thaddeus Crews
127738c08b
Merge pull request #99387 from 0x0ACB/direct_composition
Use direct composition for d3d12 backend
2024-11-26 13:04:53 -06:00
0x0ACB
a8cd0e9677
Use direct composition for d3d12 backend 2024-11-26 10:28:40 +01:00
Jamie Pate
45a7bcc477 Fix gl_compatibility lightmap uniforms not being set
Fixes #99592

The following variables were set too early, and later code never ran..
prev_shader, prev_variant, prev_spec_constants variables

These variables were shared in two different branch conditions but were
updated inside the first one, so the second could never be true..

The condition to update lighting also should check prev_spec_constants
since it updates that uniform.
2024-11-23 16:43:07 -08:00
Pāvels Nadtočajevs
e9b57fce82 Convert line breaks to \n and strip line break from the end of string returned by OS::read_string_from_stdin/OS::get_stdin_string. 2024-11-23 15:11:50 +02:00
Thaddeus Crews
dcb59f0e7e Merge pull request #99548 from Repiteo/style/clang-format-19-options
Style: Add 19.1.0 LLVM options to `.clang-format`
2024-11-22 14:54:29 -06:00
Thaddeus Crews
e8a4b45ce4
Style: Add 19.1.0 LLVM options to .clang-format 2024-11-22 09:24:32 -06:00
clayjohn
2b68c63a88 Mask out shadows on CanvasItems that don't have a matching item_shadow_mask
This restores the behavior from 3.x
2024-11-21 22:15:54 -08:00
Thaddeus Crews
030cc69771
Merge pull request #96399 from andyprice/fileperms
Unix: Don't create world-writable files when safe save is enabled
2024-11-21 17:56:53 -06:00
Thaddeus Crews
8eee5066eb
Merge pull request #94981 from Chaosus/shader_fix_screen_uv_in_spatial_light
Allow `SCREEN_UV` to be used in light function of spatial shader
2024-11-21 17:56:45 -06:00
Chaosus
a64b3fd3f8 Allow SCREEN_UV to be used in light function of spatial shader 2024-11-19 11:39:49 +03:00
Alexander Hartmann
8e170248b3 Fix: Error output is not require, VK_QUEUE_TRANSFER_BIT is optional. 2024-11-19 03:01:07 +01:00
Thaddeus Crews
fd4c29a189
Merge pull request #98683 from clayjohn/wireframe
Ensure shadow material and mesh are not used with wireframe mode
2024-11-18 09:23:54 -06:00
Thaddeus Crews
0a50cef751
Merge pull request #98788 from Bonkahe/master
Add `multimesh_get_buffer_rd_rid` method to `RenderingServer`.
2024-11-18 09:23:46 -06:00
Thaddeus Crews
1dcb686325
Merge pull request #99026 from Faless/net/split_ip
[Net] Split Unix/Windows IP implementation
2024-11-18 09:23:43 -06:00
Thaddeus Crews
2dbf195af5
Merge pull request #98983 from nikitalita/patch-2
Prevent stack-use-after-scope in rendering_device_driver_metal.mm
2024-11-18 09:23:33 -06:00
Thaddeus Crews
6330db475f
Merge pull request #87558 from clayjohn/GLES3-canvas-spec
Reduce shader permutations in the compatibility backend
2024-11-18 09:23:29 -06:00
A Thousand Ships
68f638cf02
Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
clayjohn
90b4b48b5a Ensure shadow material and mesh are not used with wireframe mode
And in the Compatibility renderer actually use the wireframe render mode
2024-11-16 22:25:00 -08:00
clayjohn
c810ea4c1b Reduce shader permutations in the compatibility backend 2024-11-15 23:13:33 -08:00
Chris
fb75078308 Changed some image error messages to print the file path 2024-11-15 20:42:03 +01:00
Stuart Carnie
9c2ca820f2
Metal: Ensure position invariance is captured from SPIRV-Cross
Closes #99029
2024-11-15 14:06:32 +11:00
David House
6e9d31f602 Implemented multimesh_get_buffer_rd_rid function into RenderingServer.
Fixed style error.

Updated dummy mesh_storage to move from cpp to h the return of a blank Rid on _multimesh_get_buffer_rd_rid.
2024-11-14 15:52:08 -06:00
Thaddeus Crews
48d13ca11b
Merge pull request #99041 from mrsaturnsan/metal_frame_pacing
Use afterMinimumDuration to correct frame pacing
2024-11-14 14:51:49 -06:00
Thaddeus Crews
15d09a5767
Merge pull request #99149 from mrsaturnsan/set_max_fps_fix
Fix max FPS initialization
2024-11-13 08:34:21 -06:00
Thaddeus Crews
150590a7e8
Merge pull request #98975 from clayjohn/D3D12-event-timing
Move D3D12 fence `SetEventOnCompletion` call to `fence_wait` to avoid stalling on some platforms
2024-11-13 08:33:55 -06:00
Fabio Alessandrelli
fc52821cfb [Net] Properly rename NetSocketPosix to NetSocketUnix 2024-11-13 10:27:01 +01:00
mrsaturnsan
376c6c0c7d Use afterMinimumDuration to correct frame pacing 2024-11-12 21:19:38 -06:00
mrsaturnsan
4b94162320 Fix max FPS initialization
Remove unnecessary get_max_fps
2024-11-12 21:10:27 -06:00
Thaddeus Crews
179321a0a3
Merge pull request #91201 from bruvzg/con_type
[OS] Add functions to determine standard I/O device type.
2024-11-12 12:13:12 -06:00
Fabio Alessandrelli
168a2a1466 [Net] Split Unix/Windows IP implementation 2024-11-12 17:33:47 +01:00
Thaddeus Crews
1cbe9715ea
Merge pull request #98969 from Faless/net/split_sockets
[Net] Split Unix/Windows NetSocket implementation
2024-11-12 09:27:40 -06:00
tetrapod00
899f5151c3 Standardize terms for renderers in error strings
Use "Forward+", "Mobile", "Compatibility", and "renderer" or "rendering method".
2024-11-10 13:30:44 -08:00
Pāvels Nadtočajevs
c363e13051 [Windows] Rename PKEY_Device_FriendlyName to avoid duplicate symbols with newer MinGW SDKs. 2024-11-10 21:46:10 +02:00
Thaddeus Crews
246e8e9ecc
Merge pull request #98803 from stuartcarnie/metal_multiview
Metal: Multiview support
2024-11-10 12:13:02 -06:00
Thaddeus Crews
b80aa65467
Merge pull request #98927 from fire/warn-file-case-mismatch
Warn on filesystem case mismatch
2024-11-10 12:13:01 -06:00
Thaddeus Crews
bbde4ed324
Merge pull request #98883 from ducklin5/fix/VkResultError
Add vulkan error checks in command_queue_execute_and_present
2024-11-10 12:12:41 -06:00
Thaddeus Crews
2b02143d35
Merge pull request #98307 from clayjohn/Light2D-shadow-projection
Precompute projection matrices when rendering 2D shadows
2024-11-10 12:12:14 -06:00
Fabio Alessandrelli
0c620b29cd [Net] Split Unix/Windows NetSocket implementation 2024-11-10 16:13:50 +01:00
nikitalita
78895c709c
Prevent stack-use-after-scope in rendering_device_driver_metal.mm 2024-11-09 00:07:33 -06:00
Valentin Cocaud
c09731c413 Warn on filesystem case mismatch
When a file is opened with a wrong case, it can work on the developer system but break on a user system with a case-sensitive filesystem.

This will display a warning when it happens.

CAVEATS: It will also display the warning if a symlink is in the path.

Adapt warning if the file is a symlink. Avoid warning on symlinks.

Fix memory leak and avoid `lstat` usage.

Avoid exposing real_path when not in TOOLS_ENABLED mode.
2024-11-08 14:23:41 -08:00
clayjohn
05576a2324 Move D3D12 fence SetEventOnCompletion call to fence_wait to avoid stalling on some platforms 2024-11-08 13:20:05 -08:00
Pedro J. Estébanez
a5f86ee07e Raise the amount of file handles on Windows 2024-11-07 12:13:08 +01:00
Azeez Abass
ddf5c03f4b fix: add vulkan error checks in command_queue_execute_and_present
fix: add debug helper functoin and update messaging vulkan result
2024-11-06 22:13:20 +00:00
bruvzg
76164c2aa9
[OS] Add functions to determine standard I/O device type. 2024-11-06 13:33:38 +02:00
Stuart Carnie
3dac3887e9
Metal: Multiview support
* Adds support for multiview
* Returns native handles for more driver resources
2024-11-06 05:37:35 +11:00
Trevor Davenport
a5070af460 Account for the case surface_capabilities.currentExtent is unset
Wayland in particular sets surface_capabilities.currentExtent.width to
the special value 0xFFFFFFFF, which is valid per spec.
Fixes #98779

It may also fix misc issues when resizing on all platforms.

Superseedes PR #98780 , thanks to user tdaven for the original patch.
PR #98780 would break Android support as it did not account that width
and height might need to be swapped.

Replaced manual swap by Godot's SWAP(), which indicates intention much
easier.
2024-11-05 11:52:26 -03:00
Thaddeus Crews
88d9903f6d
Merge pull request #86138 from EnlightenedOne/master
Fix Frustum Sky projection translation logic shearing
2024-11-04 21:52:07 -06:00
Thaddeus Crews
2450dee1bc
Merge pull request #93401 from Repiteo/style/clang-tidy-fixes
Style: Apply `clang-tidy` fixes
2024-11-04 21:52:05 -06:00
Thaddeus Crews
8536506bf2
Merge pull request #98774 from dustdfg/scons_use_glob_remove_stale_check
Delete stale check, make SCons support globbing with `#` inside path
2024-11-04 21:52:02 -06:00
Thaddeus Crews
2b49543478
Merge pull request #98709 from darksylinc/matias-upsidedown-splash
Fix splash screen upside down on Android
2024-11-04 21:52:01 -06:00
Thaddeus Crews
edc60c63f1
Merge pull request #98701 from DarioSamo/rd-graph-improvements
Add dependency detection improvements to the render graph.
2024-11-04 21:51:58 -06:00
Thaddeus Crews
11b90086b7
Merge pull request #96705 from elmajime/camera_from_external_feed
Add support for external camera feed from external plugin on Android
2024-11-04 21:51:50 -06:00
Thaddeus Crews
bb5f390fb9
Style: Apply clang-tidy fixes (superficial)
• `modernize-use-bool-literals`, `modernize-use-nullptr`, and `readability-braces-around-statements`
2024-11-04 12:11:14 -06:00
Thaddeus Crews
89a311205f
Style: Apply clang-tidy fixes
• `modernize-use-default-member-init` and `readability-redundant-member-init`
• Minor adjustments to `.clang-tidy` to improve syntax & remove redundancies
2024-11-04 12:11:06 -06:00
EnlightenedOne
1d141ab32a Fix Frustum Sky projection translation logic, all pipelines, fixes 63863 2024-11-02 21:34:55 +00:00
Yevhen Babiichuk (DustDFG)
81a032337c Deleted stale check. Now SCons supports globbing with # inside path
Some parts of the buildsystem already were using it with `#` in path

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
2024-11-02 22:20:17 +02:00
Dario
5216ef5f9c Add dependency detection improvements to the render graph.
- Buffers changing their usage are no longer treated as write usage unless the API requires it.
- Draw lists are not treated as being dependent on each other if their regions do not intersect despite both being write commands.
- Particles were tweaked to use different unused buffers to reduce dependencies.
2024-11-01 09:46:52 -03:00
Matias N. Goldberg
b9a2f108fc Fix splash screen upside down on Android
Fixes an issue introduced in #96439 (see
https://github.com/godotengine/godot/pull/96439#issuecomment-2447288702)

Godot was relying on Java's
activity.getWindowManager().getDefaultDisplay().getRotation(); to apply
pre-rotation but this is wrong.

First, getRotation() may temporarily return a different value from the
correct one; which is what was causing the splash screen to be upside
down. It would return -90 instead of 90 for the first rendered frame.

But unfortunately, the splash screen is just one frame rendered for a
very long time, so the error lingered for a long time for everyone to
see.

Second, to determine what rotation to use, we should be looking at what
Vulkan told us, which is the value we pass to
VkSurfaceTransformFlagBitsKHR::preTransform.

This commit removes the now-unnecessary
screen_get_internal_current_rotation() function (which was introduced by
#96439) and now saves the preTransform value in the swapchain.
2024-10-31 16:52:26 -03:00
maxime.chambefort
6f846eb5c5 Added external camera feed from external plugin on Android 2024-10-30 18:30:28 +01:00
clayjohn
940e9c2a43 Revert "Fix GPUParticles are not rendered for older AMD GPUs with OpenGL+Angle"
This reverts commit 9cc9df52eb.

This also adds a fallback to avoid using the Godot versions of the half 2 float functions when using ANGLE.
2024-10-29 22:17:16 -07:00
Thaddeus Crews
73830b3c12
Merge pull request #88628 from bruvzg/i_have_no_idea_what_im_doing
[macOS/iOS] Use hardware sampling rates for audio I/O.
2024-10-29 19:25:47 -05:00
Thaddeus Crews
b7a0971ad2
Merge pull request #97934 from adamscott/give-AThousandShips-a-break
[Codestyle] Set clang-format `RemoveSemicolon` rule to `true`
2024-10-29 19:25:36 -05:00
Clay John
748f4079e3
Merge pull request #96439 from darksylinc/matias-TheForge-pr03-rebased
Add Swappy & Pre-Transformed Swapchain
2024-10-29 12:34:40 -07:00
Matias N. Goldberg
aaa0e2fddf Add Swappy & Pre-Transformed Swapchain
- Adds Swappy for Android for stable frame pacing
- Implements pre-transformed Swapchain so that Godot's compositor is in
charge of rotating the screen instead of Android's compositor
(performance optimization for phones that don't have HW rotator)

============================

The work was performed by collaboration of TheForge and Google. I am
merely splitting it up into smaller PRs and cleaning it up.

Changes from original PR:

- Removed "display/window/frame_pacing/android/target_frame_rate" option
to use Engine::get_max_fps instead.
- Target framerate can be changed at runtime using Engine::set_max_fps.
- Swappy is enabled by default.
- Added documentation.
- enable_auto_swap setting is replaced with swappy_mode.
2024-10-28 18:55:37 -03:00
Clay John
683d11a69f
Merge pull request #98279 from Calinou/vulkan-d3d12-silence-using-present-mode
Remove "Using present mode" verbose prints in Vulkan and Direct3D 12
2024-10-27 19:24:35 -07:00
Thaddeus Crews
edad871a2d
Merge pull request #98425 from darksylinc/matias-breadcrumbs-race-fix
Fix race conditions in breadcrumbs
2024-10-25 13:04:12 -05:00
Thaddeus Crews
07e759b74a
Merge pull request #97771 from dsnopek/openxr-linux-egl
OpenXR: Add support for Wayland on Linux
2024-10-25 13:04:08 -05:00
Adam Scott
0d350e7108
Set clang-format RemoveSemicolon rule to true
- Set clang-format `Standard` rule to `c++20`
2024-10-25 13:49:43 -04:00
bruvzg
c8609f4c0f
[macOS/iOS] Use hardware sampling rates for audio I/O. 2024-10-25 19:26:24 +03:00
Yuri Rubinsky
6732a0fd86
Merge pull request #98448 from Chaosus/shader_global_builtins
Make `OUTPUT_IS_SRGB/CLIP_SPACE_FAR` shader built-ins global
2024-10-25 13:55:14 +03:00
Clay John
a1c7998d5f
Merge pull request #98305 from cadence-s/fix-ios-audio-driver-error
Fix iOS audio driver attempting to start output too early
2024-10-24 19:40:34 -07:00
Thaddeus Crews
cfc05c5e0f
Merge pull request #85338 from EMBYRDEV/shadow-caster-mask
Add `shadow_caster_mask` to Light3D.
2024-10-24 13:22:59 -05:00
Chaosus
463e81413e Make OUTPUT_IS_SRGB/CLIP_SPACE_FAR shader built-ins global 2024-10-24 12:32:05 +03:00
Matias N. Goldberg
668c9b74e2 Fix race conditions in breadcrumbs
Adds "--accurate-breadcrumbs" CLI command

Additionally, leave out breadcrumbs code in non-debug, non-dev builds.
Fix regression introduced in #98388 where command_insert_breadcrumb() is
called even in non-debug builds.

Fixes #98338
2024-10-22 22:08:46 -03:00
Thaddeus Crews
7815ccbdd5
Merge pull request #98294 from Calinou/texture-placeholders-use-shared-copy
Use a shared copy of placeholder textures, tweak placeholder appearance
2024-10-21 16:39:29 -05:00
Thaddeus Crews
a14e9e99e5
Merge pull request #98388 from DarioSamo/sync-fixes
Improve synchronization of rendering after changes from transfer queues.
2024-10-21 16:39:21 -05:00
Thaddeus Crews
291e4b78e2
Merge pull request #98237 from dustdfg/os_transitive_image_headers_refactor
Don't include `core/io/image.h` in `core/os/os.h`
2024-10-21 16:39:15 -05:00
Thaddeus Crews
4630cbc487
Merge pull request #98212 from stuartcarnie/sgc/metal_improvements
Metal: Performance improvements and bug fixes
2024-10-21 16:39:09 -05:00
Dario
4ad424234f Improve synchronization of rendering commands after changes from transfer queues.
Fix an error where barriers are expected to be inserted for the swap chain textures.
Add the relevant synchronization stages and accesses to resources between frames.
Fix an error where debug labels weren't finished correctly between frames.
Breadcrumbs are now behind an optional macro as they currently lead to synchronization errors which are harmless.
2024-10-21 11:27:56 -03:00
Stuart Carnie
83ac274e25
Metal: Performance improvements and bug fixes 2024-10-20 11:15:13 +11:00
clayjohn
62516df757 Precompute projection matrices when rendering 2D shadows 2024-10-18 11:55:00 -07:00
Cadence
b4fd9d1f38 Fix iOS audio driver attempting to start output too early 2024-10-18 13:05:30 -04:00
Yevhen Babiichuk (DustDFG)
af6d260c17 Don't include core/io/image.h in core/os/os.h
`core/os/os.h` doesn't use `core/io/image.h`. It just brings
transitive dependencies. Lots of dependencies because `core/os/os.h`
is transitively included in almost every file of godot

Also added `core/io/image.h` into files^1 where `Ref<Image>` and `core/os/os.h`
were used to prevent obscure errors involving `Ref<Image>`

^1 except those which include `core/io/image_loader.h` or `core/io/image.h` by
corresponding .h file with the same name

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-10-18 19:04:19 +03:00
Hugo Locurcio
35a20fa96a Use a shared copy of placeholder textures, tweak placeholder appearance
This reduces memory usage a bit in case multiple placeholders were
requested, e.g. when using multiple NoiseTextures with no noise property
defined.

The placeholder texture's appearance was also changed from a plain magenta
color to a checkerboard alternating between magenta and black pixels.
This makes it easier to spot when the placeholder texture ends up
being used in a complex scene (usually by accident).
The texture's dimensions remain identical to keep the physical size
identical in 2D.
2024-10-18 14:51:51 +02:00
Dario
8c3e46b13b Move transitions of textures initialized by transfer workers to the main graphics queue.
Also adds a new possible texture layout and API trait to support a particular behavior in D3D12 where only the COMMON layout is supported in copy queues. Fixes #98158.
2024-10-18 09:15:25 -03:00
Hugo Locurcio
5ed10e3604 Remove "Using present mode" verbose prints in Vulkan and Direct3D 12
These messages were printed every time the swapchain was recreated
(e.g. on viewport size change), which could easily end up spamming
the output.

The chosen present mode is already displayed when using the Print FPS
project setting or command line argument.
2024-10-17 23:18:28 +02:00
Thaddeus Crews
bb20444998
Merge pull request #97744 from Nazarwadim/use_local_vector_for_skeleton
Use `LocalVector` for skeleton
2024-10-10 18:13:19 -05:00
Thaddeus Crews
16dfaa5e80
Merge pull request #94952 from alvinhochun/angle-d3d11-flip-y
Optimize ANGLE on D3D11 to remove an extra blit
2024-10-10 18:13:17 -05:00
Thaddeus Crews
a44f691fc7
CI: Add MinGW/GCC build to Windows GHA 2024-10-10 10:10:55 -05:00
Clay John
842f982397
Merge pull request #96819 from clayjohn/GLES3-instance-uniforms
Implement instance uniforms in Compatibility renderer
2024-10-07 13:41:47 -06:00
Clay John
e7c39efdb1
Merge pull request #97309 from kroketio/metal-expose-device-handle
Metal: expose MTLDevice
2024-10-07 11:00:53 -06:00
David Snopek
256699ee31 OpenXR: Add support for Wayland on Linux 2024-10-04 11:44:05 -05:00
Rémi Verschelde
c46d1e4540
Merge pull request #97552 from dustdfg/drivers/use_dedicated_print_error
Use dedicated `print_error` method for colored output for unsupported drivers
2024-10-04 17:18:14 +02:00
Rémi Verschelde
f032af7453
Merge pull request #97304 from kroketio/metal-return-logical-device-handle
Metal: Implement `texture_create_from_extension`
2024-10-04 12:58:38 +02:00
Rémi Verschelde
6e03910578
Merge pull request #97719 from bruvzg/cross_dev_rename
[Linux/BSD] Fix cross-device rename.
2024-10-04 11:21:58 +02:00
Dario
e2c6daf7ef Implement asynchronous transfer queues, thread guards on RenderingDevice. Add ubershaders and rework pipeline caches for Forward+ and Mobile.
- Implements asynchronous transfer queues from PR #87590.
- Adds ubershaders that can run with specialization constants specified as push constants.
- Pipelines with specialization constants can compile in the background.
- Added monitoring for pipeline compilations.
- Materials and shaders can now be created asynchronously on background threads.
- Meshes that are loaded on background threads can also compile pipelines as part of the loading process.
2024-10-02 15:11:58 -03:00
Nazarii
1ba168fcbc Use local vector for skeleton 2024-10-02 20:38:40 +03:00