Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ cppcheck-cppcheck-build-dir/
*.geany
.geanyprj

# GNU patch
*.orig
*.rej
Comment on lines +158 to +160
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tired of having to manually delete .orig and .rej files generated by GNU patch (one had managed to slip through in this PR at first), so I'm gitignoring them. I don't expect it to conflict with legit file extensions we'd want to version.


# Gprof
gmon.out

Expand Down
15 changes: 10 additions & 5 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,11 @@ Comment: SPIRV-Cross
Copyright: 2015-2021, Arm Limited
License: Apache-2.0 or Expat

Files: thirdparty/spirv-headers/*
Comment: SPIRV-Headers
Copyright: 2015-2024, The Khronos Group Inc.
License: Expat

Files: thirdparty/spirv-reflect/*
Comment: SPIRV-Reflect
Copyright: 2017-2022, Google Inc.
Expand Down Expand Up @@ -608,19 +613,19 @@ License: BSD-3-clause

Files: thirdparty/volk/*
Comment: volk
Copyright: 2018-2024, Arseny Kapoulkine
Copyright: 2018-2025, Arseny Kapoulkine
License: Expat

Files: thirdparty/vulkan/*
Comment: Vulkan Headers
Copyright: 2014-2024, The Khronos Group Inc.
2014-2024, Valve Corporation
2014-2024, LunarG, Inc.
Copyright: 2015-2025, The Khronos Group Inc.
2015-2025, Valve Corporation
2015-2025, LunarG, Inc.
License: Apache-2.0

Files: thirdparty/vulkan/vk_mem_alloc.h
Comment: Vulkan Memory Allocator
Copyright: 2017-2024, Advanced Micro Devices, Inc.
Copyright: 2017-2025, Advanced Micro Devices, Inc.
License: Expat

Files: thirdparty/wayland/*
Expand Down
1 change: 1 addition & 0 deletions drivers/metal/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ thirdparty_sources = [
"spirv_reflect.cpp",
"spirv_glsl.cpp",
"spirv_cross_parsed_ir.cpp",
"spirv_cross_util.cpp",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]

Expand Down
4 changes: 4 additions & 0 deletions drivers/vulkan/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ elif env["platform"] == "windows":
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_WIN32_KHR"])

# Build Vulkan memory allocator and volk

# We don't use it for now, and it depends on Windows APIs.
env.AppendUnique(CPPDEFINES=["VMA_EXTERNAL_MEMORY_WIN32=0"])

env_thirdparty_vma = env.Clone()
env_thirdparty_vma.disable_warnings()
thirdparty_sources_vma = [thirdparty_dir + "/vk_mem_alloc.cpp"]
Expand Down
1 change: 0 additions & 1 deletion modules/glslang/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ if env["builtin_glslang"]:
"SPIRV/Logger.cpp",
"SPIRV/SpvBuilder.cpp",
"SPIRV/SpvPostProcess.cpp",
"SPIRV/SPVRemapper.cpp",
"SPIRV/SpvTools.cpp",
]

Expand Down
1 change: 0 additions & 1 deletion servers/rendering/renderer_rd/effects/copy_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,6 @@ void CopyEffects::octmap_filter(RID p_source_octmap, const Vector<RID> &p_dest_o
OctmapFilterPushConstant push_constant;
push_constant.border_size[0] = p_border_size;
push_constant.border_size[1] = 1.0f - p_border_size * 2.0f;
push_constant.size = 320;

Vector<RD::Uniform> uniforms;
for (int i = 0; i < p_dest_octmap.size(); i++) {
Expand Down
6 changes: 3 additions & 3 deletions servers/rendering/renderer_rd/effects/copy_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class CopyEffects {

struct CopyToOctmapPushConstant {
float border_size;
float pad[3];
uint32_t pad[3];
};

struct CopyToOctmap {
Expand Down Expand Up @@ -280,8 +280,8 @@ class CopyEffects {

struct OctmapFilterPushConstant {
float border_size[2];
uint32_t size;
uint32_t pad;
uint32_t pad1;
uint32_t pad2;
};

struct OctmapFilterRasterPushConstant {
Expand Down
2 changes: 1 addition & 1 deletion servers/rendering/renderer_rd/effects/debug_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class DebugEffects {
float reprojection_matrix[16];
float resolution[2];
uint32_t force_derive_from_depth;
float pad;
uint32_t pad;
};

struct {
Expand Down
2 changes: 1 addition & 1 deletion servers/rendering/renderer_rd/effects/fsr.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class FSR : public SpatialUpscaler {
float upscaled_height;
float sharpness;
int pass;
int _unused0, _unused1;
int pad[2];
};

FsrUpscaleShaderRD fsr_shader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ layout(set = 0, binding = 0) uniform samplerCube source_cube;

layout(push_constant, std430) uniform Params {
float border_size;
uint pad1;
uint pad2;
uint pad3;
}
params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ layout(push_constant, std430) uniform Params {
float upscaled_height;
float sharpness;
int pass;
int pad1;
int pad2;
}
params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ layout(location = 0) out vec4 frag_color;
layout(push_constant, std430) uniform Params {
highp mat4 reprojection_matrix;
vec2 resolution;
bool force_derive_from_depth;
uint force_derive_from_depth;
uint pad;
}
params;

Expand All @@ -55,7 +56,7 @@ void main() {
vec2 cell_pos_pixel = floor(pos_pixel / cell_size) * cell_size + (cell_size * 0.5f);
vec2 cell_pos_uv = cell_pos_pixel / params.resolution;
vec2 cell_pos_velocity = textureLod(source_velocity, cell_pos_uv, 0.0f).xy;
bool derive_velocity = params.force_derive_from_depth || all(lessThanEqual(cell_pos_velocity, vec2(-1.0f, -1.0f)));
bool derive_velocity = bool(params.force_derive_from_depth) || all(lessThanEqual(cell_pos_velocity, vec2(-1.0f, -1.0f)));
if (derive_velocity) {
float depth = textureLod(source_depth, cell_pos_uv, 0.0f).x;
cell_pos_velocity = derive_motion_vector(cell_pos_uv, depth, params.reprojection_matrix);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ layout(rgba16f, set = 1, binding = 0) uniform restrict writeonly image2D dest_oc
layout(push_constant, std430) uniform Params {
float border_size;
uint size;
uint pad;
uint pad1;
uint pad2;
}
params;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
#include "../oct_inc.glsl"

layout(push_constant, std430) uniform Params {
float border_size;
uint size;
uint pad1;
uint pad2;
}
params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ layout(push_constant, std430) uniform Params {
float depth_tolerance;
bool orthogonal;
int view_index;
ivec3 pad;
}
params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ layout(rgba8, set = 0, binding = 3) uniform restrict writeonly image2D dest_norm

layout(push_constant, std430) uniform Params {
ivec2 screen_size;
ivec2 pad;
}
params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ layout(set = 0, binding = 1) uniform restrict writeonly image2D dest;
layout(push_constant, std430) uniform Params {
ivec2 screen_size;
uint mip_level;
int pad;
}
params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ layout(r32f, set = 0, binding = 1) uniform restrict writeonly image2D dest;

layout(push_constant, std430) uniform Params {
ivec2 screen_size;
ivec2 pad;
}
params;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ layout(rgba16f, set = 0, binding = 6) uniform restrict writeonly image2D output_

layout(push_constant, std430) uniform Params {
ivec2 screen_size;
ivec2 pad;
}
params;

Expand Down
29 changes: 19 additions & 10 deletions servers/rendering/rendering_shader_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,22 +467,31 @@ Error RenderingShaderContainer::reflect_spirv(const String &p_shader_name, Span<
SpvReflectSpecializationConstant *spc = spec_constants[j];
sconst.set_spv_reflect(stage, spc);

if (spc->default_value_size != 4) {
ERR_FAIL_V_MSG(FAILED, vformat("Reflection of SPIR-V shader stage '%s' failed because the specialization constant #%d's default value is not 4 bytes long (%d) and is currently not supported.", RDC::SHADER_STAGE_NAMES[p_spirv[i].shader_stage], spc->constant_id, spc->default_value_size));
}

sconst.constant_id = spc->constant_id;
sconst.int_value = 0; // Clear previous value JIC.
switch (spc->constant_type) {
case SPV_REFLECT_SPECIALIZATION_CONSTANT_BOOL: {

switch (spc->type_description->op) {
case SpvOpTypeBool:
sconst.type = RDC::PIPELINE_SPECIALIZATION_CONSTANT_TYPE_BOOL;
sconst.bool_value = spc->default_value.int_bool_value != 0;
} break;
case SPV_REFLECT_SPECIALIZATION_CONSTANT_INT: {
sconst.bool_value = *(uint32_t *)(spc->default_value);
break;
case SpvOpTypeInt:
sconst.type = RDC::PIPELINE_SPECIALIZATION_CONSTANT_TYPE_INT;
sconst.int_value = spc->default_value.int_bool_value;
} break;
case SPV_REFLECT_SPECIALIZATION_CONSTANT_FLOAT: {
sconst.int_value = *(uint32_t *)(spc->default_value);
break;
case SpvOpTypeFloat:
sconst.type = RDC::PIPELINE_SPECIALIZATION_CONSTANT_TYPE_FLOAT;
sconst.float_value = spc->default_value.float_value;
} break;
sconst.float_value = *(float *)(spc->default_value);
break;
default:
ERR_FAIL_V_MSG(FAILED, vformat("Reflection of SPIR-V shader stage '%s' failed because the specialization constant #%d does not use a known operation (%d).", RDC::SHADER_STAGE_NAMES[p_spirv[i].shader_stage], spc->constant_id, spc->type_description->op));
break;
}

sconst.stages.set_flag(stage_flag);

for (uint32_t k = 0; k < reflection.specialization_constants.size(); k++) {
Expand Down
33 changes: 18 additions & 15 deletions thirdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ Patches:
## glslang

- Upstream: https://github.com/KhronosGroup/glslang
- Version: vulkan-sdk-1.3.283.0 (e8dd0b6903b34f1879520b444634c75ea2deedf5, 2024)
- Version: vulkan-sdk-1.4.335.0 (b5782e52ee2f7b3e40bb9c80d15b47016e008bc9, 2025)
- License: glslang

Version should be kept in sync with the one of the used Vulkan SDK (see `vulkan`
Expand All @@ -409,6 +409,8 @@ Files extracted from upstream source:
- `glslang/` folder (except the `glslang/HLSL` and `glslang/ExtensionHeaders`
subfolders), `SPIRV/` folder
* Remove C interface code: `CInterface/` folders, files matching `"*_c[_\.]*"`
* Remove `glslang/stub.cpp`
* Remove `SPIRV/spirv.hpp11` (should use copy from `thirdparty/spirv-headers`)
- Run `cmake . && make` and copy generated `include/glslang/build_info.h`
to `glslang/build_info.h`
- `LICENSE.txt`
Expand All @@ -417,7 +419,6 @@ Files extracted from upstream source:
Patches:

- `0001-apple-disable-absolute-paths.patch` ([GH-92010](https://github.com/godotengine/godot/pull/92010))
- `0002-gcc15-include-fix.patch` ([GH-102022](https://github.com/godotengine/godot/pull/102022))


## graphite
Expand Down Expand Up @@ -982,12 +983,12 @@ Patches:
## spirv-cross

- Upstream: https://github.com/KhronosGroup/SPIRV-Cross
- Version: git (d7440cbc6c50332600fdf21c45e6a5df0b07e54c, 2025)
- Version: git (fb0c1a307cca4b4a9d891837bf4c44d17fe2d324, 2025)
- License: Apache 2.0

Files extracted from upstream source:

- All `.cpp`, `.hpp` and `.h` files, minus `main.cpp`, `spirv_cross_c.*`, `spirv_hlsl.*`, `spirv_cpp.*`
- All `.cpp`, `.hpp` and `.h` files, minus `main.cpp`, `spirv.h*`, `spirv_cross_c.*`, `spirv_hlsl.*`, `spirv_cpp.*`
- `include/` folder
- `LICENSE` and `LICENSES/` folder, minus `CC-BY-4.0.txt`

Expand All @@ -998,17 +999,19 @@ to generate Metal source from Vulkan SPIR-V.
## spirv-headers

- Upstream: https://github.com/KhronosGroup/SPIRV-Headers
- Version: vulkan-sdk-1.4.328.1 (01e0577914a75a2569c846778c2f93aa8e6feddd, 2025)
- Version: vulkan-sdk-1.4.335.0 (b824a462d4256d720bebb40e78b9eb8f78bbb305, 2025)
- License: MIT

Files extracted from upstream source:
- `include/spirv/unified1` folder with only `spirv.h` and `spirv.hpp`
- `LICENSE`

- `include/spirv/unified1/spirv.{h,hpp,hpp11}` with the same folder structure
- `LICENSE` (edited to keep only relevant license)


## spirv-reflect

- Upstream: https://github.com/KhronosGroup/SPIRV-Reflect
- Version: vulkan-sdk-1.3.283.0 (ee5b57fba6a986381f998567761bbc064428e645, 2024)
- Version: vulkan-sdk-1.4.335.0 (ef913b3ab3da1becca3cf46b15a10667c67bebe5, 2025)
- License: Apache 2.0

Version should be kept in sync with the one of the used Vulkan SDK (see `vulkan`
Expand All @@ -1017,14 +1020,12 @@ section).
Files extracted from upstream source:

- `spirv_reflect.h`, `spirv_reflect.c`
- `include/` folder
- `LICENSE`

Patches:

- `0001-specialization-constants.patch` ([GH-50325](https://github.com/godotengine/godot/pull/50325))
- `0002-zero-size-for-sc-sized-arrays.patch` ([GH-94985](https://github.com/godotengine/godot/pull/94985))
- `0003-spirv-headers.patch` ([GH-111452](https://github.com/godotengine/godot/pull/111452))
- `0001-zero-size-for-sc-sized-arrays.patch` ([GH-94985](https://github.com/godotengine/godot/pull/94985))
- `0002-spirv-headers.patch` ([GH-111452](https://github.com/godotengine/godot/pull/111452))


## swappy-frame-pacing
Expand Down Expand Up @@ -1109,7 +1110,7 @@ Patches:
## volk

- Upstream: https://github.com/zeux/volk
- Version: vulkan-sdk-1.3.283.0 (3a8068a57417940cf2bf9d837a7bb60d015ca2f1, 2024)
- Version: vulkan-sdk-1.4.335.0 (4f3bcee79618a9abe79f4c717c50379197c77512, 2025)
- License: MIT

Version should be kept in sync with the one of the used Vulkan SDK (see `vulkan`
Expand All @@ -1124,7 +1125,7 @@ Files extracted from upstream source:
## vulkan

- Upstream: https://github.com/KhronosGroup/Vulkan-Headers
- Version: vulkan-sdk-1.3.283.0 (eaa319dade959cb61ed2229c8ea42e307cc8f8b3, 2024)
- Version: vulkan-sdk-1.4.335.0 (2fa203425eb4af9dfc6b03f97ef72b0b5bcb8350, 2025)
- License: Apache 2.0

Unless there is a specific reason to package a more recent version, please stick
Expand All @@ -1133,6 +1134,8 @@ to tagged SDK releases. All Vulkan libraries and headers should be kept in sync
- Update Vulkan SDK components to the matching tag (see "vulkan")
- Update volk (see "volk")
- Update glslang (see "glslang")
- Update spirv-headers (see "spriv-headers")
- Update spirv-cross (see "spirv-cross")
- Update spirv-reflect (see "spirv-reflect")

Files extracted from upstream source:
Expand All @@ -1144,7 +1147,7 @@ Files extracted from upstream source:
SDK release: https://github.com/KhronosGroup/Vulkan-Utility-Libraries/blob/main/include/vulkan/vk_enum_string_helper.h

`vk_mem_alloc.h` is taken from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
Version: 3.1.0 (009ecd192c1289c7529bff248a16cfe896254816, 2024)
Version: 3.3.0 (1d8f600fd424278486eade7ed3e877c99f0846b1, 2025)
`vk_mem_alloc.cpp` is a Godot file and should be preserved on updates.

Patches:
Expand Down
3 changes: 0 additions & 3 deletions thirdparty/glslang/LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ Other parts, outside of glslang proper, include:
- update_glslang_sources.py, which is not part of the project proper and does
not need to be used.

- the SPIR-V "remapper", which is optional, but has the same license as
glslang proper

- Google tests and SPIR-V tools, and anything in the external subdirectory
are external and optional; see them for their respective licenses.

Expand Down
Loading