Commit Graph
3605 Commits
Author SHA1 Message Date
Skyth 83713504e4 Fix PCSS shadows using shadow range begin in the wrong space.
(cherry picked from commit 5afc91103c4ba88c668b42a887742ea81ee6d009)
2026-07-25 13:19:49 -05:00
Claire Blackshaw c1bef1e2c4 [Render] Crash Fix use-after-return instance shader parameter lists
(cherry picked from commit 1b414da560e2d02f41b448d6c016eea032d38a89)
2026-07-25 13:19:49 -05:00
Skyth 1f04e42d85 Fix local billboard particles running copy twice.
Co-authored-by: Qbieshay <cislaghi.ilaria@gmail.com>
(cherry picked from commit 87535e8f99d43b531d874105578ff9f96b9d0fa0)
2026-07-25 13:19:49 -05:00
Chaosus 34e3499e82 Fix hint_default_transparent used with sampler2DArray
(cherry picked from commit 8b25db8c0e7b030ba8c09db1563bfc3e89b6d0d5)
2026-07-04 11:03:31 -05:00
Heptagon 838717f61b Fix incorrect per-instance shader parameters when exporting in headless mode
(cherry picked from commit 552cca4e7702b5ef944e74b4c86d4656ac82aa46)
2026-07-04 11:03:30 -05:00
Image-unavailable 4578089638 Fix orthographic camera directional shadow culling
(cherry picked from commit 4182137b9d767a6f1aa82e24f97d1c5446778954)
2026-07-04 11:03:30 -05:00
Heptagon 050f64d099 Fix flickering lighting on mesh-instances with non-uniform scale
(cherry picked from commit 14ef289eeed444601dfedca99333180d44ac831f)
2026-06-30 09:15:11 -05:00
Skyth a113c9a453 Fix previous transform getting remembered for 2 frames after the instance stops moving.
(cherry picked from commit adb14a5397b02068bdece36f40abcaf69bee0bee)
2026-06-23 08:36:45 -05:00
Bryce Hutchings 8c88303aed Seek past skipped shader variant payload
(cherry picked from commit 3e997dbc88471940027125eba0f164bdb560dd0b)
2026-06-23 08:36:43 -05:00
Skyth 993de84b86 Zero out the memory of disabled directional lights.
(cherry picked from commit f94049f8d84f78d3107253d30a5ec181fbfad131)
2026-06-23 08:36:43 -05:00
Thomas ten Cate 6a97461a85 Suppress warning about missing mesh tangents if TANGENT is assigned in the shader
(cherry picked from commit d3219bdf0715933688aa30d33047e2b3229e8695)
2026-06-23 08:36:43 -05:00
Thaddeus Crews feeea39cb2 Merge pull request #120363 from blueskythlikesclouds/adreno-660-ubershader-workaround
Add workaround for Vulkan pipeline compilation errors on Adreno 660.
2026-06-17 12:34:23 -05:00
Thaddeus Crews 2301f36122 Merge pull request #120344 from bruvzg/area_light_shader_adreno
Inline `integrate_edge_hill` to work around Adreno shader compiler bug.
2026-06-17 12:34:16 -05:00
Skyth 823e2db6b1 Add workaround for Vulkan pipeline compilation errors on Adreno 660. 2026-06-17 15:39:27 +03:00
Pāvels Nadtočajevs 9fc8a9c0d8 Inline integrate_edge_hill to work around Adreno shader compiler bug. 2026-06-16 14:58:42 +03:00
Rangal 679b70a45f Fix the center of AreaLight3Ds being incorrect, per Sarcen on discord 2026-06-12 18:24:37 -07:00
Skyth af2fea0ad3 Fix leftover particle data when updating particle buffers.
Co-authored-by:  Skyth <19259897+blueskythlikesclouds@users.noreply.github.com>
2026-06-11 21:02:05 +02:00
HP van Braam 52f27370ab Fix a deadlock in CanvasRenderRD
RenderingServerDefault::_draw wants to get all of the materials. The threaded
loader is still loading the materials:

1) The main thread locks canvas_singleton->shader.mutex via
   RendererRD::Utilities::update_dirty_resources
    -> RendererRD::MaterialStorage::_update_queued_materials
      -> RendererCanvasRenderRD::CanvasMaterialData::update_parameters()
