Commit graph

187 commits

Author SHA1 Message Date
Yyf2333
282e4544b0 Split VariantCaster from binder_common.h 2026-03-10 17:59:33 +08:00
Rémi Verschelde
8c0f175c94
Decouple RenderingServer from as much of the codebase as possible
Notably decouples it from:
- AccessibilityServer
- DisplayServer
- Viewport
- Window
2026-03-03 12:48:07 +01:00
Rémi Verschelde
a447ac95ec
Move DisplayServer enums and typedefs to DisplayServerEnums
This will allow decoupling `display_server.h` from a number of headers in the
codebase which only require those enums and not all the DisplayServer API.
2026-03-03 12:44:02 +01:00
DDarby-Lewis
bf326793ba
Editor additions for MipMaps and rd_textures 2026-02-27 08:38:13 -06:00
Antonio Caggiano
ba71e30579
Tie scratch buffers to acceleration structures
The scratch buffer is never exposed to the user, it is only used
internally and it is managed by the acceleration structure itself.
2026-02-16 11:00:28 +01:00
Thaddeus Crews
2d5b30c476
Merge pull request #115963 from blueskythlikesclouds/reduce-includes-to-rd
Reduce includes to rendering device.
2026-02-12 08:19:16 -06:00
Josh Jones
b8389cc76b Support output to HDR monitors
Co-authored-by: Alvin Wong <alvinhochun@gmail.com>
Co-authored-by: Allen Pestaluky <allenpestaluky@gmail.com>
2026-02-11 22:13:26 -07:00
Skyth
8fbf2f1e14 Reduce includes to rendering device.
Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
2026-02-10 16:58:50 +03:00
Skyth
de7fcfaf3b Fix transfer worker race condition. 2026-02-04 16:15:41 +03:00
Nintorch
eb019511ed Optimize files that #include input.h header 2026-01-28 14:21:00 +05:00
Thaddeus Crews
04a2ae7ed4
Merge pull request #99119 from Fahien/fahien/raytracing-base
Vulkan raytracing plumbing
2026-01-27 15:18:24 -06:00
Antonio Caggiano
27e4f24800
raytracing: Initial Vulkan support
- Vulkan implementations in `RenderingDeviceDriverVulkan`.
- Raytracing instruction list in `RenderingDeviceGraph`.
- Functions to create acceleration structures and raytracing pipelines
  in `RenderingDevice`.
- Raygen, Miss, and ClosestHit shader stages support.
- GDScript bindings.
- Update classes documentation.
- Unimplemented placeholders for Metal and D3D12.
- Build acceleration structure command.
- Expose a shader preprocessor define.
- Align build scratch address.
- Create STB after creating the pipeline.
- Separate acceleration structure barriers.
- Use transforms in TLAS instances.
- AnyHit and Intersection stages.
- Optionally set acceleration structure build input buffer usage.
- Introduce instances buffer.
- Move scratch buffers to RenderingDevice.
- Rename AccelerationStructureGeometryBits.
- Use regular buffer creation and free routines for scratch buffer.
- Store trackers in acceleration structures.
- Bump Shader SPIR-V version to 1.4
- Add Position attribute location in blas_create.
- Encapsulate MoltenVK check in preprocessor macro.
- Split SUPPORTS_RAYTRACING for pipeline and query.
2026-01-27 16:17:45 +01:00
Dario
c2b068d08c Fix stale reference bug in FramebufferCache. 2026-01-23 10:43:09 -03:00
Rémi Verschelde
bc6f6a6358
Merge pull request #113842 from blueskythlikesclouds/rd-depth-clear-on-first-use
Clear depth stencil textures on first use if the RDD requires it.
2026-01-06 10:59:42 +01:00
Fredia Huya-Kouadio
be24804e1a Trigger save of the RD pipeline cache on application pause 2025-12-30 19:25:29 -08:00
Skyth
83af078761 Clear depth stencil textures on first use if the RDD requires it. 2025-12-15 18:34:43 +03:00
Allen Pestaluky
f37edd524f Fix clear color being incorrect in Environment background with HDR 2D. 2025-11-26 16:11:57 -05:00
Dario
d17ea061bc Move D3D12's automatic texture clears to RenderingDevice. 2025-11-25 09:34:38 -03:00
Thaddeus Crews
9a8b9e5c24
Merge pull request #113010 from blueskythlikesclouds/persistent-map-staging-buffers
Persistently map staging buffers.
2025-11-24 16:00:04 -06:00
Skyth
f5bbd71dfc Persistently map staging buffers. 2025-11-20 14:32:55 +03:00
Bastiaan Olij
21ffbecfa9 Resolve depth buffer in pass if supported by driver 2025-11-17 17:29:38 +11:00
Stuart Carnie
90c0e6acca 2D: Switch to VBOs for instance data
- Add support for vertex bindings and UMA vertex buffers in D3D12.
- Simplify 2D instance params and move more into per-batch data to save
  bandwidth