2) RendererCanvasRenderRD::CanvasMaterialData::update_parameters() wants
   to get the current shader via ShaderRD::version_get_shader. This
   eventually wants to wait on the load of that shader via
   WorkerThreadPool::wait_for_group_task_completion in
   ShaderRD::_compile_version_end

At this point the main thread is waiting for the threaded load to finish
loading the shader. Meanwhile in a thread not too far away the load is
progressing:

1) The loader is loading the tres in ResourceLoaderText::load which
   eventually wants to ShaderMaterial::set_shader
2) We eventually end up in RendererCanvasRenderRD::CanvasShaderData::set_code
3) set_code wants to lock canvas_singleton->shader.mutex to protect
   against concurrent compilation

At this point the main thread is waiting on the load to complete, but
holds "canvas_singleton->shader.mutex" via update_parameters(), and the
loader is waiting on "canvas_singleton->shader.mutex" in set_code.

Tragedy ensues etc.

To fix the problem we don't acquire the lock until after we're sure
we're done compiling the shader.

The same pattern exists in scene_shader_forward_clustered.cpp which
was created in the same commit as the code in the canvas singleton.

With this change the deadlock can no longer occur as set_code() can now run
concurrently with RenderingServerDefault::_draw() as the path where the
main thread waits on the workerthreadpool with
canvas_singleton->shader.mutex held can no longer occur.

Data integrity wise: previously you'd think that
canvas_singleton->shader.mutex would have protected against metadata
changes to uniforms, ubo_offsets, and texture_uniforms but set_code() used
to write to some of these (uniforms, ubo_size) without taking the lock with
no ill effects because the material isn't updated until the shader has loaded.

A similar pattern was found in scene_shader_forward_mobile.cpp and was
fixed in the same way.
2026-06-08 00:22:02 +02:00
Skyth 2896cd9ef4 Fix area light atlas also destroying VoxelGI uniform sets. 2026-06-03 20:04:49 +03:00
Skyth 48f9cf19af Put area light cluster iterations behind a spec constant. 2026-06-02 17:49:44 +03:00
Pāvels Nadtočajevs 586d613f43 Fix drawable texture access before null check. 2026-06-01 09:35:34 +03:00
Thaddeus Crews 243f3537ed Merge pull request #119639 from blueskythlikesclouds/adreno-disable-ubershader
Disable ubershaders on problematic Adreno compiler versions.
2026-05-25 11:19:00 -05:00
Thaddeus Crews 4354aa9806 Merge pull request #116203 from blueskythlikesclouds/shader-race-condition-fix
Fix `MaterialStorage::material_set_shader` race condition.
2026-05-25 11:18:59 -05:00
Thaddeus Crews 6c6d7c5ff6 Merge pull request #119587 from Calinou/taa-mobile-fix-jitter
Fix 3D rendering jittering when TAA is enabled in the Mobile renderer
2026-05-25 11:18:57 -05:00
Thaddeus Crews 12a102e93c Merge pull request #119401 from blueskythlikesclouds/rd-race-condition-fixes
Fix a few race conditions in RD.
2026-05-25 11:18:57 -05:00
Thaddeus Crews fa6cad230f Merge pull request #119665 from clayjohn/blit-screen-texture
Forbid using hint_screen_texture in unsupported shader types
2026-05-22 19:24:23 -05:00
Clay John 57ab62b421 Forbid using hint_screen_texture in unsupported shader types 2026-05-22 10:38:52 -07:00
Skyth c6987624ef Disable ubershaders on problematic Adreno compiler versions. 2026-05-21 22:13:32 +03:00
Hugo Locurcio eab6733f85 Fix 3D rendering jittering when TAA is enabled in the Mobile renderer
The Mobile renderer doesn't support TAA, but we still configured
the 3D buffers as if TAA was enabled after turning an error into
a warning previously.