Co-authored-by: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com>
Co-authored-by: Clay John <claynjohn@gmail.com>
Co-authored-by: A Thousand Ships <96648715+athousandships@users.noreply.github.com>
2025-11-15 06:25:49 +11:00
Stuart Carnie
230adb7511 Add Persistent Buffers
This work is a heavily refactored and rewritten from TheForge's initial
code.

TheForge's original code had too many race conditions and was
fundamentally flawed as it was too easy to incur into those data races
by accident.

However they identified the proper places that needed changes, and the
idea was sound. I used their work as a blueprint to design this work.

This PR implements:

 - Introduction of UMA buffers used by a few buffers
(most notably the ones filled by _fill_instance_data).

Ironically this change seems to positively affect PC more than it does
on Mobile.

Updates D3D12 Memory Allocator to get GPU_UPLOAD heap support.

Metal implementation by Stuart Carnie.

Co-authored-by: Stuart Carnie <stuart.carnie@gmail.com>
Co-authored-by: TheForge team
2025-10-24 08:16:19 +11:00
Dario
af584b1ba8 Do not begin a new frame during RenderingDevice's shutdown. 2025-10-16 13:47:18 -03:00
Stuart Carnie
a281e91c5a Metal: Fix texture_get_data other linear formats
Introduce a specialised `texture_get_data` for `RenderDeviceDriver`,
which can retrieve the texture data from the GPU driver for shared
textures (`TEXTURE_USAGE_CPU_READ_BIT`).