This also adds a similar early return to screen-space AA when
on Compatibility to avoid unnecessary 3D buffer reconfiguration.
2026-05-21 03:37:26 +02:00
kleonc 7ec5fa2440 Fix y-sort modulation div by zero 2026-05-19 11:59:01 +02:00
Thaddeus Crews 1378c909f0 Merge pull request #117773 from Calinou/lightmapgi-fix-probe-interpolation-at-lightmap-edges
Fix LightmapGI probe interpolation at lightmap AABB edges
2026-05-14 09:06:52 -05:00
Thaddeus Crews ef7d768e65 Merge pull request #119375 from Chaosus/shader_fix_material_params
Fix shader crash when using parameter name identical to uniform name
2026-05-14 09:06:51 -05:00
Thaddeus Crews 1078619908 Merge pull request #119414 from clayjohn/legacy-fog-blend
Add project setting to disable new Volumetric fog blending behavior
2026-05-12 17:54:07 -05:00
Clay John c76223a35e Add project setting to disable new Volumetric fog blending behavior for existing projects that want to upgrade.
Setting is off by default, so its only intended for people who really need to rollback to the previous behavior.
2026-05-12 10:48:46 -07:00
Thaddeus Crews 872f2f073c Merge pull request #119337 from blueskythlikesclouds/sdfgi-barrier-fix
Fix undefined barrier usage in SDFGI preprocess shader.
2026-05-11 10:59:47 -05:00
Skyth 61c16d62c6 Fix a few race conditions in RD. 2026-05-11 15:33:48 +03:00
Chaosus 82ffafa399 Fix shader crash when using parameter name identical to uniform name 2026-05-11 11:57:18 +03:00
Skyth c22117dacd Fix null uniform set error when enabling SDFGI. 2026-05-08 17:28:22 +03:00
Skyth 0bba587614 Fix undefined barrier usage in SDFGI preprocess shader. 2026-05-08 17:10:58 +03:00
Thaddeus Crews aaaf76403e Merge pull request #119223 from Calinou/render-timestamp-add-setup-shadows
Add Setup Shadows render timestamp for the visual profiler
2026-05-07 16:22:28 -05:00
Thaddeus Crews ce26629ff5 Merge pull request #119230 from stuartcarnie/compute_barrier_before_end
Rendering: Remove `compute_list_add_barrier` before `compute_list_end`
2026-05-07 16:22:28 -05:00
Thaddeus Crews 96c9b3e8aa Merge pull request #119304 from stuartcarnie/fix_issue_118918
Rendering: Zero uninitialized InstanceData fields
2026-05-07 16:22:27 -05:00
Thaddeus Crews d51d1ec682 Merge pull request #119289 from Calinou/gpu-index-compatibility-warn-unsupported
Warn about `--gpu-index` CLI argument being unsupported in Compatibility
2026-05-07 11:13:31 -05:00
Stuart Carnie 64a1a66a14 Rendering: Zero double InstanceData fields
Root cause was unitinitialised stack variable.

I was able to reproduce by enabling this build-flag:

```
-ftrivial-auto-var-init=pattern
```

which initialises stack allocated variables with hostile values.

Closes #118918
2026-05-07 19:06:42 +10:00
Thaddeus Crews fddd45ea1c Merge pull request #119091 from ArchercatNEO/context-driver-surface-supports-hdr
HDR: Implement checking if surface supports HDR output.
2026-05-06 14:56:27 -05:00
ArchercatNEO 3f29efc8a2 HDR: Implement surface supports HDR output.
Previously the Wayland display server would attempt to enable
HDR output and try to detect if it failed afterwards which had some issues.
Now we can query the rendering driver for support and avoid ever enabling
HDR output when this would fail.
2026-05-06 19:51:54 +01:00
Hugo Locurcio a96279db3e Warn about --gpu-index CLI argument being unsupported in Compatibility
- Print a warning when `--gpu-index` is out of range in RenderingDevice-based
  renderers, since it falls back to automatic GPU selection.

The GPU selection logic is only available in RenderingDevice-based renderers.
2026-05-06 19:23:14 +02:00
Stuart Carnie 0b561521fe Rendering: Remove compute_list_add_barrier before compute_list_end
`compute_list_add_barrier` ends and begins a new compute list with the
same state, so calling this immediately before `compute_list_end` is
redundant, and ends up creating empty compute encoders in Metal.
2026-05-05 06:41:06 +10:00
Hugo Locurcio 376bea65e0 Add Setup Shadows render timestamp for the visual profiler
- Rename shadow timestamp to clarify it's for directional and spot shadows.
- Fix Render OmniLight Shadows timestamp being visible even when no
  omnilight shadows are being rendered.
2026-05-04 19:30:14 +02:00
Stuart Carnie 0043c950f6 Rendering: Fix priority sort table 2026-05-04 06:50:46 +10:00