Closes #108115
2025-10-16 06:46:51 +11:00
Aaron Franke
3d1c9fd5de
Move server files into their subfolders 2025-09-30 19:39:39 -07:00
Aaron Franke
9fbf5808a0
Rename server "free" functions to "free_rid" to match exposed API 2025-09-30 16:52:25 -07:00
Dario
8c4180adf4 Add GENERAL resource usage to the render graph. Fixes texture initialization in D3D12. 2025-09-02 15:18:47 -03:00
Lukas Tenbrink
2b36c79f7b Use Span<uint8_t> in RenderingDevice allocation APIs to avoid intermediary arrays on calls. 2025-06-18 12:31:48 +02:00
Thaddeus Crews
de37627404
Merge pull request #102552 from DarioSamo/shader-baker
Add shader baker to project exporter.
2025-05-28 17:09:38 -05:00
Stuart Carnie
7d93119353 Renderer: Eliminates String allocations for all labels in the renderer
Uses `Span<char>` to avoid additional allocations in the graph.
2025-05-28 06:01:35 +10:00
Dario
5a30a7e7cd Add shader baker to project exporter.
Metal Support contributed by Migeran (https://migeran.com) and Stuart Carnie.

Co-authored-by: Stuart Carnie <stuart.carnie@gmail.com>
Co-authored-by: Gergely Kis <gergely.kis@migeran.com>
2025-05-27 12:45:27 -03:00
Sander
6ae50cad17 RenderingDevice: introduce parameter 'mipmaps' for texture_create_from_extension() 2025-05-07 15:15:55 +03:00
Thaddeus Crews
b743eb96e3
Merge pull request #98760 from ze2j/optimize_texture_create_shared_from_slice
Optimize shared texture creations
2025-04-18 12:21:25 -05:00
Thaddeus Crews
98aced4e65
Merge pull request #99768 from dsnopek/openxr-vulkan-foveated-rendering
OpenXR: Use the `XR_FB_foveation_vulkan` extension to get the density map for VRS
2025-04-17 09:14:23 -05:00
Thaddeus Crews
0d267e7b1e
Core: Add dedicated BitField template 2025-04-11 11:53:26 -05:00
David Snopek
79f5a4d9fe OpenXR: Use the XR_FB_foveation_vulkan extension to get the density map for VRS 2025-03-31 07:21:58 -05:00
Rémi Verschelde
408d07109b
Merge pull request #99551 from DarioSamo/fragment-density-map
Implement Fragment density map support.
2025-03-28 14:31:19 +01:00
Dario
76d709be74 Implement support for fragment density maps.
Co-Authored-By: Bastiaan Olij <mux213@gmail.com>
2025-03-24 11:50:04 -05:00
clayjohn
4cf9d58dce Clean up more dynamic allocations in the RD renderers with a focus on 2D. 2025-03-10 13:16:12 -07:00
ze2j
6413a8a94b Optimize shared texture creation
Texture::slice_trackers is now a pointer and is allocated on demand only when a shared texture is created.
This makes copying Texture significantly faster.
2025-03-10 20:16:50 +01:00
Thaddeus Crews
bf6031890e
Merge pull request #103814 from darksylinc/matias-update_perf_report-speedup
RenderingDevice: Delay expensive operations to `get_perf_report`
2025-03-09 09:05:24 -05:00
Matias N. Goldberg
21133425cc Delay expensive operations to get_perf_report
The function update_perf_report() is expensive and is called every
frame.
Most of it is not necessary unless the user calls get_perf_report

Affects #102173
2025-03-08 11:25:46 -03:00
clayjohn
5efcd64b23 Reduce per-frame memory allocations from the heap in the Mobile renderer. 2025-03-07 22:01:24 -08:00
Thaddeus Crews
324512e11c
Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
Matias N. Goldberg
af900a5825 Change how device address is requested to avoid future API breakage
PR #100062 introduced BUFFER_USAGE_DEVICE_ADDRESS_BIT.

However it did so by adding a boolean to uniform_buffer_create(), called
"bool p_enable_device_address".

This makes maintaining backwards compatibility harder because I am
working on another feature that would require introducing yet another
bit flag.

This would save us the need to add fallback routines when the feature I
am working on makes it to Godot 4.5.

Even if my feature doesn't make it to 4.5 either, this PR makes the
routine more future-proof.

This PR also moves STORAGE_BUFFER_USAGE_DEVICE_ADDRESS into
BUFFER_CREATION_DEVICE_ADDRESS_BIT, since it's an option available to
both storage and uniforms.

This PR also moves the boolean use_as_storage into
BUFFER_CREATION_AS_STORAGE.
2025-02-11 20:00:18 -03:00
thimenesup
3d92f406b2 Implement Buffer Device Address for Rendering Device Vulkan and DirectX12 2025-01-13 22:43:29 -08:00
Stuart Carnie
11dc4f2e5e Metal: Add MetalFX upscaling support
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-01-06 06:03:18 -07:00
Yufeng Ying
e88e30c273 Remove unused headers in servers.
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2024-12-20 18:51:01 +08:00
Thaddeus Crews
b7501d219c
Merge pull request #100322 from darksylinc/matias-tf-comment-fix
Fix grammar / spelling in comments
2024-12-12 16:13:25 -06:00