From 91907a89f797fe0f4f99229d3c1d749d81f6ac31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 31 Jan 2025 10:58:38 +0100 Subject: [PATCH] Thirdparty: Harmonize patches to document downstream changes --- COPYRIGHT.txt | 20 +- misc/error_suppressions/ubsan.txt | 4 +- modules/enet/SCsub | 2 +- modules/noise/fastnoise_lite.h | 2 +- .../windows/gl_manager_windows_native.cpp | 2 +- thirdparty/README.md | 274 +- thirdparty/amd-fsr2/ffx_fsr2.cpp | 4 - thirdparty/amd-fsr2/ffx_fsr2.h | 3 - thirdparty/amd-fsr2/ffx_fsr2_private.h | 2 - thirdparty/amd-fsr2/ffx_types.h | 2 - .../amd-fsr2/patches/0001-build-fixes.patch | 136 + .../patches/0002-godot-fsr2-options.patch | 121 + .../amd-fsr2/patches/godot-changes.patch | Bin 21350 -> 0 bytes .../shaders/ffx_fsr2_accumulate_pass.glsl | 5 +- .../ffx_fsr2_autogen_reactive_pass.glsl | 2 +- .../shaders/ffx_fsr2_callbacks_glsl.h | 8 +- ...x_fsr2_compute_luminance_pyramid_pass.glsl | 2 +- .../shaders/ffx_fsr2_depth_clip_pass.glsl | 2 +- .../amd-fsr2/shaders/ffx_fsr2_lock_pass.glsl | 2 +- .../amd-fsr2/shaders/ffx_fsr2_rcas_pass.glsl | 2 +- ..._fsr2_reconstruct_previous_depth_pass.glsl | 2 +- .../shaders/ffx_fsr2_tcr_autogen_pass.glsl | 4 +- .../encoder/basisu_gpu_texture.cpp | 2 +- .../patches/0001-external-zstd-pr344.patch | 26 + ...al-jpgd.patch => 0002-external-jpgd.patch} | 4 +- ...yexr.patch => 0003-external-tinyexr.patch} | 2 +- ...oi.patch => 0004-remove-tinydds-qoi.patch} | 10 +- .../patches/basisu-pr344.patch | 43 - .../clipper2/include/clipper2/clipper.core.h | 16 +- ...ns.patch => 0001-disable-exceptions.patch} | 2 +- ...h => 0002-llvm-disable-int1280-math.patch} | 20 +- ...org.patch => 0001-revert-bc6h-reorg.patch} | 0 thirdparty/d3d12ma/D3D12MemAlloc.cpp | 6 - .../d3d12ma/patches/0001-mingw-support.patch | 45 + .../directx/D3D12TokenizedProgramFormat.hpp | 2627 ----------------- .../directx/d3dx12_check_feature_support.h | 2 +- .../directx/d3dx12_pipeline_state_stream.h | 4 - .../include/directx/d3dx12_root_signature.h | 16 +- .../patches/0001-mingw-pragma.patch | 25 + ...ad.diff => 0002-win7-8-dynamic-load.patch} | 30 +- .../common/algorithms/parallel_reduce.h | 12 +- .../embree/common/lexers/stringstream.cpp | 4 +- thirdparty/embree/common/simd/arm/sse2neon.h | 6 - thirdparty/embree/common/sys/alloc.cpp | 62 +- thirdparty/embree/common/sys/alloc.h | 4 +- thirdparty/embree/common/sys/platform.h | 12 +- thirdparty/embree/common/sys/sysinfo.cpp | 21 +- .../common/tasking/taskschedulerinternal.cpp | 14 +- .../common/tasking/taskschedulerinternal.h | 12 +- .../embree/kernels/bvh/bvh_statistics.cpp | 4 +- thirdparty/embree/kernels/common/alloc.h | 12 +- thirdparty/embree/kernels/common/rtcore.cpp | 22 +- thirdparty/embree/kernels/common/rtcore.h | 20 +- thirdparty/embree/kernels/common/scene.cpp | 18 +- thirdparty/embree/kernels/common/state.cpp | 14 +- ...pt.patch => 0001-disable-exceptions.patch} | 298 +- ...-changes.patch => 0002-godot-config.patch} | 0 .../patches/0003-emscripten-nthreads.patch | 32 + ...idex.patch => 0004-mingw-no-cpuidex.patch} | 2 +- ...arm64.diff => 0005-mingw-llvm-arm64.patch} | 44 +- ...tch => 0006-include-order-dllexport.patch} | 0 .../embree/patches/emscripten-nthreads.patch | 42 - thirdparty/enet/enet/enet.h | 10 +- .../enet/enet/{godot.h => enet_godot.h} | 4 +- thirdparty/enet/enet/enet_godot_ext.h | 53 + thirdparty/enet/enet/godot_ext.h | 18 - thirdparty/enet/{godot.cpp => enet_godot.cpp} | 4 +- ...t_socket.patch => 0001-godot-socket.patch} | 18 +- ..._remove.patch => 0001-remove-bc7enc.patch} | 0 ...iff => 0001-enable-both-gl-and-gles.patch} | 4 +- ...> 0001-apple-disable-absolute-paths.patch} | 2 +- ...c15.patch => 0002-gcc15-include-fix.patch} | 0 ...fix.patch => 0001-clang-fortify-fix.patch} | 0 ...iles.diff => 0001-big-files-support.patch} | 17 +- thirdparty/libbacktrace/read.c | 9 +- .../libktx/patches/0001-external-basisu.patch | 30 + ...atch => 0002-disable-astc-block-ext.patch} | 30 - ...atch => 0001-msvc-node-debug-rename.patch} | 10 +- ...x.patch => 0002-msvc-arm64-fpstrict.patch} | 6 +- ...x.patch => 0003-clang-cl-sse2-sse41.patch} | 0 thirdparty/libwebp/sharpyuv/sharpyuv_gamma.c | 2 - thirdparty/libwebp/src/enc/quant_enc.c | 2 - thirdparty/linuxbsd_headers/README.md | 5 +- .../patches/0001-musl-standard-poll.patch | 13 + ...ian.diff => 0002-freebsd-sys-endian.patch} | 0 .../alsa/patches/use-standard-poll-h.diff | 11 - ...=> 0001-msvc-2019-psa-redeclaration.patch} | 0 ...0001-simplifier-distance-only-error.patch} | 0 .../0001-disable-exceptions.patch} | 57 +- .../0002-clang-std-replacements-leak.patch | 65 + thirdparty/minimp3/minimp3.h | 14 +- ...msvc-arm-fix.patch => 0001-msvc-arm.patch} | 20 +- ...s-fixes.patch => 0002-msvc-warnings.patch} | 0 thirdparty/minizip/ioapi.c | 11 +- thirdparty/minizip/ioapi.h | 4 - ...godot-seek.patch => 0001-godot-seek.patch} | 97 +- thirdparty/minizip/unzip.c | 29 +- thirdparty/minizip/unzip.h | 4 - thirdparty/minizip/zip.c | 4 - thirdparty/{noise => misc}/FastNoiseLite.h | 0 thirdparty/misc/ifaddrs-android.h | 10 +- thirdparty/{nvapi => misc}/nvapi_minimal.h | 0 ...stNoiseLite-0001-namespace-warnings.patch} | 6 +- ...ifaddrs-android-0001-complete-struct.patch | 32 + ...h => polypartition-0001-godot-types.patch} | 22 +- ...> polypartition-0002-shadow-warning.patch} | 0 .../smaz-0001-write-string-warning.patch | 54 + thirdparty/noise/LICENSE | 22 - ...egl-from-glad.diff => 0001-glad-egl.patch} | 7 +- ...ch => 0001-specialization-constants.patch} | 20 +- ... 0002-zero-size-for-sc-sized-arrays.patch} | 6 +- thirdparty/spirv-reflect/spirv_reflect.c | 6 - thirdparty/spirv-reflect/spirv_reflect.h | 4 - ...01-revert-tvglines-bezier-precision.patch} | 0 ...c15.patch => 0002-gcc15-include-fix.patch} | 0 .../tinyexr/patches/0001-external-zlib.patch | 12 + thirdparty/tinyexr/tinyexr.cc | 2 - thirdparty/vhacd/inc/btAlignedAllocator.h | 4 - thirdparty/vhacd/inc/btAlignedObjectArray.h | 4 - thirdparty/vhacd/inc/btConvexHullComputer.h | 4 - thirdparty/vhacd/inc/btMinMax.h | 4 - thirdparty/vhacd/inc/btScalar.h | 12 - thirdparty/vhacd/inc/btVector3.h | 4 - thirdparty/vhacd/inc/vhacdICHull.h | 2 - thirdparty/vhacd/inc/vhacdManifoldMesh.h | 2 - thirdparty/vhacd/inc/vhacdMutex.h | 2 - .../{ => patches}/0001-bullet-namespace.patch | 86 +- .../{ => patches}/0002-fpermissive-fix.patch | 16 +- .../{ => patches}/0003-fix-musl-build.patch | 6 +- .../0004-fix-msvc-arm-build.patch} | 6 +- .../0005-fix-scale-calculation.patch | 0 .../0006-gcc13-include-fix.patch} | 19 +- thirdparty/vhacd/src/btAlignedAllocator.cpp | 6 - thirdparty/vhacd/src/btConvexHullComputer.cpp | 4 - ...001-VKEnumStringHelper-godot-vulkan.patch} | 0 ...lkan.patch => 0002-VMA-godot-vulkan.patch} | 0 ...add-vmaCalculateLazilyAllocatedBytes.patch | 10 +- thirdparty/vulkan/vk_mem_alloc.h | 4 - .../wslay/patches/0001-msvc-build-fix.patch | 16 + thirdparty/wslay/patches/msvcfix.diff | 18 - thirdparty/wslay/wslay/wslay.h | 2 - 141 files changed, 1274 insertions(+), 3849 deletions(-) create mode 100644 thirdparty/amd-fsr2/patches/0001-build-fixes.patch create mode 100644 thirdparty/amd-fsr2/patches/0002-godot-fsr2-options.patch delete mode 100644 thirdparty/amd-fsr2/patches/godot-changes.patch create mode 100644 thirdparty/basis_universal/patches/0001-external-zstd-pr344.patch rename thirdparty/basis_universal/patches/{external-jpgd.patch => 0002-external-jpgd.patch} (90%) rename thirdparty/basis_universal/patches/{external-tinyexr.patch => 0003-external-tinyexr.patch} (95%) rename thirdparty/basis_universal/patches/{remove-tinydds-qoi.patch => 0004-remove-tinydds-qoi.patch} (98%) delete mode 100644 thirdparty/basis_universal/patches/basisu-pr344.patch rename thirdparty/clipper2/patches/{clipper2-exceptions.patch => 0001-disable-exceptions.patch} (97%) rename thirdparty/clipper2/patches/{llvm-error.patch => 0002-llvm-disable-int1280-math.patch} (66%) rename thirdparty/cvtt/patches/{revert_BC6H_reorg.patch => 0001-revert-bc6h-reorg.patch} (100%) create mode 100644 thirdparty/d3d12ma/patches/0001-mingw-support.patch delete mode 100644 thirdparty/directx_headers/include/directx/D3D12TokenizedProgramFormat.hpp create mode 100644 thirdparty/directx_headers/patches/0001-mingw-pragma.patch rename thirdparty/directx_headers/patches/{patch_d3d12_dynamic_load.diff => 0002-win7-8-dynamic-load.patch} (80%) rename thirdparty/embree/patches/{godot-changes-noexcept.patch => 0001-disable-exceptions.patch} (65%) rename thirdparty/embree/patches/{godot-config-changes.patch => 0002-godot-config.patch} (100%) create mode 100644 thirdparty/embree/patches/0003-emscripten-nthreads.patch rename thirdparty/embree/patches/{mingw-no-cpuidex.patch => 0004-mingw-no-cpuidex.patch} (92%) rename thirdparty/embree/patches/{mingw-llvm-arm64.diff => 0005-mingw-llvm-arm64.patch} (69%) rename thirdparty/embree/patches/{include-order-dllexport-fix.patch => 0006-include-order-dllexport.patch} (100%) delete mode 100644 thirdparty/embree/patches/emscripten-nthreads.patch rename thirdparty/enet/enet/{godot.h => enet_godot.h} (97%) create mode 100644 thirdparty/enet/enet/enet_godot_ext.h delete mode 100644 thirdparty/enet/enet/godot_ext.h rename thirdparty/enet/{godot.cpp => enet_godot.cpp} (99%) rename thirdparty/enet/patches/{godot_socket.patch => 0001-godot-socket.patch} (88%) rename thirdparty/etcpak/patches/{bc7e_remove.patch => 0001-remove-bc7enc.patch} (100%) rename thirdparty/glad/patches/{patch_enable_both_gl_and_gles.diff => 0001-enable-both-gl-and-gles.patch} (96%) rename thirdparty/glslang/patches/{disable-absolute-paths-for-apple-compat.patch => 0001-apple-disable-absolute-paths.patch} (96%) rename thirdparty/glslang/patches/{fix-build-gcc15.patch => 0002-gcc15-include-fix.patch} (100%) rename thirdparty/jpeg-compressor/patches/{clang-fortify-fix.patch => 0001-clang-fortify-fix.patch} (100%) rename thirdparty/libbacktrace/patches/{patch_big_files.diff => 0001-big-files-support.patch} (71%) create mode 100644 thirdparty/libktx/patches/0001-external-basisu.patch rename thirdparty/libktx/patches/{godot.patch => 0002-disable-astc-block-ext.patch} (56%) rename thirdparty/libwebp/patches/{godot-node-debug-fix.patch => 0001-msvc-node-debug-rename.patch} (67%) rename thirdparty/libwebp/patches/{godot-msvc-arm64-fpstrict-fix.patch => 0002-msvc-arm64-fpstrict.patch} (80%) rename thirdparty/libwebp/patches/{godot-clang-cl-fix.patch => 0003-clang-cl-sse2-sse41.patch} (100%) create mode 100644 thirdparty/linuxbsd_headers/alsa/patches/0001-musl-standard-poll.patch rename thirdparty/linuxbsd_headers/alsa/patches/{freebsd_endian.diff => 0002-freebsd-sys-endian.patch} (100%) delete mode 100644 thirdparty/linuxbsd_headers/alsa/patches/use-standard-poll-h.diff rename thirdparty/mbedtls/patches/{msvc-redeclaration-bug.diff => 0001-msvc-2019-psa-redeclaration.patch} (100%) rename thirdparty/meshoptimizer/patches/{distance-only-metric.patch => 0001-simplifier-distance-only-error.patch} (100%) rename thirdparty/mingw-std-threads/{godot.patch => patches/0001-disable-exceptions.patch} (65%) create mode 100644 thirdparty/mingw-std-threads/patches/0002-clang-std-replacements-leak.patch rename thirdparty/minimp3/patches/{msvc-arm-fix.patch => 0001-msvc-arm.patch} (69%) rename thirdparty/minimp3/patches/{msvc-warnings-fixes.patch => 0002-msvc-warnings.patch} (100%) rename thirdparty/minizip/patches/{godot-seek.patch => 0001-godot-seek.patch} (80%) rename thirdparty/{noise => misc}/FastNoiseLite.h (100%) rename thirdparty/{nvapi => misc}/nvapi_minimal.h (100%) rename thirdparty/{noise/patches/namespace-warnings.patch => misc/patches/FastNoiseLite-0001-namespace-warnings.patch} (88%) create mode 100644 thirdparty/misc/patches/ifaddrs-android-0001-complete-struct.patch rename thirdparty/misc/patches/{polypartition-godot-types.patch => polypartition-0001-godot-types.patch} (98%) rename thirdparty/misc/patches/{polypartition-hole.patch => polypartition-0002-shadow-warning.patch} (100%) create mode 100644 thirdparty/misc/patches/smaz-0001-write-string-warning.patch delete mode 100644 thirdparty/noise/LICENSE rename thirdparty/openxr/patches/{use-egl-from-glad.diff => 0001-glad-egl.patch} (68%) rename thirdparty/spirv-reflect/patches/{1-specialization-constants.patch => 0001-specialization-constants.patch} (88%) rename thirdparty/spirv-reflect/patches/{2-zero-size-for-sc-sized-arrays.patch => 0002-zero-size-for-sc-sized-arrays.patch} (86%) rename thirdparty/thorvg/patches/{revert-tvgLines-bezier-precision-change.patch => 0001-revert-tvglines-bezier-precision.patch} (100%) rename thirdparty/thorvg/patches/{fix-build-gcc15.patch => 0002-gcc15-include-fix.patch} (100%) create mode 100644 thirdparty/tinyexr/patches/0001-external-zlib.patch rename thirdparty/vhacd/{ => patches}/0001-bullet-namespace.patch (69%) rename thirdparty/vhacd/{ => patches}/0002-fpermissive-fix.patch (82%) rename thirdparty/vhacd/{ => patches}/0003-fix-musl-build.patch (77%) rename thirdparty/vhacd/{0004-fix-uwp-arm-build.patch => patches/0004-fix-msvc-arm-build.patch} (82%) rename thirdparty/vhacd/{ => patches}/0005-fix-scale-calculation.patch (100%) rename thirdparty/vhacd/{0006-fix-gcc13.patch => patches/0006-gcc13-include-fix.patch} (66%) rename thirdparty/vulkan/patches/{VKEnumStringHelper-use-godot-vulkan.patch => 0001-VKEnumStringHelper-godot-vulkan.patch} (100%) rename thirdparty/vulkan/patches/{VMA-use-godot-vulkan.patch => 0002-VMA-godot-vulkan.patch} (100%) create mode 100644 thirdparty/wslay/patches/0001-msvc-build-fix.patch delete mode 100644 thirdparty/wslay/patches/msvcfix.diff diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index a7a09a553ba..34aa95edadc 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -411,6 +411,11 @@ Comment: FastLZ Copyright: 2005-2020, Ariya Hidayat License: Expat +Files: thirdparty/misc/FastNoiseLite.h +Comment: FastNoise Lite +Copyright: 2023, Jordan Peck and contributors +License: Expat + Files: thirdparty/misc/ifaddrs-android.cc thirdparty/misc/ifaddrs-android.h Comment: libjingle @@ -423,17 +428,17 @@ Comment: Tangent Space Normal Maps implementation Copyright: 2011, Morten S. Mikkelsen License: Zlib +Files: thirdparty/misc/nvapi_minimal.h +Comment: NVIDIA NVAPI (minimal excerpt) +Copyright: 2019-2022, NVIDIA Corporation +License: Expat + Files: thirdparty/misc/ok_color.h thirdparty/misc/ok_color_shader.h Comment: OK Lab color space Copyright: 2021, Björn Ottosson License: Expat -Files: thirdparty/noise/FastNoiseLite.h -Comment: FastNoise Lite -Copyright: 2023, Jordan Peck and contributors -License: Expat - Files: thirdparty/misc/pcg.cpp thirdparty/misc/pcg.h Comment: Minimal PCG32 implementation @@ -484,11 +489,6 @@ Comment: Multi-channel signed distance field generator Copyright: 2014-2024, Viktor Chlumsky License: Expat -Files: thirdparty/nvapi/nvapi_minimal.h -Comment: Stripped down version of "nvapi.h" from the NVIDIA NVAPI SDK -Copyright: 2019-2022, NVIDIA Corporation -License: Expat - Files: thirdparty/openxr/* Comment: OpenXR Loader Copyright: 2020-2023, The Khronos Group Inc. diff --git a/misc/error_suppressions/ubsan.txt b/misc/error_suppressions/ubsan.txt index 13e0ef05a1e..a6e63ade24e 100644 --- a/misc/error_suppressions/ubsan.txt +++ b/misc/error_suppressions/ubsan.txt @@ -57,7 +57,7 @@ nonnull-attribute:thirdparty/spirv-reflect/spirv_reflect.c pointer-overflow:thirdparty/libogg/framing.c shift-base:thirdparty/libogg/bitwise.c shift-base:thirdparty/libvorbis/sharedbook.c -shift-base:thirdparty/noise/FastNoiseLite.h +shift-base:thirdparty/misc/FastNoiseLite.h shift-base:thirdparty/tinyexr/tinyexr.h shift-exponent:thirdparty/misc/mikktspace.c -signed-integer-overflow:thirdparty/noise/FastNoiseLite.h +signed-integer-overflow:thirdparty/misc/FastNoiseLite.h diff --git a/modules/enet/SCsub b/modules/enet/SCsub index 0c31638e46b..af64f2be82a 100644 --- a/modules/enet/SCsub +++ b/modules/enet/SCsub @@ -13,7 +13,7 @@ thirdparty_obj = [] if env["builtin_enet"]: thirdparty_dir = "#thirdparty/enet/" thirdparty_sources = [ - "godot.cpp", + "enet_godot.cpp", "callbacks.c", "compress.c", "host.c", diff --git a/modules/noise/fastnoise_lite.h b/modules/noise/fastnoise_lite.h index fcf81fc2bb3..38876e6c4b3 100644 --- a/modules/noise/fastnoise_lite.h +++ b/modules/noise/fastnoise_lite.h @@ -33,7 +33,7 @@ #include "noise.h" -#include +#include "thirdparty/misc/FastNoiseLite.h" typedef fastnoiselite::FastNoiseLite _FastNoiseLite; diff --git a/platform/windows/gl_manager_windows_native.cpp b/platform/windows/gl_manager_windows_native.cpp index af703f4dfa9..7d2af4f95e6 100644 --- a/platform/windows/gl_manager_windows_native.cpp +++ b/platform/windows/gl_manager_windows_native.cpp @@ -35,7 +35,7 @@ #include "core/config/project_settings.h" #include "core/version.h" -#include "thirdparty/nvapi/nvapi_minimal.h" +#include "thirdparty/misc/nvapi_minimal.h" #include #include diff --git a/thirdparty/README.md b/thirdparty/README.md index 5c2ea489e2c..575d4d6135c 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -29,7 +29,10 @@ Files extracted from upstream source: - `shaders` folder from `src/ffx-fsr2-api` with `ffx_*.hlsl` files excluded - `LICENSE.txt` -Apply `patches` to add the new options required by Godot and general compilation fixes. +Patches: + +- `0001-build-fixes.patch` (GH-81197) +- `0002-godot-fsr2-options.patch` (GH-81197) ## angle @@ -68,8 +71,13 @@ Files extracted from upstream source: `jpgd.{cpp,h}`, `3rdparty/{qoi.h,tinydds.h,tinyexr.cpp,tinyexr.h}` - `LICENSE` -Applied upstream PR https://github.com/BinomialLLC/basis_universal/pull/344 to -fix build with our own copy of zstd (patch in `patches`). +Patches: + +- `0001-external-zstd-pr344.patch` (GH-73441) +- `0002-external-jpgd.patch` (GH-88508) +- `0003-external-tinyexr.patch` (GH-97582) +- `0004-remove-tinydds-qoi.patch` (GH-97582) + ## brotli @@ -107,8 +115,10 @@ Files extracted from upstream source: - `CPP/Clipper2Lib/` folder (in root) - `LICENSE` -Apply the patches in the `patches/` folder when syncing on newer upstream -commits. +Patches: + +- `0001-disable-exceptions.patch` (GH-80796) +- `0002-llvm-disable-int1280-math.patch` (GH-95964) ## cvtt @@ -122,10 +132,9 @@ Files extracted from upstream source: - All `.cpp` and `.h` files except the folders `MakeTables` and `etc2packer` - `LICENSE.txt` -Changes related to BC6H packing and unpacking made upstream in -https://github.com/elasota/cvtt/commit/2e4b6b2747aec11f4cc6dd09ef43fa8ce769f6e2 -have been removed as they caused massive quality regressions. Apply the patches -in the `patches/` folder when syncing on newer upstream commits. +Patches: + +- `0001-revert-bc6h-reorg.patch` (GH-73715) ## d3d12ma @@ -140,9 +149,9 @@ Files extracted from upstream source: - `include/D3D12MemAlloc.h` - `LICENSE.txt`, `NOTICES.txt` -Important: Some files have Godot-made changes for use with MinGW. -They are marked with `/* GODOT start */` and `/* GODOT end */` -comments. +Patches: + +- `0001-mingw-support.patch` (GH-83452) ## directx_headers @@ -157,9 +166,10 @@ Files extracted from upstream source: - `include/dxguids/*.h` - `LICENSE` -Important: Some files have Godot-made changes for use with MinGW. -They are marked with `/* GODOT start */` and `/* GODOT end */` -comments. +Patches: + +- `0001-mingw-pragma.patch` (GH-83452) +- `0002-win7-8-dynamic-load.patch` (GH-88496) ## doctest @@ -187,13 +197,17 @@ Files extracted from upstream: - All config files listed in `modules/raycast/godot_update_embree.py` - `LICENSE.txt` -The `modules/raycast/godot_update_embree.py` script can be used to pull the -relevant files from the latest Embree release and apply some automatic changes. +Patches: -Some changes have been made in order to remove exceptions and fix minor build errors. -They are marked with `// -- GODOT start --` and `// -- GODOT end --` -comments. Apply the patches in the `patches/` folder when syncing on newer upstream -commits. +- `0001-disable-exceptions.patch` (GH-48050) +- `0002-godot-config.patch` (GH-88783) +- `0003-emscripten-nthreads.patch` (GH-69799) +- `0004-mingw-no-cpuidex.patch` (GH-92488) +- `0005-mingw-llvm-arm64.patch` (GH-93364) +- `0006-include-order-dllexport.patch` (GH-94256) + +The `modules/raycast/godot_update_embree.py` script can be used to pull the +relevant files from the latest Embree release and apply patches automatically. ## enet @@ -207,17 +221,15 @@ Files extracted from upstream source: - All `.c` files in the main directory (except `unix.c` and `win32.c`) - The `include/enet/` folder as `enet/` (except `unix.h` and `win32.h`) - `LICENSE` file +- Added 3 files `enet_godot.cpp`, `enet/enet_godot.h`, and `enet/enet_godot_ext.h`, + providing ENet socket implementation using Godot classes, allowing IPv6 and DTLS. -Important: `enet.h`, `host.c`, `protocol.c` have been slightly modified -to be usable by Godot's socket implementation and allow IPv6 and DTLS. -Apply the patches in the `patches/` folder when syncing on newer upstream -commits. +Patches: -Three files (`godot.cpp`, `enet/godot.h`, `enet/godot_ext.h`) have been added to -provide ENet socket implementation using Godot classes. +- `0001-godot-socket.patch` (GH-7985) -It is still possible to build against a system wide ENet but doing so will limit -its functionality to IPv4 only. +Important: Building against a system wide ENet is possible, but will limit its +functionality to IPv4 only and no DTLS. We recommend against it. ## etcpak @@ -236,6 +248,11 @@ Files extracted from upstream source: - The files `DecodeRGB.{cpp.hpp}` are based on the code from the original repository. - `AUTHORS.txt` and `LICENSE.txt` +Patches: + +- `0001-remove-bc7enc.patch` (GH-101362) + + ## fonts - `DroidSans*.woff2`: @@ -340,11 +357,12 @@ Files generated from [upstream web instance](https://gen.glad.sh/): - `glx.c` - `glad/glx.h` -See the permalinks in `glad/gl.h` and `glad/glx.h` to regenrate the files with +See the permalinks in `glad/gl.h` and `glad/glx.h` to regenerate the files with a new version of the web instance. -Some changes have been made in order to allow loading OpenGL and OpenGLES APIs at the same time. -See the patches in the `patches` directory. +Patches: + +- `0001-enable-both-gl-and-gles.patch` (GH-72831) ## glslang @@ -366,6 +384,11 @@ Files extracted from upstream source: - `LICENSE.txt` - Unnecessary files like `CMakeLists.txt` or `updateGrammar` removed +Patches: + +- `0001-apple-disable-absolute-paths.patch` (GH-92010) +- `0002-gcc15-include-fix.patch` (GH-102022) + ## graphite @@ -445,6 +468,10 @@ Files extracted from upstream source: - `jpgd*.{c,h}` - `jpge*.{c,h}` +Patches: + +- `0001-clang-fortify-fix.patch` (GH-101927) + ## libbacktrace @@ -459,9 +486,9 @@ Files extracted from upstream source: * `elf.c`, `macho.c`, `mmap.c`, `mmapio.c`, `nounwind.c`, `unknown.c`, `xcoff.c` - `LICENSE` -Important: Some files have Godot-made changes to load big debug symbol files. -They are marked with `/* GODOT start */` and `/* GODOT end */` -comments and a patch is provided in the `patches` folder. +Patches: + +- `0001-big-files-support.patch` (GH-100281) ## libktx @@ -481,7 +508,10 @@ Files extracted from upstream source: - `other_include/KHR/` - `utils/unused.h` -Some Godot-specific changes are applied via patches included in the `patches` folder. +Patches: + +- `0001-external-basisu.patch` (GH-76572) +- `0002-disable-astc-block-ext.patch` (GH-76572) ## libogg @@ -549,8 +579,16 @@ Files extracted from upstream source: - `src/` and `sharpyuv/` except from `.am`, `.rc` and `.in` files - `AUTHORS`, `COPYING`, `PATENTS` -Patch `godot-node-debug-fix.patch` workarounds shadowing of Godot's Node class -in the MSVC debugger. +Patches: + +- `0001-msvc-node-debug-rename.patch` +- `0002-msvc-arm64-fpstrict.patch` +- `0003-clang-cl-sse2-sse41.patch` + + +## linuxbsd_headers + +See `linuxbsd_headers/README.md`. ## manifold @@ -581,13 +619,15 @@ File extracted from upstream release tarball: - Except `bignum_mod.c`, `block_cipher.c`, `ecp_curves_new.c`, `lmots.c`, `lms.c` - The `LICENSE` file (edited to keep only the Apache 2.0 variant) -- Applied the patch `msvc-redeclaration-bug.diff` to fix a compilation error - with some MSVC versions - Added 2 files `godot_core_mbedtls_platform.c` and `godot_core_mbedtls_config.h` providing configuration for light bundling with core - Added the file `godot_module_mbedtls_config.h` to customize the build configuration when bundling the full library +Patches: + +- `0001-msvc-2019-psa-redeclaration.patch` (GH-90535) + ## meshoptimizer @@ -600,8 +640,9 @@ Files extracted from upstream repository: - All files in `src/` - `LICENSE.md` -A patch is included to modify the simplifier to report only distance error -metrics instead of a combination of distance and attribute errors. +Patches: + +- `0001-simplifier-distance-only-error.patch` (GH-98529) ## mingw-std-threads @@ -619,8 +660,10 @@ Files extracted from upstream repository: - `mingw.shared_mutex.h` - `mingw.thread.h` -Once copied, apply `godot.patch` (needed because Godot is built without exceptions -and to avoid std:: replacements leak in Clang builds). +Patches: + +- `0001-disable-exceptions.patch` (GH-85039) +- `0002-clang-std-replacements-leak.patch` (GH-85208) ## minimp3 @@ -635,8 +678,10 @@ Files extracted from upstream repository: - `minimp3_ex.h` - `LICENSE` -Some changes have been made in order to fix Windows on ARM build errors, and -to solve some MSVC warnings. See the patches in the `patches` directory. +Patches: + +- `0001-msvc-arm.patch` (GH-64921) +- `0002-msvc-warnings.patch` (GH-66545) ## miniupnpc @@ -652,10 +697,8 @@ Files extracted from upstream source: - Remove the following test or sample files: `listdevices.c,minihttptestserver.c,miniupnpcmodule.c,upnpc.c,upnperrors.*,test*` - `LICENSE` - -The only modified file is `src/miniupnpcstrings.h`, which was created for Godot -(it is usually autogenerated by cmake). Bump the version number for miniupnpc in -that file when upgrading. +- `src/miniupnpcstrings.h` was created manually for Godot (it is usually generated + by CMake). Bump the version number for miniupnpc in that file when upgrading. ## minizip @@ -670,9 +713,9 @@ Files extracted from the upstream source: `{crypt.h,ioapi.{c,h},unzip.{c,h},zip.{c,h}}` `MiniZip64_info.txt` -Important: Some files have Godot-made changes for use in core/io. -They are marked with `/* GODOT start */` and `/* GODOT end */` -comments and a patch is provided in the `patches` folder. +Patches: + +- `0001-godot-seek.patch` (GH-10428) ## misc @@ -683,10 +726,6 @@ Collection of single-file libraries used in Godot components. * Upstream: https://github.com/iOrange/bcdec * Version: git (3b29f8f44466c7d59852670f82f53905cf627d48, 2024) * License: MIT -- `clipper.{cpp,hpp}` - * Upstream: https://sourceforge.net/projects/polyclipping - * Version: 6.4.2 (2017) + Godot changes (added optional exceptions handling) - * License: BSL-1.0 - `cubemap_coeffs.h` * Upstream: https://research.activision.com/publications/archives/fast-filtering-of-reflection-probes File coeffs_const_8.txt (retrieved April 2020) @@ -695,14 +734,27 @@ Collection of single-file libraries used in Godot components. * Upstream: https://github.com/ariya/FastLZ * Version: 0.5.0 (4f20f54d46f5a6dd4fae4def134933369b7602d2, 2020) * License: MIT +- `FastNoiseLite.h` + * Upstream: https://github.com/Auburn/FastNoiseLite + * Version: 1.1.0 (f7af54b56518aa659e1cf9fb103c0b6e36a833d9, 2023) + * License: MIT + * Patches: + - `FastNoiseLite-0001-namespace-warnings.patch` (GH-88526) - `ifaddrs-android.{cc,h}` * Upstream: https://chromium.googlesource.com/external/webrtc/stable/talk/+/master/base/ifaddrs-android.h * Version: git (5976650443d68ccfadf1dea24999ee459dd2819d, 2013) * License: BSD-3-Clause + * Patches: + - `ifaddrs-android-0001-complete-struct.patch` (GH-34101) - `mikktspace.{c,h}` * Upstream: https://archive.blender.org/wiki/index.php/Dev:Shading/Tangent_Space_Normal_Maps/ * Version: 1.0 (2011) * License: zlib +- `nvapi_minimal.h` + * Upstream: http://download.nvidia.com/XFree86/nvapi-open-source-sdk + * Version: R525 + * License: MIT + * Modifications: Created from upstream `nvapi.h` by removing unnecessary code. - `ok_color.h` * Upstream: https://github.com/bottosson/bottosson.github.io/blob/master/misc/ok_color.h * Version: git (d69831edb90ffdcd08b7e64da3c5405acd48ad2c, 2022) @@ -719,13 +771,15 @@ Collection of single-file libraries used in Godot components. - `polypartition.{cpp,h}` * Upstream: https://github.com/ivanfratric/polypartition (`src/polypartition.{cpp,h}`) * Version: git (7bdffb428b2b19ad1c43aa44c714dcc104177e84, 2021) - * Modifications: Change from STL to Godot types (see provided patch). * License: MIT -- `qoa.h` + * Patches: + - `polypartition-0001-godot-types.patch` (2185c018f) + - `polypartition-0002-shadow-warning.patch` (GH-66808) +- `qoa.{c,h}` * Upstream: https://github.com/phoboslab/qoa * Version: git (a2d927f8ce78a85e903676a33e0f956e53b89f7d, 2024) - * Modifications: Added implementation through `qoa.c`. * License: MIT + * Modifications: Added implementation through `qoa.c`. - `r128.{c,h}` * Upstream: https://github.com/fahickman/r128 * Version: git (6fc177671c47640d5bb69af10cf4ee91050015a1, 2023) @@ -734,7 +788,9 @@ Collection of single-file libraries used in Godot components. * Upstream: https://github.com/antirez/smaz * Version: git (2f625846a775501fb69456567409a8b12f10ea25, 2012) * License: BSD-3-Clause - * Modifications: use `const char*` instead of `char*` for input string + * Modifications: License included in header. + * Patches: + - `smaz-0001-write-string-warning.patch` (GH-8572) - `smolv.{cpp,h}` * Upstream: https://github.com/aras-p/smol-v * Version: git (9dd54c379ac29fa148cb1b829bb939ba7381d8f4, 2024) @@ -762,31 +818,6 @@ Files extracted from the upstream source: - `LICENSE.txt` -## noise - -- Upstream: https://github.com/Auburn/FastNoiseLite -- Version: 1.1.0 (f7af54b56518aa659e1cf9fb103c0b6e36a833d9, 2023) -- License: MIT - -Files extracted from the upstream source: - -- `FastNoiseLite.h` -- `LICENSE` - -Some custom changes were made to fix compiler warnings, and can be re-applied -with the provided patch. - - -## nvapi - -- Upstream: http://download.nvidia.com/XFree86/nvapi-open-source-sdk -- Version: R525 -- License: MIT - -- `nvapi_minimal.h` was created by using `nvapi.h` from upstream and removing - unnecessary code. - - ## openxr - Upstream: https://github.com/KhronosGroup/OpenXR-SDK @@ -814,6 +845,10 @@ Exclude: `*.{def,expsym,in,json,map,pom,rc,txt}` - All dotfiles +Patches: + +- `0001-glad-egl.patch` (GH-98824) + ## pcre2 @@ -900,10 +935,27 @@ Files extracted from upstream source: - `include/` folder - `LICENSE` -Some downstream changes have been made and are identified by -`// -- GODOT begin --` and `// -- GODOT end --` comments. -They can be reapplied using the patches included in the `patches` -folder, in order. +Patches: + +- `0001-specialization-constants.patch` (GH-50325) +- `0002-zero-size-for-sc-sized-arrays.patch` (GH-94985) + + +## thorvg + +- Upstream: https://github.com/thorvg/thorvg +- Version: 0.15.8 (bd8c2fca7663a22fba7a339937cb60f2f6247a2e, 2025) +- License: MIT + +Files extracted from upstream source: + +- See `thorvg/update-thorvg.sh` for extraction instructions. + Set the version number and run the script. + +Patches: + +- `0001-revert-tvglines-bezier-precision.patch` (GH-96658) +- `0002-gcc15-include-fix.patch` (GH-102022) ## tinyexr @@ -916,22 +968,9 @@ Files extracted from upstream source: - `tinyexr.{cc,h}` -The `tinyexr.cc` file was modified to include `zlib.h` which we provide, -instead of `miniz.h` as an external dependency. +Patches: - -## thorvg - -- Upstream: https://github.com/thorvg/thorvg -- Version: 0.15.8 (bd8c2fca7663a22fba7a339937cb60f2f6247a2e, 2025) -- License: MIT - -Files extracted from upstream source: - -See `thorvg/update-thorvg.sh` for extraction instructions. Set the version -number and run the script. - -Patches in the `patches/` directory should be re-applied after updating. +- `0001-external-zlib.patch` (GH-55115) ## ufbx @@ -957,10 +996,14 @@ Files extracted from upstream source: - From `src/VHACD_Lib/`: `inc`, `public` and `src` - `LICENSE` -Some downstream changes have been made and are identified by -`// -- GODOT start --` and `// -- GODOT end --` comments. -They can be reapplied using the patches included in the `vhacd` -folder. +Patches: + +- `0001-bullet-namespace.patch` (GH-27929) +- `0002-fpermissive-fix.patch` (GH-27929) +- `0003-fix-musl-build.patch` (GH-34250) +- `0004-fix-msvc-arm-build.patch` (GH-34331) +- `0005-fix-scale-calculation.patch` (GH-38506) +- `0006-gcc13-include-fix.patch` (GH-77949) ## volk @@ -1004,7 +1047,12 @@ SDK release: https://github.com/KhronosGroup/Vulkan-Utility-Libraries/blob/main/ Version: 3.1.0 (009ecd192c1289c7529bff248a16cfe896254816, 2024) `vk_mem_alloc.cpp` is a Godot file and should be preserved on updates. -Patches in the `patches` directory should be re-applied after updates. +Patches: + +- `0001-VKEnumStringHelper-godot-vulkan.patch` (GH-97510) +- `0002-VMA-godot-vulkan.patch` (GH-97510) +- `0003-VMA-add-vmaCalculateLazilyAllocatedBytes.patch` (GH-99257) + ## wayland @@ -1069,10 +1117,12 @@ File extracted from upstream release tarball: Contents might need tweaking for Godot, review diff - All `.c` and `.h` files from `lib/` - All `.h` in `lib/includes/wslay/` as `wslay/` -- `wslay/wslay.h` has a small Godot addition to fix MSVC build - See `patches/msvcfix.diff` - `COPYING` +Patches: + +- `0001-msvc-build-fix.patch` (GH-30263) + ## xatlas diff --git a/thirdparty/amd-fsr2/ffx_fsr2.cpp b/thirdparty/amd-fsr2/ffx_fsr2.cpp index 864f7f12942..ec571b9cd27 100644 --- a/thirdparty/amd-fsr2/ffx_fsr2.cpp +++ b/thirdparty/amd-fsr2/ffx_fsr2.cpp @@ -36,7 +36,6 @@ #pragma clang diagnostic ignored "-Wunused-variable" #endif -// -- GODOT start -- #ifndef _countof #define _countof(array) (sizeof(array) / sizeof(array[0])) #endif @@ -45,7 +44,6 @@ #include #define wcscpy_s wcscpy #endif -// -- GODOT end -- // max queued frames for descriptor management static const uint32_t FSR2_MAX_QUEUED_FRAMES = 16; @@ -954,9 +952,7 @@ static FfxErrorCode fsr2Dispatch(FfxFsr2Context_Private* context, const FfxFsr2D context->constants.lumaMipDimensions[0] = uint32_t(context->constants.maxRenderSize[0] / mipDiv); context->constants.lumaMipDimensions[1] = uint32_t(context->constants.maxRenderSize[1] / mipDiv); - // -- GODOT start -- memcpy(context->constants.reprojectionMatrix, params->reprojectionMatrix, sizeof(context->constants.reprojectionMatrix)); - // -- GODOT end -- // reactive mask bias const int32_t threadGroupWorkRegionDim = 8; diff --git a/thirdparty/amd-fsr2/ffx_fsr2.h b/thirdparty/amd-fsr2/ffx_fsr2.h index 7df3773cccb..dfcd4caf350 100644 --- a/thirdparty/amd-fsr2/ffx_fsr2.h +++ b/thirdparty/amd-fsr2/ffx_fsr2.h @@ -146,10 +146,7 @@ typedef struct FfxFsr2DispatchDescription { float autoReactiveScale; ///< A value to scale the reactive mask float autoReactiveMax; ///< A value to clamp the reactive mask - // -- GODOT start -- float reprojectionMatrix[16]; ///< The matrix used for reprojecting pixels with invalid motion vectors by using the depth. - // -- GODOT end -- - } FfxFsr2DispatchDescription; /// A structure encapsulating the parameters for automatic generation of a reactive mask diff --git a/thirdparty/amd-fsr2/ffx_fsr2_private.h b/thirdparty/amd-fsr2/ffx_fsr2_private.h index 0face069b60..8a9aec57788 100644 --- a/thirdparty/amd-fsr2/ffx_fsr2_private.h +++ b/thirdparty/amd-fsr2/ffx_fsr2_private.h @@ -45,10 +45,8 @@ typedef struct Fsr2Constants { float dynamicResChangeFactor; float viewSpaceToMetersFactor; - // -- GODOT start -- float pad; float reprojectionMatrix[16]; - // -- GODOT end -- } Fsr2Constants; struct FfxFsr2ContextDescription; diff --git a/thirdparty/amd-fsr2/ffx_types.h b/thirdparty/amd-fsr2/ffx_types.h index 8b65219b50e..f71b259cce9 100644 --- a/thirdparty/amd-fsr2/ffx_types.h +++ b/thirdparty/amd-fsr2/ffx_types.h @@ -22,9 +22,7 @@ #pragma once #include -// -- GODOT start -- #include -// -- GODOT end -- #if defined (FFX_GCC) /// FidelityFX exported functions diff --git a/thirdparty/amd-fsr2/patches/0001-build-fixes.patch b/thirdparty/amd-fsr2/patches/0001-build-fixes.patch new file mode 100644 index 00000000000..0cf64770e14 --- /dev/null +++ b/thirdparty/amd-fsr2/patches/0001-build-fixes.patch @@ -0,0 +1,136 @@ +diff --git a/thirdparty/amd-fsr2/ffx_fsr2.cpp b/thirdparty/amd-fsr2/ffx_fsr2.cpp +index 051018e437..3970aa7f5b 100644 +--- a/thirdparty/amd-fsr2/ffx_fsr2.cpp ++++ b/thirdparty/amd-fsr2/ffx_fsr2.cpp +@@ -36,6 +36,15 @@ + #pragma clang diagnostic ignored "-Wunused-variable" + #endif + ++#ifndef _countof ++#define _countof(array) (sizeof(array) / sizeof(array[0])) ++#endif ++ ++#ifndef _MSC_VER ++#include ++#define wcscpy_s wcscpy ++#endif ++ + // max queued frames for descriptor management + static const uint32_t FSR2_MAX_QUEUED_FRAMES = 16; + +diff --git a/thirdparty/amd-fsr2/ffx_types.h b/thirdparty/amd-fsr2/ffx_types.h +index 74edd192c4..f71b259cce 100644 +--- a/thirdparty/amd-fsr2/ffx_types.h ++++ b/thirdparty/amd-fsr2/ffx_types.h +@@ -22,6 +22,7 @@ + #pragma once + + #include ++#include + + #if defined (FFX_GCC) + /// FidelityFX exported functions +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_accumulate_pass.glsl b/thirdparty/amd-fsr2/shaders/ffx_fsr2_accumulate_pass.glsl +index ebbe610ffa..31d68292d4 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_accumulate_pass.glsl ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_accumulate_pass.glsl +@@ -19,7 +19,7 @@ + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. + +-#version 450 ++//#version 450 + + #extension GL_GOOGLE_include_directive : require + #extension GL_EXT_samplerless_texture_functions : require +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_autogen_reactive_pass.glsl b/thirdparty/amd-fsr2/shaders/ffx_fsr2_autogen_reactive_pass.glsl +index 7ae41cf0c1..3b86c17d4d 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_autogen_reactive_pass.glsl ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_autogen_reactive_pass.glsl +@@ -19,7 +19,7 @@ + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. + +-#version 450 ++//#version 450 + + #extension GL_GOOGLE_include_directive : require + #extension GL_EXT_samplerless_texture_functions : require +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_compute_luminance_pyramid_pass.glsl b/thirdparty/amd-fsr2/shaders/ffx_fsr2_compute_luminance_pyramid_pass.glsl +index 15186e3bb6..8439c4e9d4 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_compute_luminance_pyramid_pass.glsl ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_compute_luminance_pyramid_pass.glsl +@@ -19,7 +19,7 @@ + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. + +-#version 450 ++//#version 450 + + #extension GL_GOOGLE_include_directive : require + #extension GL_EXT_samplerless_texture_functions : require +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_depth_clip_pass.glsl b/thirdparty/amd-fsr2/shaders/ffx_fsr2_depth_clip_pass.glsl +index fcb2b76528..45ec5bdb86 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_depth_clip_pass.glsl ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_depth_clip_pass.glsl +@@ -19,7 +19,7 @@ + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. + +-#version 450 ++//#version 450 + + #extension GL_GOOGLE_include_directive : require + #extension GL_EXT_samplerless_texture_functions : require +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_lock_pass.glsl b/thirdparty/amd-fsr2/shaders/ffx_fsr2_lock_pass.glsl +index f7cad59c20..7c3a4c2740 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_lock_pass.glsl ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_lock_pass.glsl +@@ -19,7 +19,7 @@ + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. + +-#version 450 ++//#version 450 + + #extension GL_GOOGLE_include_directive : require + #extension GL_EXT_samplerless_texture_functions : require +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_rcas_pass.glsl b/thirdparty/amd-fsr2/shaders/ffx_fsr2_rcas_pass.glsl +index f0823c2bc8..8b4ebc6afc 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_rcas_pass.glsl ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_rcas_pass.glsl +@@ -19,7 +19,7 @@ + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. + +-#version 450 ++//#version 450 + + #extension GL_GOOGLE_include_directive : require + #extension GL_EXT_samplerless_texture_functions : require +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_reconstruct_previous_depth_pass.glsl b/thirdparty/amd-fsr2/shaders/ffx_fsr2_reconstruct_previous_depth_pass.glsl +index 20e17eef8c..be4395aaed 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_reconstruct_previous_depth_pass.glsl ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_reconstruct_previous_depth_pass.glsl +@@ -19,7 +19,7 @@ + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. + +-#version 450 ++//#version 450 + + #extension GL_GOOGLE_include_directive : require + #extension GL_EXT_samplerless_texture_functions : require +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_tcr_autogen_pass.glsl b/thirdparty/amd-fsr2/shaders/ffx_fsr2_tcr_autogen_pass.glsl +index bebca91099..7d6a66b8ac 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_tcr_autogen_pass.glsl ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_tcr_autogen_pass.glsl +@@ -19,7 +19,7 @@ + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + // THE SOFTWARE. + +-#version 450 ++//#version 450 + + #extension GL_GOOGLE_include_directive : require + #extension GL_EXT_samplerless_texture_functions : require diff --git a/thirdparty/amd-fsr2/patches/0002-godot-fsr2-options.patch b/thirdparty/amd-fsr2/patches/0002-godot-fsr2-options.patch new file mode 100644 index 00000000000..dd98f0ece52 --- /dev/null +++ b/thirdparty/amd-fsr2/patches/0002-godot-fsr2-options.patch @@ -0,0 +1,121 @@ +diff --git a/thirdparty/amd-fsr2/ffx_fsr2.cpp b/thirdparty/amd-fsr2/ffx_fsr2.cpp +index 3970aa7f5b..ec571b9cd2 100644 +--- a/thirdparty/amd-fsr2/ffx_fsr2.cpp ++++ b/thirdparty/amd-fsr2/ffx_fsr2.cpp +@@ -952,6 +952,8 @@ static FfxErrorCode fsr2Dispatch(FfxFsr2Context_Private* context, const FfxFsr2D + context->constants.lumaMipDimensions[0] = uint32_t(context->constants.maxRenderSize[0] / mipDiv); + context->constants.lumaMipDimensions[1] = uint32_t(context->constants.maxRenderSize[1] / mipDiv); + ++ memcpy(context->constants.reprojectionMatrix, params->reprojectionMatrix, sizeof(context->constants.reprojectionMatrix)); ++ + // reactive mask bias + const int32_t threadGroupWorkRegionDim = 8; + const int32_t dispatchSrcX = (context->constants.renderSize[0] + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; +diff --git a/thirdparty/amd-fsr2/ffx_fsr2.h b/thirdparty/amd-fsr2/ffx_fsr2.h +index 2a1c74abb1..dfcd4caf35 100644 +--- a/thirdparty/amd-fsr2/ffx_fsr2.h ++++ b/thirdparty/amd-fsr2/ffx_fsr2.h +@@ -146,6 +146,7 @@ typedef struct FfxFsr2DispatchDescription { + float autoReactiveScale; ///< A value to scale the reactive mask + float autoReactiveMax; ///< A value to clamp the reactive mask + ++ float reprojectionMatrix[16]; ///< The matrix used for reprojecting pixels with invalid motion vectors by using the depth. + } FfxFsr2DispatchDescription; + + /// A structure encapsulating the parameters for automatic generation of a reactive mask +diff --git a/thirdparty/amd-fsr2/ffx_fsr2_private.h b/thirdparty/amd-fsr2/ffx_fsr2_private.h +index 6b5fbc5117..8a9aec5778 100644 +--- a/thirdparty/amd-fsr2/ffx_fsr2_private.h ++++ b/thirdparty/amd-fsr2/ffx_fsr2_private.h +@@ -44,6 +44,9 @@ typedef struct Fsr2Constants { + float deltaTime; + float dynamicResChangeFactor; + float viewSpaceToMetersFactor; ++ ++ float pad; ++ float reprojectionMatrix[16]; + } Fsr2Constants; + + struct FfxFsr2ContextDescription; +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_accumulate_pass.glsl b/thirdparty/amd-fsr2/shaders/ffx_fsr2_accumulate_pass.glsl +index 31d68292d4..2e98c8a6c5 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_accumulate_pass.glsl ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_accumulate_pass.glsl +@@ -35,7 +35,7 @@ + #endif + #define FSR2_BIND_SRV_INTERNAL_UPSCALED 3 + #define FSR2_BIND_SRV_LOCK_STATUS 4 +-#define FSR2_BIND_SRV_INPUT_DEPTH_CLIP 5 ++//#define FSR2_BIND_SRV_INPUT_DEPTH_CLIP 5 + #define FSR2_BIND_SRV_PREPARED_INPUT_COLOR 6 + #define FSR2_BIND_SRV_LUMA_INSTABILITY 7 + #define FSR2_BIND_SRV_LANCZOS_LUT 8 +@@ -52,6 +52,10 @@ + + #define FSR2_BIND_CB_FSR2 18 + ++#if FFX_FSR2_OPTION_GODOT_DERIVE_INVALID_MOTION_VECTORS ++#define FSR2_BIND_SRV_INPUT_DEPTH 5 ++#endif ++ + #include "ffx_fsr2_callbacks_glsl.h" + #include "ffx_fsr2_common.h" + #include "ffx_fsr2_sample.h" +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_callbacks_glsl.h b/thirdparty/amd-fsr2/shaders/ffx_fsr2_callbacks_glsl.h +index 10da13fb81..b610037cc6 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_callbacks_glsl.h ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_callbacks_glsl.h +@@ -52,6 +52,9 @@ + FfxFloat32 fDeltaTime; + FfxFloat32 fDynamicResChangeFactor; + FfxFloat32 fViewSpaceToMetersFactor; ++ ++ FfxFloat32 fPad; ++ mat4 mReprojectionMatrix; + } cbFSR2; + #endif + +@@ -317,7 +320,11 @@ FfxFloat32 LoadInputDepth(FfxInt32x2 iPxPos) + #if defined(FSR2_BIND_SRV_REACTIVE_MASK) + FfxFloat32 LoadReactiveMask(FfxInt32x2 iPxPos) + { ++#if FFX_FSR2_OPTION_GODOT_REACTIVE_MASK_CLAMP ++ return min(texelFetch(r_reactive_mask, FfxInt32x2(iPxPos), 0).r, 0.9f); ++#else + return texelFetch(r_reactive_mask, FfxInt32x2(iPxPos), 0).r; ++#endif + } + #endif + +@@ -354,6 +361,16 @@ FfxFloat32x2 LoadInputMotionVector(FfxInt32x2 iPxDilatedMotionVectorPos) + { + FfxFloat32x2 fSrcMotionVector = texelFetch(r_input_motion_vectors, iPxDilatedMotionVectorPos, 0).xy; + ++#if FFX_FSR2_OPTION_GODOT_DERIVE_INVALID_MOTION_VECTORS ++ bool bInvalidMotionVector = all(lessThanEqual(fSrcMotionVector, vec2(-1.0f, -1.0f))); ++ if (bInvalidMotionVector) ++ { ++ FfxFloat32 fSrcDepth = LoadInputDepth(iPxDilatedMotionVectorPos); ++ FfxFloat32x2 fUv = (iPxDilatedMotionVectorPos + FfxFloat32(0.5)) / RenderSize(); ++ fSrcMotionVector = FFX_FSR2_OPTION_GODOT_DERIVE_INVALID_MOTION_VECTORS_FUNCTION(fUv, fSrcDepth, cbFSR2.mReprojectionMatrix); ++ } ++#endif ++ + FfxFloat32x2 fUvMotionVector = fSrcMotionVector * MotionVectorScale(); + + #if FFX_FSR2_OPTION_JITTERED_MOTION_VECTORS +diff --git a/thirdparty/amd-fsr2/shaders/ffx_fsr2_tcr_autogen_pass.glsl b/thirdparty/amd-fsr2/shaders/ffx_fsr2_tcr_autogen_pass.glsl +index 7d6a66b8ac..5c042c332a 100644 +--- a/thirdparty/amd-fsr2/shaders/ffx_fsr2_tcr_autogen_pass.glsl ++++ b/thirdparty/amd-fsr2/shaders/ffx_fsr2_tcr_autogen_pass.glsl +@@ -40,6 +40,10 @@ + #define FSR2_BIND_CB_FSR2 11 + #define FSR2_BIND_CB_REACTIVE 12 + ++#if FFX_FSR2_OPTION_GODOT_DERIVE_INVALID_MOTION_VECTORS ++#define FSR2_BIND_SRV_INPUT_DEPTH 13 ++#endif ++ + #include "ffx_fsr2_callbacks_glsl.h" + #include "ffx_fsr2_common.h" + diff --git a/thirdparty/amd-fsr2/patches/godot-changes.patch b/thirdparty/amd-fsr2/patches/godot-changes.patch deleted file mode 100644 index 513d8a5a29530ba70954a7e4ad2f7b16da1e6845..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21350 zcmeI4ZExGi5y$tf3-mh>cW-oc?D+Yi*B0m6ahf(xTwBStJrshhhuA&aab-JodbqFN z_W#?_iWDW9q)Z7toIpq-m&@Im*_r>&%r5oc|FqqO>*|Qyl8z6$y3={nJ=gEKu6nNR zZgkz#^=Fkf-IYp~^u(>o)>OjN53VsNS#~WwaidnwDrn`G?iZrsT77oZOXODErd!qb zs@qY?hFf>rZdu2U+tO86S6$s(bGy2Ve9aYqXT#AFJT6tlAMGvrqdHE%ao>o#C2_Uo zp6L^*eLG(jXOZrHGlzmp#QU2S~jd7|fGE*A&oX}XWxsoNL*@7)V`lBjj<$Kl>{5V_yDf9d+% z)4QzS-wkRGb4aaQeQv~2LuZkHE|dh>rD@BOz12&~-A2snqb=CcKPC5$|DX$9uS-`d zq4%!W67-1cme+_IKSn*>rG;yKKIkq_FnZR5je5{G#`apzgD3ZXH1DL#YvPcSLrL(& zUmdwU_ZOA^*}aoA`5fr#P zZ47iBioXZ7+tYzH?CTp&;oC6nK-Au9G@7E6@vDg%o;mE_=Lxt5k?ut6v6m3GL)ov? zlJOpDJR6jlG=^I{=<^h*7RT_jOVS!EG3nCpt?=$rGG!!=MC*+tcF`XTblv1`+HJB+ z%fD8z7t@v#Kg!6cr_nH53$0^cR|6V8$(F(xRnO0=taW<)SnJvRm>n(%@ycLckOG!+ zC8=ZMMWqi?gYqBUKXlg8$lKT+c})YSAEfD#*HrNEN}7Sb6n$sG>pm5AP49VrU8p@U;<@~+NWMbky;tT%P=eOs zIkZQ~xxbT*D8o2XHE*EygOH@Cobq@xkN-+zT%0$X!vY0{uoe;Jd+*_?N#%mv^JcT} zWTRV}#rq&hU?~ zq)lP=MbB(DX4c@jGg+GT%X36vLD#T7Jm+)aPM-geH6Q+{_9n5`;D?!3o7Busn70BF z-0KW`p?7TMMjYLXZzP)L#_|C886Dll8%#zE!KQ6AEaoIeAd15~iRDL}Mvfu!eJAZd zp539k`kAKTHSofZEgTS)J#FS0*CMnhXQC}>$fkHclZ44$5X&1 z_!q2<%)z9HH{3=VrLMe3-LBEvG$@ zXuuf}pXCEXUKX#2yx5`7-Mtj9?f3Jj#Fj?;p?WrS#jpD8>*8rV2%Eq>Y{0UQQ!o{sW);L@#*WuY{l;iY&j6P;GqZ`#VX`gYTm z+*YKI*c?{Y*7>@(sIE$|y_RUM!pf@UWfIG*mV#i-pwTn=VXUyk=dm@L2ESE4x~@8J zrMrBe==+s>qwjrPz0vVPXLXfv6)BVSN>_i-8Q(ATd+ML9>&~8@ro>ta_ur{TT*~SR z&(Y6;e)rsK-``8svYrh`jJnW9x(|yr%zBr!szJPh1%xPm!=o@Q*~}l?xn;D$fw=Zd z(a`X#J8$*VEv*__1q9e~xu`-(Rt^5xkrtzv~11El$B}>DRvdlc%Y!UhAR&-I?qNtEOdTaO~}- z;dS`f>vTg@q07f5DcPJr2FKpgj>SC|$M`TVfhH^$DPdzpj;#qOcrE@}*Rq~ZC4oJM zwjhDJ`)i?oW7@VSqF_%v@4LT=(^Js_MIhN^$Bw5U*bv@a@PvqGS#4WW%dr&&OV8Ka zeaVH@K3ff(jJnaM*d1Ur7|I!57R_|oIyIJV-c6vcAz7l$hW3Vuw&HD?exf_92-~Q? z*O)Wj=--i^jGvggO^^^W@-k1|1UWmZ(tcu?MMizl zFNB-JyF*y>C$DxXkBa#8dynhE&%*zW_Z*}>+VQP@)J#Es?%Mmf<(^K?GjZRu@jNX9 zZW*$MpD8UHKz3?YUTAq5uqVa^%O=~ptx;qj4l6BPd7v$w;gNO}^{r`)$@pygh;T!- zXXTMj#@DpG)5)j_Xd8Q{b5Hf>;Hl06eey84>UcM=zci|V6Kx^Os-jx*<~w~<0ZZ0| zIb@RBy0_^gxY?je5gw+4AVqo(Xff=Y;itvfcJqi9v?n91Cxz8pc1Q$op(~FiD{8ry<&MBYOrd{*@ILq>8#^<*4X*!mE#@TD?+sYU7+~{#7UoU_C)AGLTn#ra& z?R`b6OK!R)n+RTG$VQJwv&bXp%DQx8I}r_ARuh|x`gO+Z$!mFA@cv4Ez>OmCJFhXe z&KdT~anE+%Jb2x@keB+P4?9wAza^3NxV$1QguQ{IzAq8op7)-EuT7kFs)(1ppr+xE zQ_VOeJuTMd*-uo4@*nzoRZgb@zh&ZzY3YK+DOu+-XF5lD_TByY@SU@YS&C zLx11)H1-siP(LY)hSy=F!M-w+q~3~TzpS?Gd|Bw+RY}lgbdW4+$b>KW zUSldPr!#%(lJwxeqI-r8S)({=X+QQgEYGfN4{E%Bo17Cd>0@?fb~0*PN3xl)cK%*c zBu`HE{BeCf5P!CcPmVpSjbVEZhQ0O+{k>#1 z*NxLR_U{oFeT;L8-np+5>Q>N-Fm%X#PJ9Bl@C%0Axw zl{xlevyOw0NKVV%T3`-f4@}FKu_NAgud`Y_i`Ca^sKR%ElaL8p7eBi`GTrs@>aKVs z6Skr&dsl5u7H$#jtTJKMaXPKYwhH}7#x(P6nfbJQ#~6~m;>y0?pYpoyEKm#!H~)jx z3-;68%mk;3_M1i`-g)Tw{UE#gCPQyIdG=xPw!@CRwJl!<^q)=ktPC&H!J0A@gbc|X zP3CA)?rr#dp9sI7bd}7(k*>vg${Z2PX`_HdYz-g933Y6C!HebKz=s73l-ks11ng`;oTqJXa_x# z-tP4Gv(tMObd5tD{0`z7_TcWQ7f^>x3OkLs<~ zzw59H9o`%cdm*QfSH*iyBhs00i1&D#@_&ed$oPUt?0{ysBcB!3!CRUYB9-H2I+#PIJW(Z#J2n#DAh7fF8w5q(I2nF-fIU;g2bl_sO^dgd-fuIyldDV#Tp0y?{}lEh h6p>W&ZKtZ& gpu_images, bool cubemap_flag, bool use_srgb_format) - { + { return false; } diff --git a/thirdparty/basis_universal/patches/0001-external-zstd-pr344.patch b/thirdparty/basis_universal/patches/0001-external-zstd-pr344.patch new file mode 100644 index 00000000000..505d17c5f32 --- /dev/null +++ b/thirdparty/basis_universal/patches/0001-external-zstd-pr344.patch @@ -0,0 +1,26 @@ +diff --git a/thirdparty/basis_universal/encoder/basisu_comp.cpp b/thirdparty/basis_universal/encoder/basisu_comp.cpp +index f16e75bd46..81813257cd 100644 +--- a/thirdparty/basis_universal/encoder/basisu_comp.cpp ++++ b/thirdparty/basis_universal/encoder/basisu_comp.cpp +@@ -33,7 +33,7 @@ + #endif + + #if BASISD_SUPPORT_KTX2_ZSTD +-#include "../zstd/zstd.h" ++#include + #endif + + // Set to 1 to disable the mipPadding alignment workaround (which only seems to be needed when no key-values are written at all) +diff --git a/thirdparty/basis_universal/transcoder/basisu_transcoder.cpp b/thirdparty/basis_universal/transcoder/basisu_transcoder.cpp +index ea994b0c4f..32018cd282 100644 +--- a/thirdparty/basis_universal/transcoder/basisu_transcoder.cpp ++++ b/thirdparty/basis_universal/transcoder/basisu_transcoder.cpp +@@ -164,7 +164,7 @@ + // If BASISD_SUPPORT_KTX2_ZSTD is 0, UASTC files compressed with Zstd cannot be loaded. + #if BASISD_SUPPORT_KTX2_ZSTD + // We only use two Zstd API's: ZSTD_decompress() and ZSTD_isError() +- #include "../zstd/zstd.h" ++ #include + #endif + #endif + diff --git a/thirdparty/basis_universal/patches/external-jpgd.patch b/thirdparty/basis_universal/patches/0002-external-jpgd.patch similarity index 90% rename from thirdparty/basis_universal/patches/external-jpgd.patch rename to thirdparty/basis_universal/patches/0002-external-jpgd.patch index 7a805d00cb7..bc2a61d150a 100644 --- a/thirdparty/basis_universal/patches/external-jpgd.patch +++ b/thirdparty/basis_universal/patches/0002-external-jpgd.patch @@ -1,8 +1,8 @@ diff --git a/thirdparty/basis_universal/encoder/basisu_enc.cpp b/thirdparty/basis_universal/encoder/basisu_enc.cpp -index c431ceaf12..e87dd636a2 100644 +index 47e8981bc3..6c0ac0ad37 100644 --- a/thirdparty/basis_universal/encoder/basisu_enc.cpp +++ b/thirdparty/basis_universal/encoder/basisu_enc.cpp -@@ -409,7 +409,7 @@ namespace basisu +@@ -458,7 +458,7 @@ namespace basisu bool load_jpg(const char *pFilename, image& img) { int width = 0, height = 0, actual_comps = 0; diff --git a/thirdparty/basis_universal/patches/external-tinyexr.patch b/thirdparty/basis_universal/patches/0003-external-tinyexr.patch similarity index 95% rename from thirdparty/basis_universal/patches/external-tinyexr.patch rename to thirdparty/basis_universal/patches/0003-external-tinyexr.patch index 665af133007..e5f2b8422d2 100644 --- a/thirdparty/basis_universal/patches/external-tinyexr.patch +++ b/thirdparty/basis_universal/patches/0003-external-tinyexr.patch @@ -1,5 +1,5 @@ diff --git a/thirdparty/basis_universal/encoder/basisu_enc.cpp b/thirdparty/basis_universal/encoder/basisu_enc.cpp -index 6c0ac0ad370..2bf486a0287 100644 +index 6c0ac0ad37..2bf486a028 100644 --- a/thirdparty/basis_universal/encoder/basisu_enc.cpp +++ b/thirdparty/basis_universal/encoder/basisu_enc.cpp @@ -27,7 +27,7 @@ diff --git a/thirdparty/basis_universal/patches/remove-tinydds-qoi.patch b/thirdparty/basis_universal/patches/0004-remove-tinydds-qoi.patch similarity index 98% rename from thirdparty/basis_universal/patches/remove-tinydds-qoi.patch rename to thirdparty/basis_universal/patches/0004-remove-tinydds-qoi.patch index a4d176602d2..6a30616140b 100644 --- a/thirdparty/basis_universal/patches/remove-tinydds-qoi.patch +++ b/thirdparty/basis_universal/patches/0004-remove-tinydds-qoi.patch @@ -1,5 +1,5 @@ diff --git a/thirdparty/basis_universal/encoder/basisu_enc.cpp b/thirdparty/basis_universal/encoder/basisu_enc.cpp -index 2bf486a0287..fff98e83014 100644 +index 2bf486a028..fff98e8301 100644 --- a/thirdparty/basis_universal/encoder/basisu_enc.cpp +++ b/thirdparty/basis_universal/encoder/basisu_enc.cpp @@ -37,9 +37,6 @@ @@ -31,7 +31,7 @@ index 2bf486a0287..fff98e83014 100644 bool load_png(const uint8_t *pBuf, size_t buf_size, image &img, const char *pFilename) diff --git a/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp b/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp -index 000869a5337..342446b8fd4 100644 +index 000869a533..648cfb47ae 100644 --- a/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp +++ b/thirdparty/basis_universal/encoder/basisu_gpu_texture.cpp @@ -19,9 +19,6 @@ @@ -44,11 +44,10 @@ index 000869a5337..342446b8fd4 100644 namespace basisu { //------------------------------------------------------------------------------------------------ -@@ -1979,208 +1976,8 @@ namespace basisu - // Accepts 2D, 2D mipmapped, 2D array, 2D array mipmapped +@@ -1980,207 +1977,7 @@ namespace basisu // and cubemap, cubemap mipmapped, and cubemap array mipmapped. bool write_dds_file(uint8_vec &dds_data, const basisu::vector& gpu_images, bool cubemap_flag, bool use_srgb_format) -- { + { - if (!gpu_images.size()) - { - assert(0); @@ -250,7 +249,6 @@ index 000869a5337..342446b8fd4 100644 - } - - return true; -+ { + return false; } diff --git a/thirdparty/basis_universal/patches/basisu-pr344.patch b/thirdparty/basis_universal/patches/basisu-pr344.patch deleted file mode 100644 index 37390d3534b..00000000000 --- a/thirdparty/basis_universal/patches/basisu-pr344.patch +++ /dev/null @@ -1,43 +0,0 @@ -From b4a0fa23c13da413d94b99f307e401c3b83e0108 Mon Sep 17 00:00:00 2001 -From: Ondrej Stava -Date: Fri, 23 Apr 2021 18:59:45 -0700 -Subject: [PATCH] Made it easier to use the library with external zstdlib - implementations (mostly in non CMake builds). -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In our internal repository, we have our own version of zstdlib and introducing extra copy is both undesirable and potentially dangerous (due to ODR violations). - -Co-authored-by: Rémi Verschelde ---- - encoder/basisu_comp.cpp | 2 +- - transcoder/basisu_transcoder.cpp | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/encoder/basisu_comp.cpp b/encoder/basisu_comp.cpp -index 41eae2b7..4e69e9e2 100644 ---- a/encoder/basisu_comp.cpp -+++ b/encoder/basisu_comp.cpp -@@ -28,7 +28,7 @@ - #endif - - #if BASISD_SUPPORT_KTX2_ZSTD --#include "../zstd/zstd.h" -+#include - #endif - - // Set to 1 to disable the mipPadding alignment workaround (which only seems to be needed when no key-values are written at all) -diff --git a/transcoder/basisu_transcoder.cpp b/transcoder/basisu_transcoder.cpp -index 3aeba0ee..c698861f 100644 ---- a/transcoder/basisu_transcoder.cpp -+++ b/transcoder/basisu_transcoder.cpp -@@ -155,7 +155,7 @@ - // If BASISD_SUPPORT_KTX2_ZSTD is 0, UASTC files compressed with Zstd cannot be loaded. - #if BASISD_SUPPORT_KTX2_ZSTD - // We only use two Zstd API's: ZSTD_decompress() and ZSTD_isError() -- #include "../zstd/zstd.h" -+ #include - #endif - #endif - diff --git a/thirdparty/clipper2/include/clipper2/clipper.core.h b/thirdparty/clipper2/include/clipper2/clipper.core.h index 0f69bf2d9ff..dd1b873d5de 100644 --- a/thirdparty/clipper2/include/clipper2/clipper.core.h +++ b/thirdparty/clipper2/include/clipper2/clipper.core.h @@ -695,13 +695,13 @@ namespace Clipper2Lib // returns true if (and only if) a * b == c * d inline bool ProductsAreEqual(int64_t a, int64_t b, int64_t c, int64_t d) { -// -- GODOT start -- -// #if (defined(__clang__) || defined(__GNUC__)) && UINTPTR_MAX >= UINT64_MAX -// const auto ab = static_cast<__int128_t>(a) * static_cast<__int128_t>(b); -// const auto cd = static_cast<__int128_t>(c) * static_cast<__int128_t>(d); -// return ab == cd; -// #else -// -- GODOT end -- +// Work around LLVM issue: https://github.com/llvm/llvm-project/issues/16778 +// Details: https://github.com/godotengine/godot/pull/95964#issuecomment-2306581804 +//#if (defined(__clang__) || defined(__GNUC__)) && UINTPTR_MAX >= UINT64_MAX +// const auto ab = static_cast<__int128_t>(a) * static_cast<__int128_t>(b); +// const auto cd = static_cast<__int128_t>(c) * static_cast<__int128_t>(d); +// return ab == cd; +//#else // nb: unsigned values needed for calculating overflow carry const auto abs_a = static_cast(std::abs(a)); const auto abs_b = static_cast(std::abs(b)); @@ -716,9 +716,7 @@ namespace Clipper2Lib const auto sign_cd = TriSign(c) * TriSign(d); return abs_ab == abs_cd && sign_ab == sign_cd; -// -- GODOT start -- // #endif -// -- GODOT end -- } template diff --git a/thirdparty/clipper2/patches/clipper2-exceptions.patch b/thirdparty/clipper2/patches/0001-disable-exceptions.patch similarity index 97% rename from thirdparty/clipper2/patches/clipper2-exceptions.patch rename to thirdparty/clipper2/patches/0001-disable-exceptions.patch index 44c2b0287a1..89be96f1fb8 100644 --- a/thirdparty/clipper2/patches/clipper2-exceptions.patch +++ b/thirdparty/clipper2/patches/0001-disable-exceptions.patch @@ -1,5 +1,5 @@ diff --git a/thirdparty/clipper2/include/clipper2/clipper.core.h b/thirdparty/clipper2/include/clipper2/clipper.core.h -index 925c04685e..d0d159b949 100644 +index 925c04685e..67dd731af6 100644 --- a/thirdparty/clipper2/include/clipper2/clipper.core.h +++ b/thirdparty/clipper2/include/clipper2/clipper.core.h @@ -22,6 +22,8 @@ diff --git a/thirdparty/clipper2/patches/llvm-error.patch b/thirdparty/clipper2/patches/0002-llvm-disable-int1280-math.patch similarity index 66% rename from thirdparty/clipper2/patches/llvm-error.patch rename to thirdparty/clipper2/patches/0002-llvm-disable-int1280-math.patch index e326d73e831..ffa06e72b86 100644 --- a/thirdparty/clipper2/patches/llvm-error.patch +++ b/thirdparty/clipper2/patches/0002-llvm-disable-int1280-math.patch @@ -1,5 +1,5 @@ diff --git a/thirdparty/clipper2/include/clipper2/clipper.core.h b/thirdparty/clipper2/include/clipper2/clipper.core.h -index 67dd731af6..0f69bf2d9f 100644 +index 67dd731af6..dd1b873d5d 100644 --- a/thirdparty/clipper2/include/clipper2/clipper.core.h +++ b/thirdparty/clipper2/include/clipper2/clipper.core.h @@ -695,11 +695,13 @@ namespace Clipper2Lib @@ -11,24 +11,22 @@ index 67dd731af6..0f69bf2d9f 100644 - const auto cd = static_cast<__int128_t>(c) * static_cast<__int128_t>(d); - return ab == cd; -#else -+// -- GODOT start -- -+// #if (defined(__clang__) || defined(__GNUC__)) && UINTPTR_MAX >= UINT64_MAX -+// const auto ab = static_cast<__int128_t>(a) * static_cast<__int128_t>(b); -+// const auto cd = static_cast<__int128_t>(c) * static_cast<__int128_t>(d); -+// return ab == cd; -+// #else -+// -- GODOT end -- ++// Work around LLVM issue: https://github.com/llvm/llvm-project/issues/16778 ++// Details: https://github.com/godotengine/godot/pull/95964#issuecomment-2306581804 ++//#if (defined(__clang__) || defined(__GNUC__)) && UINTPTR_MAX >= UINT64_MAX ++// const auto ab = static_cast<__int128_t>(a) * static_cast<__int128_t>(b); ++// const auto cd = static_cast<__int128_t>(c) * static_cast<__int128_t>(d); ++// return ab == cd; ++//#else // nb: unsigned values needed for calculating overflow carry const auto abs_a = static_cast(std::abs(a)); const auto abs_b = static_cast(std::abs(b)); -@@ -714,7 +716,9 @@ namespace Clipper2Lib +@@ -714,7 +716,7 @@ namespace Clipper2Lib const auto sign_cd = TriSign(c) * TriSign(d); return abs_ab == abs_cd && sign_ab == sign_cd; -#endif -+// -- GODOT start -- +// #endif -+// -- GODOT end -- } template diff --git a/thirdparty/cvtt/patches/revert_BC6H_reorg.patch b/thirdparty/cvtt/patches/0001-revert-bc6h-reorg.patch similarity index 100% rename from thirdparty/cvtt/patches/revert_BC6H_reorg.patch rename to thirdparty/cvtt/patches/0001-revert-bc6h-reorg.patch diff --git a/thirdparty/d3d12ma/D3D12MemAlloc.cpp b/thirdparty/d3d12ma/D3D12MemAlloc.cpp index 4d19e0e7276..80d910e6942 100644 --- a/thirdparty/d3d12ma/D3D12MemAlloc.cpp +++ b/thirdparty/d3d12ma/D3D12MemAlloc.cpp @@ -33,13 +33,11 @@ #include #endif -/* GODOT start */ #if !defined(_MSC_VER) #include #include #endif -/* GODOT end */ //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -8186,7 +8184,6 @@ HRESULT AllocatorPimpl::UpdateD3D12Budget() D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(const D3D12_RESOURCE_DESC& resourceDesc) const { -/* GODOT start */ #if defined(_MSC_VER) || !defined(_WIN32) return m_Device->GetResourceAllocationInfo(0, 1, &resourceDesc); #else @@ -8194,7 +8191,6 @@ D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(c m_Device->GetResourceAllocationInfo(&ret, 0, 1, &resourceDesc); return ret; #endif -/* GODOT end */ } #ifdef __ID3D12Device8_INTERFACE_DEFINED__ @@ -8202,7 +8198,6 @@ D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(c { D3D12MA_ASSERT(m_Device8 != NULL); D3D12_RESOURCE_ALLOCATION_INFO1 info1Unused; -/* GODOT start */ #if defined(_MSC_VER) || !defined(_WIN32) return m_Device8->GetResourceAllocationInfo2(0, 1, &resourceDesc, &info1Unused); #else @@ -8210,7 +8205,6 @@ D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(c m_Device8->GetResourceAllocationInfo2(&ret, 0, 1, &resourceDesc, &info1Unused); return ret; #endif -/* GODOT end */ } #endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__ diff --git a/thirdparty/d3d12ma/patches/0001-mingw-support.patch b/thirdparty/d3d12ma/patches/0001-mingw-support.patch new file mode 100644 index 00000000000..90d4d434019 --- /dev/null +++ b/thirdparty/d3d12ma/patches/0001-mingw-support.patch @@ -0,0 +1,45 @@ +diff --git a/thirdparty/d3d12ma/D3D12MemAlloc.cpp b/thirdparty/d3d12ma/D3D12MemAlloc.cpp +index 8e2488091a..80d910e694 100644 +--- a/thirdparty/d3d12ma/D3D12MemAlloc.cpp ++++ b/thirdparty/d3d12ma/D3D12MemAlloc.cpp +@@ -33,6 +33,12 @@ + #include + #endif + ++#if !defined(_MSC_VER) ++#include ++ ++#include ++#endif ++ + //////////////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////////////// + // +@@ -8178,7 +8184,13 @@ HRESULT AllocatorPimpl::UpdateD3D12Budget() + + D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(const D3D12_RESOURCE_DESC& resourceDesc) const + { ++#if defined(_MSC_VER) || !defined(_WIN32) + return m_Device->GetResourceAllocationInfo(0, 1, &resourceDesc); ++#else ++ D3D12_RESOURCE_ALLOCATION_INFO ret; ++ m_Device->GetResourceAllocationInfo(&ret, 0, 1, &resourceDesc); ++ return ret; ++#endif + } + + #ifdef __ID3D12Device8_INTERFACE_DEFINED__ +@@ -8186,7 +8198,13 @@ D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(c + { + D3D12MA_ASSERT(m_Device8 != NULL); + D3D12_RESOURCE_ALLOCATION_INFO1 info1Unused; ++#if defined(_MSC_VER) || !defined(_WIN32) + return m_Device8->GetResourceAllocationInfo2(0, 1, &resourceDesc, &info1Unused); ++#else ++ D3D12_RESOURCE_ALLOCATION_INFO ret; ++ m_Device8->GetResourceAllocationInfo2(&ret, 0, 1, &resourceDesc, &info1Unused); ++ return ret; ++#endif + } + #endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__ + diff --git a/thirdparty/directx_headers/include/directx/D3D12TokenizedProgramFormat.hpp b/thirdparty/directx_headers/include/directx/D3D12TokenizedProgramFormat.hpp deleted file mode 100644 index 4d04c3a7a50..00000000000 --- a/thirdparty/directx_headers/include/directx/D3D12TokenizedProgramFormat.hpp +++ /dev/null @@ -1,2627 +0,0 @@ -#pragma once -//********************************************************* -// -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License (MIT). -// -//********************************************************* -// -// High Level Goals -// -// - Serve as the runtime/DDI representation for all D3D11 tokenized code, -// for all classes of programs, including pixel program, vertex program, -// geometry program, etc. -// -// - Any information that HLSL needs to give to drivers is encoded in -// this token format in some form. -// -// - Enable common tools and source code for managing all tokenizable -// program formats. -// -// - Support extensible token definitions, allowing full customizations for -// specific program classes, while maintaining general conventions for all -// program models. -// -// - Binary backwards compatible with D3D10. Any token name that was originally -// defined with "D3D10" in it is unchanged; D3D11 only adds new tokens. -// -// ---------------------------------------------------------------------------- -// -// Low Level Feature Summary -// -// - DWORD based tokens always, for simplicity -// - Opcode token is generally a single DWORD, though there is a bit indicating -// if extended information (extra DWORD(s)) are present -// - Operand tokens are a completely self contained, extensible format, -// with scalar and 4-vector data types as first class citizens, but -// allowance for extension to n-component vectors. -// - Initial operand token identifies register type, register file -// structure/dimensionality and mode of indexing for each dimension, -// and choice of component selection mechanism (i.e. mask vs. swizzle etc). -// - Optional additional extended operand tokens can defined things like -// modifiers (which are not needed by default). -// - Operand's immediate index value(s), if needed, appear as subsequent DWORD -// values, and if relative addressing is specified, an additional completely -// self contained operand definition appears nested in the token sequence. -// -// ---------------------------------------------------------------------------- - -#include - -#pragma region Application Family -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) - -// ---------------------------------------------------------------------------- -// Version Token (VerTok) -// -// [07:00] minor version number (0-255) -// [15:08] major version number (0-255) -// [31:16] D3D10_SB_TOKENIZED_PROGRAM_TYPE -// -// ---------------------------------------------------------------------------- - -typedef enum D3D10_SB_TOKENIZED_PROGRAM_TYPE -{ - D3D10_SB_PIXEL_SHADER = 0, - D3D10_SB_VERTEX_SHADER = 1, - D3D10_SB_GEOMETRY_SHADER = 2, - - // D3D11 Shaders - D3D11_SB_HULL_SHADER = 3, - D3D11_SB_DOMAIN_SHADER = 4, - D3D11_SB_COMPUTE_SHADER = 5, - - // Subset of D3D12 Shaders where this field is referenced by runtime - // Entries from 6-12 are unique to state objects - // (e.g. library, callable and raytracing shaders) - D3D12_SB_MESH_SHADER = 13, - D3D12_SB_AMPLIFICATION_SHADER = 14, - - D3D11_SB_RESERVED0 = 0xFFF0 -} D3D10_SB_TOKENIZED_PROGRAM_TYPE; - -#define D3D10_SB_TOKENIZED_PROGRAM_TYPE_MASK 0xffff0000 -#define D3D10_SB_TOKENIZED_PROGRAM_TYPE_SHIFT 16 - -// DECODER MACRO: Retrieve program type from version token -#define DECODE_D3D10_SB_TOKENIZED_PROGRAM_TYPE(VerTok) ((D3D10_SB_TOKENIZED_PROGRAM_TYPE)(((VerTok)&D3D10_SB_TOKENIZED_PROGRAM_TYPE_MASK)>>D3D10_SB_TOKENIZED_PROGRAM_TYPE_SHIFT)) - -#define D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_MASK 0x000000f0 -#define D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_SHIFT 4 -#define D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION_MASK 0x0000000f - -// DECODER MACRO: Retrieve major version # from version token -#define DECODE_D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION(VerTok) (((VerTok)&D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_MASK)>>D3D10_SB_TOKENIZED_PROGRAM_MAJOR_VERSION_SHIFT) -// DECODER MACRO: Retrieve minor version # from version token -#define DECODE_D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION(VerTok) ((VerTok)&D3D10_SB_TOKENIZED_PROGRAM_MINOR_VERSION_MASK) - -// ENCODER MACRO: Create complete VerTok -#define ENCODE_D3D10_SB_TOKENIZED_PROGRAM_VERSION_TOKEN(ProgType,MajorVer,MinorVer) ((((ProgType)<> D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH_SHIFT) - -// ENCODER MACRO: Store instruction length -// portion of OpcodeToken0, in # of DWORDs -// including the opcode token(s). -// Valid range is 1-127. -#define ENCODE_D3D10_SB_TOKENIZED_INSTRUCTION_LENGTH(Length) (((Length)<>D3D10_SB_INSTRUCTION_TEST_BOOLEAN_SHIFT)) -// ENCODER MACRO: Store "zero" or "nonzero" in the opcode -// specific control range of OpcodeToken0 -#define ENCODE_D3D10_SB_INSTRUCTION_TEST_BOOLEAN(Boolean) (((Boolean)<>D3D11_SB_INSTRUCTION_PRECISE_VALUES_SHIFT)) -// ENCODER MACRO: Given a set of -// D3D10_SB_OPERAND_4_COMPONENT_[X|Y|Z|W] values -// or'd together, encode them in OpcodeToken0. -#define ENCODE_D3D11_SB_INSTRUCTION_PRECISE_VALUES(ComponentMask) (((ComponentMask)<>D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE_SHIFT)) -// ENCODER MACRO: Encode the return type for the resinfo instruction -// in the opcode specific control range of OpcodeToken0 -#define ENCODE_D3D10_SB_RESINFO_INSTRUCTION_RETURN_TYPE(ReturnType) (((ReturnType)<> D3D10_SB_OPCODE_EXTENDED_SHIFT) -// ENCODER MACRO: Store in OpcodeToken0 whether the opcode is extended -// by an additional opcode token. -#define ENCODE_D3D10_SB_OPCODE_EXTENDED(bExtended) (((bExtended)!=0)?D3D10_SB_OPCODE_EXTENDED_MASK:0) - -// ---------------------------------------------------------------------------- -// Extended Opcode Format (OpcodeToken1) -// -// If bit31 of an opcode token is set, the -// opcode has an additional extended opcode token DWORD -// directly following OpcodeToken0. Other tokens -// expected for the opcode, such as the operand -// token(s) always follow -// OpcodeToken0 AND OpcodeToken1..n (extended -// opcode tokens, if present). -// -// [05:00] D3D10_SB_EXTENDED_OPCODE_TYPE -// [30:06] if([05:00] == D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS) -// { -// This custom opcode contains controls for SAMPLE. -// [08:06] Ignored, 0. -// [12:09] U texel immediate offset (4 bit 2's comp) (0 default) -// [16:13] V texel immediate offset (4 bit 2's comp) (0 default) -// [20:17] W texel immediate offset (4 bit 2's comp) (0 default) -// [30:14] Ignored, 0. -// } -// else if( [05:00] == D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM ) -// { -// [10:06] D3D10_SB_RESOURCE_DIMENSION -// [22:11] When dimension is D3D11_SB_RESOURCE_DIMENSION_STRUCTURED_BUFFER this holds the buffer stride, otherwise 0 -// [30:23] Ignored, 0. -// } -// else if( [05:00] == D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE ) -// { -// [09:06] D3D10_SB_RESOURCE_RETURN_TYPE for component X -// [13:10] D3D10_SB_RESOURCE_RETURN_TYPE for component Y -// [17:14] D3D10_SB_RESOURCE_RETURN_TYPE for component Z -// [21:18] D3D10_SB_RESOURCE_RETURN_TYPE for component W -// [30:22] Ignored, 0. -// } -// else -// { -// [30:04] Ignored, 0. -// } -// [31] 0 normally. 1 there is another extended opcode. Any number -// of extended opcode tokens can be chained. It is possible that some extended -// opcode tokens could include multiple DWORDS - that is defined -// on a case by case basis. -// -// ---------------------------------------------------------------------------- -typedef enum D3D10_SB_EXTENDED_OPCODE_TYPE -{ - D3D10_SB_EXTENDED_OPCODE_EMPTY = 0, - D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS = 1, - D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM = 2, - D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE = 3, -} D3D10_SB_EXTENDED_OPCODE_TYPE; -#define D3D11_SB_MAX_SIMULTANEOUS_EXTENDED_OPCODES 3 - -#define D3D10_SB_EXTENDED_OPCODE_TYPE_MASK 0x0000003f - -// DECODER MACRO: Given an extended opcode -// token (OpcodeToken1), figure out what type -// of token it is (from D3D10_SB_EXTENDED_OPCODE_TYPE enum) -// to be able to interpret the rest of the token's contents. -#define DECODE_D3D10_SB_EXTENDED_OPCODE_TYPE(OpcodeToken1) ((D3D10_SB_EXTENDED_OPCODE_TYPE)((OpcodeToken1)&D3D10_SB_EXTENDED_OPCODE_TYPE_MASK)) - -// ENCODER MACRO: Store extended opcode token -// type in OpcodeToken1. -#define ENCODE_D3D10_SB_EXTENDED_OPCODE_TYPE(ExtOpcodeType) ((ExtOpcodeType)&D3D10_SB_EXTENDED_OPCODE_TYPE_MASK) - -typedef enum D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD -{ - D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_U = 0, - D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_V = 1, - D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_W = 2, -} D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD; -#define D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD_MASK (3) -#define D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord) (9+4*((Coord)&D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_COORD_MASK)) -#define D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_MASK(Coord) (0x0000000f<>(D3D10_SB_IMMEDIATE_ADDRESS_OFFSET_SHIFT(Coord)))) - -// ENCODER MACRO: Store the immediate texel address offset -// for U or V or W Coord (D3D10_SB_ADDRESS_OFFSET_COORD) in an extended -// opcode token (OpcodeToken1) that has extended opcode -// type == D3D10_SB_EXTENDED_OPCODE_SAMPLE_CONTROLS (opcode type encoded separately) -// A 2's complement number is expected as input, from which the LSB 4 bits are extracted. -#define ENCODE_IMMEDIATE_D3D10_SB_ADDRESS_OFFSET(Coord,ImmediateOffset) (((ImmediateOffset)<>D3D11_SB_EXTENDED_RESOURCE_DIMENSION_SHIFT)) - -// ENCODER MACRO: Store resource dimension -// (D3D10_SB_RESOURCE_DIMENSION enum) into a -// an extended resource declaration token (D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM) -#define ENCODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION(ResourceDim) (((ResourceDim)<>D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE_SHIFT) - -// ENCODER MACRO: Store resource dimension structure stride -// (12-bit unsigned integer) into a -// an extended resource declaration token (D3D11_SB_EXTENDED_OPCODE_RESOURCE_DIM) -#define ENCODE_D3D11_SB_EXTENDED_RESOURCE_DIMENSION_STRUCTURE_STRIDE(Stride) (((Stride)<> \ - (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS + D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE_SHIFT))&D3D10_SB_RESOURCE_RETURN_TYPE_MASK)) - -// ENCODER MACRO: Generate a resource return type for a component in an extended -// resource delcaration token (D3D11_SB_EXTENDED_OPCODE_RESOURCE_RETURN_TYPE) -#define ENCODE_D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE(ReturnType, Component) \ - (((ReturnType)&D3D10_SB_RESOURCE_RETURN_TYPE_MASK) << (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS + D3D11_SB_EXTENDED_RESOURCE_RETURN_TYPE_SHIFT)) - -// ---------------------------------------------------------------------------- -// Custom-Data Block Format -// -// DWORD 0 (CustomDataDescTok): -// [10:00] == D3D10_SB_OPCODE_CUSTOMDATA -// [31:11] == D3D10_SB_CUSTOMDATA_CLASS -// -// DWORD 1: -// 32-bit unsigned integer count of number -// of DWORDs in custom-data block, -// including DWORD 0 and DWORD 1. -// So the minimum value is 0x00000002, -// meaning empty custom-data. -// -// Layout of custom-data contents, for the various meta-data classes, -// not defined in this file. -// -// ---------------------------------------------------------------------------- - -typedef enum D3D10_SB_CUSTOMDATA_CLASS -{ - D3D10_SB_CUSTOMDATA_COMMENT = 0, - D3D10_SB_CUSTOMDATA_DEBUGINFO, - D3D10_SB_CUSTOMDATA_OPAQUE, - D3D10_SB_CUSTOMDATA_DCL_IMMEDIATE_CONSTANT_BUFFER, - D3D11_SB_CUSTOMDATA_SHADER_MESSAGE, - D3D11_SB_CUSTOMDATA_SHADER_CLIP_PLANE_CONSTANT_MAPPINGS_FOR_DX9, -} D3D10_SB_CUSTOMDATA_CLASS; - -#define D3D10_SB_CUSTOMDATA_CLASS_MASK 0xfffff800 -#define D3D10_SB_CUSTOMDATA_CLASS_SHIFT 11 -// DECODER MACRO: Find out what class of custom-data is present. -// The contents of the custom-data block are defined -// for each class of custom-data. -#define DECODE_D3D10_SB_CUSTOMDATA_CLASS(CustomDataDescTok) ((D3D10_SB_CUSTOMDATA_CLASS)(((CustomDataDescTok)&D3D10_SB_CUSTOMDATA_CLASS_MASK)>>D3D10_SB_CUSTOMDATA_CLASS_SHIFT)) -// ENCODER MACRO: Create complete CustomDataDescTok -#define ENCODE_D3D10_SB_CUSTOMDATA_CLASS(CustomDataClass) (ENCODE_D3D10_SB_OPCODE_TYPE(D3D10_SB_OPCODE_CUSTOMDATA)|(((CustomDataClass)<= D3D10_SB_OPERAND_INDEX_1D ) -// D3D10_SB_OPERAND_INDEX_REPRESENTATION for first operand index -// else -// Ignored, 0 -// [27:25] if( [21:20] >= D3D10_SB_OPERAND_INDEX_2D ) -// D3D10_SB_OPERAND_INDEX_REPRESENTATION for second operand index -// else -// Ignored, 0 -// [30:28] if( [21:20] == D3D10_SB_OPERAND_INDEX_3D ) -// D3D10_SB_OPERAND_INDEX_REPRESENTATION for third operand index -// else -// Ignored, 0 -// [31] 0 normally. 1 if extended operand definition, meaning next DWORD -// contains extended operand description. -// -// ---------------------------------------------------------------------------- - -// Number of components in data vector referred to by operand. -typedef enum D3D10_SB_OPERAND_NUM_COMPONENTS -{ - D3D10_SB_OPERAND_0_COMPONENT = 0, - D3D10_SB_OPERAND_1_COMPONENT = 1, - D3D10_SB_OPERAND_4_COMPONENT = 2, - D3D10_SB_OPERAND_N_COMPONENT = 3 // unused for now -} D3D10_SB_OPERAND_NUM_COMPONENTS; -#define D3D10_SB_OPERAND_NUM_COMPONENTS_MASK 0x00000003 - -// DECODER MACRO: Extract from OperandToken0 how many components -// the data vector referred to by the operand contains. -// (D3D10_SB_OPERAND_NUM_COMPONENTS enum) -#define DECODE_D3D10_SB_OPERAND_NUM_COMPONENTS(OperandToken0) ((D3D10_SB_OPERAND_NUM_COMPONENTS)((OperandToken0)&D3D10_SB_OPERAND_NUM_COMPONENTS_MASK)) - -// ENCODER MACRO: Define in OperandToken0 how many components -// the data vector referred to by the operand contains. -// (D3D10_SB_OPERAND_NUM_COMPONENTS enum). -#define ENCODE_D3D10_SB_OPERAND_NUM_COMPONENTS(NumComp) ((NumComp)&D3D10_SB_OPERAND_NUM_COMPONENTS_MASK) - -typedef enum D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE -{ - D3D10_SB_OPERAND_4_COMPONENT_MASK_MODE = 0, // mask 4 components - D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_MODE = 1, // swizzle 4 components - D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MODE = 2, // select 1 of 4 components -} D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE; - -#define D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_MASK 0x0000000c -#define D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_SHIFT 2 - -// DECODER MACRO: For an operand representing 4component data, -// extract from OperandToken0 the method for selecting data from -// the 4 components (D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE). -#define DECODE_D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE(OperandToken0) ((D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE)(((OperandToken0)&D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_MASK)>>D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE_SHIFT)) - -// ENCODER MACRO: For an operand representing 4component data, -// encode in OperandToken0 a value from D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE -#define ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SELECTION_MODE(SelectionMode) (((SelectionMode)<>(D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE_SHIFT+2*((DestComp)&D3D10_SB_4_COMPONENT_NAME_MASK)))&D3D10_SB_4_COMPONENT_NAME_MASK)) - -// ENCODER MACRO: Generate a 4 component swizzle given -// 4 D3D10_SB_4_COMPONENT_NAME source values for dest -// components x, y, z, w respectively. -#define ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SWIZZLE(XSrc,YSrc,ZSrc,WSrc) ((((XSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)| \ - (((YSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)<<2)| \ - (((ZSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)<<4)| \ - (((WSrc)&D3D10_SB_4_COMPONENT_NAME_MASK)<<6) \ - )<>D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_SHIFT)) - -// ENCODER MACRO: Given a D3D10_SB_4_COMPONENT_NAME selecting -// a single component for D3D10_SB_OPERAND_4_COMPONENT_SELECT_1_MODE, -// encode it into OperandToken0 -#define ENCODE_D3D10_SB_OPERAND_4_COMPONENT_SELECT_1(SelectedComp) (((SelectedComp)<>D3D10_SB_OPERAND_TYPE_SHIFT)) - -// ENCODER MACRO: Store operand type in OperandToken0. -#define ENCODE_D3D10_SB_OPERAND_TYPE(OperandType) (((OperandType)<>D3D10_SB_OPERAND_INDEX_DIMENSION_SHIFT)) - -// ENCODER MACRO: Store operand index dimension -// (D3D10_SB_OPERAND_INDEX_DIMENSION enum) in OperandToken0. -#define ENCODE_D3D10_SB_OPERAND_INDEX_DIMENSION(OperandIndexDim) (((OperandIndexDim)<>D3D10_SB_OPERAND_INDEX_REPRESENTATION_SHIFT(Dim))) - -// ENCODER MACRO: Store in OperandToken0 what representation -// an operand index is provided as (D3D10_SB_OPERAND_INDEX_REPRESENTATION enum), -// for index dimension [0], [1] or [2], depending on D3D10_SB_OPERAND_INDEX_DIMENSION. -#define ENCODE_D3D10_SB_OPERAND_INDEX_REPRESENTATION(Dim,IndexRepresentation) (((IndexRepresentation)<>D3D10_SB_OPERAND_EXTENDED_SHIFT) - -// ENCODER MACRO: Store in OperandToken0 whether the operand is extended -// by an additional operand token. -#define ENCODE_D3D10_SB_OPERAND_EXTENDED(bExtended) (((bExtended)!=0)?D3D10_SB_OPERAND_EXTENDED_MASK:0) - -// ---------------------------------------------------------------------------- -// Extended Instruction Operand Format (OperandToken1) -// -// If bit31 of an operand token is set, the -// operand has additional data in a second DWORD -// directly following OperandToken0. Other tokens -// expected for the operand, such as immmediate -// values or relative address operands (full -// operands in themselves) always follow -// OperandToken0 AND OperandToken1..n (extended -// operand tokens, if present). -// -// [05:00] D3D10_SB_EXTENDED_OPERAND_TYPE -// [16:06] if([05:00] == D3D10_SB_EXTENDED_OPERAND_MODIFIER) -// { -// [13:06] D3D10_SB_OPERAND_MODIFIER -// [16:14] Min Precision: D3D11_SB_OPERAND_MIN_PRECISION -// [17:17] Non-uniform: D3D12_SB_OPERAND_NON_UNIFORM -// } -// else -// { -// [17:06] Ignored, 0. -// } -// [30:18] Ignored, 0. -// [31] 0 normally. 1 if second order extended operand definition, -// meaning next DWORD contains yet ANOTHER extended operand -// description. Currently no second order extensions defined. -// This would be useful if a particular extended operand does -// not have enough space to store the required information in -// a single token and so is extended further. -// -// ---------------------------------------------------------------------------- - -typedef enum D3D10_SB_EXTENDED_OPERAND_TYPE -{ - D3D10_SB_EXTENDED_OPERAND_EMPTY = 0, // Might be used if this - // enum is full and - // further extended opcode - // is needed. - D3D10_SB_EXTENDED_OPERAND_MODIFIER = 1, -} D3D10_SB_EXTENDED_OPERAND_TYPE; -#define D3D10_SB_EXTENDED_OPERAND_TYPE_MASK 0x0000003f - -// DECODER MACRO: Given an extended operand -// token (OperandToken1), figure out what type -// of token it is (from D3D10_SB_EXTENDED_OPERAND_TYPE enum) -// to be able to interpret the rest of the token's contents. -#define DECODE_D3D10_SB_EXTENDED_OPERAND_TYPE(OperandToken1) ((D3D10_SB_EXTENDED_OPERAND_TYPE)((OperandToken1)&D3D10_SB_EXTENDED_OPERAND_TYPE_MASK)) - -// ENCODER MACRO: Store extended operand token -// type in OperandToken1. -#define ENCODE_D3D10_SB_EXTENDED_OPERAND_TYPE(ExtOperandType) ((ExtOperandType)&D3D10_SB_EXTENDED_OPERAND_TYPE_MASK) - -typedef enum D3D10_SB_OPERAND_MODIFIER -{ - D3D10_SB_OPERAND_MODIFIER_NONE = 0, // Nop. This is the implied - // default if the extended - // operand is not present for - // an operand for which source - // modifiers are meaningful - D3D10_SB_OPERAND_MODIFIER_NEG = 1, // Negate - D3D10_SB_OPERAND_MODIFIER_ABS = 2, // Absolute value, abs() - D3D10_SB_OPERAND_MODIFIER_ABSNEG = 3, // -abs() -} D3D10_SB_OPERAND_MODIFIER; -#define D3D10_SB_OPERAND_MODIFIER_MASK 0x00003fc0 -#define D3D10_SB_OPERAND_MODIFIER_SHIFT 6 - -// DECODER MACRO: Given a D3D10_SB_EXTENDED_OPERAND_MODIFIER -// extended token (OperandToken1), determine the source modifier -// (D3D10_SB_OPERAND_MODIFIER enum) -#define DECODE_D3D10_SB_OPERAND_MODIFIER(OperandToken1) ((D3D10_SB_OPERAND_MODIFIER)(((OperandToken1)&D3D10_SB_OPERAND_MODIFIER_MASK)>>D3D10_SB_OPERAND_MODIFIER_SHIFT)) - -// ENCODER MACRO: Generate a complete source modifier extended token -// (OperandToken1), given D3D10_SB_OPERAND_MODIFIER enum (the -// ext. operand type is also set to D3D10_SB_EXTENDED_OPERAND_MODIFIER). -#define ENCODE_D3D10_SB_EXTENDED_OPERAND_MODIFIER(SourceMod) ((((SourceMod)<> D3D11_SB_OPERAND_MIN_PRECISION_SHIFT)) - -// ENCODER MACRO: Encode minimum precision for execution -// into the extended operand token, OperandToken1 -#define ENCODE_D3D11_SB_OPERAND_MIN_PRECISION(MinPrecision) (((MinPrecision)<< D3D11_SB_OPERAND_MIN_PRECISION_SHIFT)& D3D11_SB_OPERAND_MIN_PRECISION_MASK) - - -// Non-uniform extended operand modifier. -#define D3D12_SB_OPERAND_NON_UNIFORM_MASK 0x00020000 -#define D3D12_SB_OPERAND_NON_UNIFORM_SHIFT 17 - -// DECODER MACRO: For an OperandToken1 that can specify a non-uniform operand -#define DECODE_D3D12_SB_OPERAND_NON_UNIFORM(OperandToken1) (((OperandToken1)& D3D12_SB_OPERAND_NON_UNIFORM_MASK)>> D3D12_SB_OPERAND_NON_UNIFORM_SHIFT) - -// ENCODER MACRO: Encode non-uniform state into the extended operand token, OperandToken1 -#define ENCODE_D3D12_SB_OPERAND_NON_UNIFORM(NonUniform) (((NonUniform)<< D3D12_SB_OPERAND_NON_UNIFORM_SHIFT)& D3D12_SB_OPERAND_NON_UNIFORM_MASK) - - -#define D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK 0x80000000 -#define D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT 31 -// DECODER MACRO: Determine if an extended operand token -// (OperandToken1) is further extended by yet another token -// (OperandToken2). Currently there are no secondary -// extended operand tokens. -#define DECODE_IS_D3D10_SB_OPERAND_DOUBLE_EXTENDED(OperandToken1) (((OperandToken1)&D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK)>>D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT) - -// ENCODER MACRO: Store in OperandToken1 whether the operand is extended -// by an additional operand token. Currently there are no secondary -// extended operand tokens. -#define ENCODE_D3D10_SB_OPERAND_DOUBLE_EXTENDED(bExtended) (((bExtended)!=0)?D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK:0) - -// ---------------------------------------------------------------------------- -// Name Token (NameToken) (used in declaration statements) -// -// [15:00] D3D10_SB_NAME enumeration -// [31:16] Reserved, 0 -// -// ---------------------------------------------------------------------------- -#define D3D10_SB_NAME_MASK 0x0000ffff - -// DECODER MACRO: Get the name from NameToken -#define DECODE_D3D10_SB_NAME(NameToken) ((D3D10_SB_NAME)((NameToken)&D3D10_SB_NAME_MASK)) - -// ENCODER MACRO: Generate a complete NameToken given a D3D10_SB_NAME -#define ENCODE_D3D10_SB_NAME(Name) ((Name)&D3D10_SB_NAME_MASK) - -//--------------------------------------------------------------------- -// Declaration Statements -// -// Declarations start with a standard opcode token, -// having opcode type being D3D10_SB_OPCODE_DCL*. -// Each particular declaration type has custom -// operand token(s), described below. -//--------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// Global Flags Declaration -// -// OpcodeToken0: -// -// [10:00] D3D10_SB_OPCODE_DCL_GLOBAL_FLAGS -// [11:11] Refactoring allowed if bit set. -// [12:12] Enable double precision float ops. -// [13:13] Force early depth-stencil test. -// [14:14] Enable RAW and structured buffers in non-CS 4.x shaders. -// [15:15] Skip optimizations of shader IL when translating to native code -// [16:16] Enable minimum-precision data types -// [17:17] Enable 11.1 double-precision floating-point instruction extensions -// [18:18] Enable 11.1 non-double instruction extensions -// [23:19] Reserved for future flags. -// [30:24] Instruction length in DWORDs including the opcode token. == 1 -// [31] 0 normally. 1 if extended operand definition, meaning next DWORD -// contains extended operand description. This dcl is currently not -// extended. -// -// OpcodeToken0 is followed by no operands. -// -// ---------------------------------------------------------------------------- -#define D3D10_SB_GLOBAL_FLAG_REFACTORING_ALLOWED (1<<11) -#define D3D11_SB_GLOBAL_FLAG_ENABLE_DOUBLE_PRECISION_FLOAT_OPS (1<<12) -#define D3D11_SB_GLOBAL_FLAG_FORCE_EARLY_DEPTH_STENCIL (1<<13) -#define D3D11_SB_GLOBAL_FLAG_ENABLE_RAW_AND_STRUCTURED_BUFFERS (1<<14) -#define D3D11_1_SB_GLOBAL_FLAG_SKIP_OPTIMIZATION (1<<15) -#define D3D11_1_SB_GLOBAL_FLAG_ENABLE_MINIMUM_PRECISION (1<<16) -#define D3D11_1_SB_GLOBAL_FLAG_ENABLE_DOUBLE_EXTENSIONS (1<<17) -#define D3D11_1_SB_GLOBAL_FLAG_ENABLE_SHADER_EXTENSIONS (1<<18) -#define D3D12_SB_GLOBAL_FLAG_ALL_RESOURCES_BOUND (1<<19) - -#define D3D10_SB_GLOBAL_FLAGS_MASK 0x00fff800 - -// DECODER MACRO: Get global flags -#define DECODE_D3D10_SB_GLOBAL_FLAGS(OpcodeToken0) ((OpcodeToken0)&D3D10_SB_GLOBAL_FLAGS_MASK) - -// ENCODER MACRO: Encode global flags -#define ENCODE_D3D10_SB_GLOBAL_FLAGS(Flags) ((Flags)&D3D10_SB_GLOBAL_FLAGS_MASK) - -// ---------------------------------------------------------------------------- -// Resource Declaration (non multisampled) -// -// OpcodeToken0: -// -// [10:00] D3D10_SB_OPCODE_DCL_RESOURCE -// [15:11] D3D10_SB_RESOURCE_DIMENSION -// [23:16] Ignored, 0 -// [30:24] Instruction length in DWORDs including the opcode token. -// [31] 0 normally. 1 if extended operand definition, meaning next DWORD -// contains extended operand description. This dcl is currently not -// extended. -// -// OpcodeToken0 is followed by 2 operands on Shader Models 4.0 through 5.0: -// (1) an operand, starting with OperandToken0, defining which -// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared. -// (2) a Resource Return Type token (ResourceReturnTypeToken) -// -// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later: -// (1) an operand, starting with OperandToken0, defining which -// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared. -// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, -// and the meaning of the index dimensions are as follows: (t[:]) -// 1 : variable ID being declared -// 2 : the lower bound of the range of resources in the space -// 3 : the upper bound (inclusive) of this range -// As opposed to when the t# is used in shader instructions, where the register -// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index -// dimensions are as follows: (t[]): -// 1 : variable ID being used (matches dcl) -// 2 : absolute index of resource within space (may be dynamically indexed) -// (2) a Resource Return Type token (ResourceReturnTypeToken) -// (3) a DWORD indicating the space index. -// -// ---------------------------------------------------------------------------- -#define D3D10_SB_RESOURCE_DIMENSION_MASK 0x0000F800 -#define D3D10_SB_RESOURCE_DIMENSION_SHIFT 11 - -// DECODER MACRO: Given a resource declaration token, -// (OpcodeToken0), determine the resource dimension -// (D3D10_SB_RESOURCE_DIMENSION enum) -#define DECODE_D3D10_SB_RESOURCE_DIMENSION(OpcodeToken0) ((D3D10_SB_RESOURCE_DIMENSION)(((OpcodeToken0)&D3D10_SB_RESOURCE_DIMENSION_MASK)>>D3D10_SB_RESOURCE_DIMENSION_SHIFT)) - -// ENCODER MACRO: Store resource dimension -// (D3D10_SB_RESOURCE_DIMENSION enum) into a -// a resource declaration token (OpcodeToken0) -#define ENCODE_D3D10_SB_RESOURCE_DIMENSION(ResourceDim) (((ResourceDim)<[:]) -// 1 : variable ID being declared -// 2 : the lower bound of the range of resources in the space -// 3 : the upper bound (inclusive) of this range -// As opposed to when the t# is used in shader instructions, where the register -// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index -// dimensions are as follows: (t[]): -// 1 : variable ID being used (matches dcl) -// 2 : absolute index of resource within space (may be dynamically indexed) -// (2) a Resource Return Type token (ResourceReturnTypeToken) -// (3) a DWORD indicating the space index. -// -// ---------------------------------------------------------------------------- - -// use same macro for encoding/decoding resource dimension aas the non-msaa declaration - -#define D3D10_SB_RESOURCE_SAMPLE_COUNT_MASK 0x07F0000 -#define D3D10_SB_RESOURCE_SAMPLE_COUNT_SHIFT 16 - -// DECODER MACRO: Given a resource declaration token, -// (OpcodeToken0), determine the resource sample count (1..127) -#define DECODE_D3D10_SB_RESOURCE_SAMPLE_COUNT(OpcodeToken0) ((UINT)(((OpcodeToken0)&D3D10_SB_RESOURCE_SAMPLE_COUNT_MASK)>>D3D10_SB_RESOURCE_SAMPLE_COUNT_SHIFT)) - -// ENCODER MACRO: Store resource sample count up to 127 into a -// a resource declaration token (OpcodeToken0) -#define ENCODE_D3D10_SB_RESOURCE_SAMPLE_COUNT(SampleCount) (((SampleCount > 127 ? 127 : SampleCount)<> \ - (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS))&D3D10_SB_RESOURCE_RETURN_TYPE_MASK)) - -// ENCODER MACRO: Generate a resource return type for a component -#define ENCODE_D3D10_SB_RESOURCE_RETURN_TYPE(ReturnType, Component) \ - (((ReturnType)&D3D10_SB_RESOURCE_RETURN_TYPE_MASK) << (Component * D3D10_SB_RESOURCE_RETURN_TYPE_NUMBITS)) - -// ---------------------------------------------------------------------------- -// Sampler Declaration -// -// OpcodeToken0: -// -// [10:00] D3D10_SB_OPCODE_DCL_SAMPLER -// [14:11] D3D10_SB_SAMPLER_MODE -// [23:15] Ignored, 0 -// [30:24] Instruction length in DWORDs including the opcode token. -// [31] 0 normally. 1 if extended operand definition, meaning next DWORD -// contains extended operand description. This dcl is currently not -// extended. -// -// OpcodeToken0 is followed by 1 operand on Shader Models 4.0 through 5.0: -// (1) Operand starting with OperandToken0, defining which sampler -// (D3D10_SB_OPERAND_TYPE_SAMPLER) register # is being declared. -// -// OpcodeToken0 is followed by 2 operands on Shader Model 5.1 and later: -// (1) an operand, starting with OperandToken0, defining which -// s# register (D3D10_SB_OPERAND_TYPE_SAMPLER) is being declared. -// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, -// and the meaning of the index dimensions are as follows: (s[:]) -// 1 : variable ID being declared -// 2 : the lower bound of the range of samplers in the space -// 3 : the upper bound (inclusive) of this range -// As opposed to when the s# is used in shader instructions, where the register -// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index -// dimensions are as follows: (s[]): -// 1 : variable ID being used (matches dcl) -// 2 : absolute index of sampler within space (may be dynamically indexed) -// (2) a DWORD indicating the space index. -// -// ---------------------------------------------------------------------------- -typedef enum D3D10_SB_SAMPLER_MODE -{ - D3D10_SB_SAMPLER_MODE_DEFAULT = 0, - D3D10_SB_SAMPLER_MODE_COMPARISON = 1, - D3D10_SB_SAMPLER_MODE_MONO = 2, -} D3D10_SB_SAMPLER_MODE; - -#define D3D10_SB_SAMPLER_MODE_MASK 0x00007800 -#define D3D10_SB_SAMPLER_MODE_SHIFT 11 - -// DECODER MACRO: Find out if a Constant Buffer is going to be indexed or not -#define DECODE_D3D10_SB_SAMPLER_MODE(OpcodeToken0) ((D3D10_SB_SAMPLER_MODE)(((OpcodeToken0)&D3D10_SB_SAMPLER_MODE_MASK)>>D3D10_SB_SAMPLER_MODE_SHIFT)) - -// ENCODER MACRO: Generate a resource return type for a component -#define ENCODE_D3D10_SB_SAMPLER_MODE(SamplerMode) (((SamplerMode)<>D3D10_SB_INPUT_INTERPOLATION_MODE_SHIFT)) - -// ENCODER MACRO: Encode interpolation mode for a register. -#define ENCODE_D3D10_SB_INPUT_INTERPOLATION_MODE(InterpolationMode) (((InterpolationMode)<[:]) -// 1 : variable ID being declared -// 2 : the lower bound of the range of constant buffers in the space -// 3 : the upper bound (inclusive) of this range -// As opposed to when the cb#[] is used in shader instructions: (cb[][]) -// 1 : variable ID being used (matches dcl) -// 2 : absolute index of constant buffer within space (may be dynamically indexed) -// 3 : location of vector within constant buffer being referenced, -// which may also be dynamically indexed, with no access pattern flag required. -// (2) a DWORD indicating the size of the constant buffer as a count of 16-byte vectors. -// Each vector is 32-bit*4 elements == 128-bits == 16 bytes. -// If the size is specified as 0, the CB size is not known (any size CB -// can be bound to the slot). -// (3) a DWORD indicating the space index. -// -// ---------------------------------------------------------------------------- - -typedef enum D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN -{ - D3D10_SB_CONSTANT_BUFFER_IMMEDIATE_INDEXED = 0, - D3D10_SB_CONSTANT_BUFFER_DYNAMIC_INDEXED = 1 -} D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN; - -#define D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_MASK 0x00000800 -#define D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_SHIFT 11 - -// DECODER MACRO: Find out if a Constant Buffer is going to be indexed or not -#define DECODE_D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN(OpcodeToken0) ((D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN)(((OpcodeToken0)&D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_MASK)>>D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN_SHIFT)) - -// ENCODER MACRO: Encode the access pattern for the Constant Buffer -#define ENCODE_D3D10_SB_D3D10_SB_CONSTANT_BUFFER_ACCESS_PATTERN(AccessPattern) (((AccessPattern)<>D3D10_SB_GS_INPUT_PRIMITIVE_SHIFT)) - -// ENCODER MACRO: Store primitive topology -// (D3D10_SB_PRIMITIVE enum) into a -// a primitive topology declaration token (OpcodeToken0) -#define ENCODE_D3D10_SB_GS_INPUT_PRIMITIVE(Prim) (((Prim)<>D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY_SHIFT)) - -// ENCODER MACRO: Store primitive topology -// (D3D10_SB_PRIMITIVE_TOPOLOGY enum) into a -// a primitive topology declaration token (OpcodeToken0) -#define ENCODE_D3D10_SB_GS_OUTPUT_PRIMITIVE_TOPOLOGY(PrimTopology) (((PrimTopology)<>D3D11_SB_INPUT_CONTROL_POINT_COUNT_SHIFT)) - -// ENCODER MACRO: Store input control point count into a declaration token -#define ENCODE_D3D11_SB_INPUT_CONTROL_POINT_COUNT(Count) (((Count)<>D3D11_SB_OUTPUT_CONTROL_POINT_COUNT_SHIFT)) - -// ENCODER MACRO: Store output control point count into a declaration token -#define ENCODE_D3D11_SB_OUTPUT_CONTROL_POINT_COUNT(Count) (((Count)<>D3D11_SB_TESS_DOMAIN_SHIFT)) - -// ENCODER MACRO: Store tessellator domain -// (D3D11_SB_TESSELLATOR_DOMAIN enum) into a -// a tessellator domain declaration token (OpcodeToken0) -#define ENCODE_D3D11_SB_TESS_DOMAIN(Domain) (((Domain)<>D3D11_SB_TESS_PARTITIONING_SHIFT)) - -// ENCODER MACRO: Store tessellator partitioning -// (D3D11_SB_TESSELLATOR_PARTITIONING enum) into a -// a tessellator partitioning declaration token (OpcodeToken0) -#define ENCODE_D3D11_SB_TESS_PARTITIONING(Partitioning) (((Partitioning)<>D3D11_SB_TESS_OUTPUT_PRIMITIVE_SHIFT)) - -// ENCODER MACRO: Store tessellator output primitive -// (D3D11_SB_TESSELLATOR_OUTPUT_PRIMITIVE enum) into a -// a tessellator output primitive declaration token (OpcodeToken0) -#define ENCODE_D3D11_SB_TESS_OUTPUT_PRIMITIVE(OutputPrimitive) (((OutputPrimitive)<>D3D10_SB_INSTRUCTION_RETURN_TYPE_SHIFT)) -// ENCODER MACRO: Encode the return type for instructions -// in the opcode specific control range of OpcodeToken0 -#define ENCODE_D3D10_SB_INSTRUCTION_RETURN_TYPE(ReturnType) (((ReturnType)<>D3D11_SB_INTERFACE_INDEXED_BIT_SHIFT) ? true : false) -#define ENCODE_D3D11_SB_INTERFACE_INDEXED_BIT(IndexedBit) (((IndexedBit)<>D3D11_SB_INTERFACE_TABLE_LENGTH_SHIFT)) -#define ENCODE_D3D11_SB_INTERFACE_TABLE_LENGTH(TableLength) (((TableLength)<>D3D11_SB_INTERFACE_ARRAY_LENGTH_SHIFT)) -#define ENCODE_D3D11_SB_INTERFACE_ARRAY_LENGTH(ArrayLength) (((ArrayLength)<[:]) -// 1 : variable ID being declared -// 2 : the lower bound of the range of UAV's in the space -// 3 : the upper bound (inclusive) of this range -// As opposed to when the u# is used in shader instructions, where the register -// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index -// dimensions are as follows: (u[]): -// 1 : variable ID being used (matches dcl) -// 2 : absolute index of uav within space (may be dynamically indexed) -// (2) a Resource Return Type token (ResourceReturnTypeToken) -// (3) a DWORD indicating the space index. -// -// ---------------------------------------------------------------------------- -// UAV access scope flags -#define D3D11_SB_GLOBALLY_COHERENT_ACCESS 0x00010000 -#define D3D11_SB_ACCESS_COHERENCY_MASK 0x00010000 - -// DECODER MACRO: Retrieve flags for sync instruction from OpcodeToken0. -#define DECODE_D3D11_SB_ACCESS_COHERENCY_FLAGS(OperandToken0) ((OperandToken0)&D3D11_SB_ACCESS_COHERENCY_MASK) - -// ENCODER MACRO: Given a set of sync instruciton flags, encode them in OpcodeToken0. -#define ENCODE_D3D11_SB_ACCESS_COHERENCY_FLAGS(Flags) ((Flags)&D3D11_SB_ACCESS_COHERENCY_MASK) - -// Additional UAV access flags -#define D3D11_SB_RASTERIZER_ORDERED_ACCESS 0x00020000 - -// Resource flags mask. Use to retrieve all resource flags, including the order preserving counter. -#define D3D11_SB_RESOURCE_FLAGS_MASK (D3D11_SB_GLOBALLY_COHERENT_ACCESS|D3D11_SB_RASTERIZER_ORDERED_ACCESS|D3D11_SB_UAV_HAS_ORDER_PRESERVING_COUNTER) - -// DECODER MACRO: Retrieve UAV access flags for from OpcodeToken0. -#define DECODE_D3D11_SB_RESOURCE_FLAGS(OperandToken0) ((OperandToken0)&D3D11_SB_RESOURCE_FLAGS_MASK) - -// ENCODER MACRO: Given UAV access flags, encode them in OpcodeToken0. -#define ENCODE_D3D11_SB_RESOURCE_FLAGS(Flags) ((Flags)&D3D11_SB_RESOURCE_FLAGS_MASK) - -// ---------------------------------------------------------------------------- -// Raw Unordered Access View Declaration -// -// OpcodeToken0: -// -// [10:00] D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_RAW -// [15:11] Ignored, 0 -// [16:16] D3D11_SB_GLOBALLY_COHERENT_ACCESS or 0 (LOCALLY_COHERENT) -// [17:17] D3D11_SB_RASTERIZER_ORDERED_ACCESS or 0 -// [23:18] Ignored, 0 -// [30:24] Instruction length in DWORDs including the opcode token. -// [31] 0 normally. 1 if extended operand definition, meaning next DWORD -// contains extended operand description. This dcl is currently not -// extended. -// -// OpcodeToken0 is followed by 1 operand on Shader Models 4.0 through 5.0: -// (1) an operand, starting with OperandToken0, defining which -// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared. -// -// OpcodeToken0 is followed by 2 operands on Shader Model 5.1 and later: -// (1) an operand, starting with OperandToken0, defining which -// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared. -// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, -// and the meaning of the index dimensions are as follows: (u[:]) -// 1 : variable ID being declared -// 2 : the lower bound of the range of UAV's in the space -// 3 : the upper bound (inclusive) of this range -// As opposed to when the u# is used in shader instructions, where the register -// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index -// dimensions are as follows: (u[]): -// 1 : variable ID being used (matches dcl) -// 2 : absolute index of uav within space (may be dynamically indexed) -// (2) a DWORD indicating the space index. -// -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// Structured Unordered Access View Declaration -// -// OpcodeToken0: -// -// [10:00] D3D11_SB_OPCODE_DCL_UNORDERED_ACCESS_VIEW_STRUCTURED -// [15:11] Ignored, 0 -// [16:16] D3D11_SB_GLOBALLY_COHERENT_ACCESS or 0 (LOCALLY_COHERENT) -// [17:17] D3D11_SB_RASTERIZER_ORDERED_ACCESS or 0 -// [22:18] Ignored, 0 -// [23:23] D3D11_SB_UAV_HAS_ORDER_PRESERVING_COUNTER or 0 -// -// The presence of this flag means that if a UAV is bound to the -// corresponding slot, it must have been created with -// D3D11_BUFFER_UAV_FLAG_COUNTER at the API. Also, the shader -// can contain either imm_atomic_alloc or _consume instructions -// operating on the given UAV. -// -// If this flag is not present, the shader can still contain -// either imm_atomic_alloc or imm_atomic_consume instructions for -// this UAV. But if such instructions are present in this case, -// and a UAV is bound corresponding slot, it must have been created -// with the D3D11_BUFFER_UAV_FLAG_APPEND flag at the API. -// Append buffers have a counter as well, but values returned -// to the shader are only valid for the lifetime of the shader -// invocation. -// -// [30:24] Instruction length in DWORDs including the opcode token. -// [31] 0 normally. 1 if extended operand definition, meaning next DWORD -// contains extended operand description. This dcl is currently not -// extended. -// -// OpcodeToken0 is followed by 2 operands: -// (1) an operand, starting with OperandToken0, defining which -// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is -// being declared. -// (2) a DWORD indicating UINT32 byte stride -// -// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later: -// (1) an operand, starting with OperandToken0, defining which -// u# register (D3D11_SB_OPERAND_TYPE_UNORDERED_ACCESS_VIEW) is being declared. -// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, -// and the meaning of the index dimensions are as follows: (u[:]) -// 1 : variable ID being declared -// 2 : the lower bound of the range of UAV's in the space -// 3 : the upper bound (inclusive) of this range -// As opposed to when the u# is used in shader instructions, where the register -// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index -// dimensions are as follows: (u[]): -// 1 : variable ID being used (matches dcl) -// 2 : absolute index of uav within space (may be dynamically indexed) -// (2) a DWORD indicating UINT32 byte stride -// (3) a DWORD indicating the space index. -// -// ---------------------------------------------------------------------------- -// UAV flags -#define D3D11_SB_UAV_HAS_ORDER_PRESERVING_COUNTER 0x00800000 -#define D3D11_SB_UAV_FLAGS_MASK 0x00800000 - -// DECODER MACRO: Retrieve flags about UAV from OpcodeToken0. -#define DECODE_D3D11_SB_UAV_FLAGS(OperandToken0) ((OperandToken0)&D3D11_SB_UAV_FLAGS_MASK) - -// ENCODER MACRO: Given a set of UAV flags, encode them in OpcodeToken0. -#define ENCODE_D3D11_SB_UAV_FLAGS(Flags) ((Flags)&D3D11_SB_UAV_FLAGS_MASK) - -// ---------------------------------------------------------------------------- -// Raw Thread Group Shared Memory Declaration -// -// OpcodeToken0: -// -// [10:00] D3D11_SB_OPCODE_DCL_THREAD_GROUP_SHARED_MEMORY_RAW -// [23:11] Ignored, 0 -// [30:24] Instruction length in DWORDs including the opcode token. -// [31] 0 normally. 1 if extended operand definition, meaning next DWORD -// contains extended operand description. This dcl is currently not -// extended. -// -// OpcodeToken0 is followed by 2 operands: -// (1) an operand, starting with OperandToken0, defining which -// g# register (D3D11_SB_OPERAND_TYPE_THREAD_GROUP_SHARED_MEMORY) is being declared. -// (2) a DWORD indicating the byte count, which must be a multiple of 4. -// -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// Structured Thread Group Shared Memory Declaration -// -// OpcodeToken0: -// -// [10:00] D3D11_SB_OPCODE_DCL_THREAD_GROUP_SHARED_MEMORY_STRUCTURED -// [23:11] Ignored, 0 -// [30:24] Instruction length in DWORDs including the opcode token. -// [31] 0 normally. 1 if extended operand definition, meaning next DWORD -// contains extended operand description. This dcl is currently not -// extended. -// -// OpcodeToken0 is followed by 3 operands: -// (1) an operand, starting with OperandToken0, defining which -// g# register (D3D11_SB_OPERAND_TYPE_THREAD_GROUP_SHARED_MEMORY) is -// being declared. -// (2) a DWORD indicating UINT32 struct byte stride -// (3) a DWORD indicating UINT32 struct count -// -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// Raw Shader Resource View Declaration -// -// OpcodeToken0: -// -// [10:00] D3D11_SB_OPCODE_DCL_RESOURCE_RAW -// [23:11] Ignored, 0 -// [30:24] Instruction length in DWORDs including the opcode token. -// [31] 0 normally. 1 if extended operand definition, meaning next DWORD -// contains extended operand description. This dcl is currently not -// extended. -// -// OpcodeToken0 is followed by 1 operand: -// (1) an operand, starting with OperandToken0, defining which -// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared. -// -// OpcodeToken0 is followed by 2 operands on Shader Model 5.1 and later: -// (1) an operand, starting with OperandToken0, defining which -// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared. -// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, -// and the meaning of the index dimensions are as follows: (t[:]) -// 1 : variable ID being declared -// 2 : the lower bound of the range of resources in the space -// 3 : the upper bound (inclusive) of this range -// As opposed to when the t# is used in shader instructions, where the register -// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index -// dimensions are as follows: (t[]): -// 1 : variable ID being used (matches dcl) -// 2 : absolute index of resource within space (may be dynamically indexed) -// (2) a DWORD indicating the space index. -// -// ---------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------- -// Structured Shader Resource View Declaration -// -// OpcodeToken0: -// -// [10:00] D3D11_SB_OPCODE_DCL_RESOURCE_STRUCTURED -// [23:11] Ignored, 0 -// [30:24] Instruction length in DWORDs including the opcode token. -// [31] 0 normally. 1 if extended operand definition, meaning next DWORD -// contains extended operand description. This dcl is currently not -// extended. -// -// OpcodeToken0 is followed by 2 operands: -// (1) an operand, starting with OperandToken0, defining which -// g# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is -// being declared. -// (2) a DWORD indicating UINT32 struct byte stride -// -// OpcodeToken0 is followed by 3 operands on Shader Model 5.1 and later: -// (1) an operand, starting with OperandToken0, defining which -// t# register (D3D10_SB_OPERAND_TYPE_RESOURCE) is being declared. -// The indexing dimension for the register must be D3D10_SB_OPERAND_INDEX_DIMENSION_3D, -// and the meaning of the index dimensions are as follows: (t[:]) -// 1 : variable ID being declared -// 2 : the lower bound of the range of resources in the space -// 3 : the upper bound (inclusive) of this range -// As opposed to when the t# is used in shader instructions, where the register -// must be D3D10_SB_OPERAND_INDEX_DIMENSION_2D, and the meaning of the index -// dimensions are as follows: (t[]): -// 1 : variable ID being used (matches dcl) -// 2 : absolute index of resource within space (may be dynamically indexed) -// (2) a DWORD indicating UINT32 struct byte stride -// (3) a DWORD indicating the space index. -// -// ---------------------------------------------------------------------------- - -#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ -#pragma endregion diff --git a/thirdparty/directx_headers/include/directx/d3dx12_check_feature_support.h b/thirdparty/directx_headers/include/directx/d3dx12_check_feature_support.h index 653a422d03b..433a4ee79ad 100644 --- a/thirdparty/directx_headers/include/directx/d3dx12_check_feature_support.h +++ b/thirdparty/directx_headers/include/directx/d3dx12_check_feature_support.h @@ -1,4 +1,4 @@ -//********************************************************* +//********************************************************* // // Copyright (c) Microsoft Corporation. // Licensed under the MIT License (MIT). diff --git a/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h b/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h index b94073d38cc..27c7f204485 100644 --- a/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h +++ b/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h @@ -25,12 +25,10 @@ struct DefaultSampleMask { operator UINT() noexcept { return UINT_MAX; } }; struct DefaultSampleDesc { operator DXGI_SAMPLE_DESC() noexcept { return DXGI_SAMPLE_DESC{1, 0}; } }; -/* GODOT start */ #if defined(_MSC_VER) #pragma warning(push) #pragma warning(disable : 4324) #endif -/* GODOT start */ template class alignas(void*) CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT { @@ -46,11 +44,9 @@ public: InnerStructType* operator&() noexcept { return &pssInner; } InnerStructType const* operator&() const noexcept { return &pssInner; } }; -/* GODOT start */ #if defined(_MSC_VER) #pragma warning(pop) #endif -/* GODOT end */ typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PIPELINE_STATE_FLAGS, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS> CD3DX12_PIPELINE_STATE_STREAM_FLAGS; typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK> CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK; typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< ID3D12RootSignature*, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE> CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE; diff --git a/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h b/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h index a83d9d017c7..2da79d10f12 100644 --- a/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h +++ b/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h @@ -996,9 +996,7 @@ struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE // two code paths for building root signatures, this helper method reconstructs a 1.0 signature when // 1.1 is not supported. inline HRESULT D3DX12SerializeVersionedRootSignature( -/* GODOT start */ _In_ HMODULE pLibD3D12, -/* GODOT end */ _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignatureDesc, D3D_ROOT_SIGNATURE_VERSION MaxVersion, _Outptr_ ID3DBlob** ppBlob, @@ -1009,22 +1007,18 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( *ppErrorBlob = nullptr; } - /* GODOT start */ - PFN_D3D12_SERIALIZE_ROOT_SIGNATURE d3d_D3D12SerializeRootSignature = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(void *)GetProcAddress(pLibD3D12, "D3D12SerializeRootSignature"); + PFN_D3D12_SERIALIZE_ROOT_SIGNATURE d3d_D3D12SerializeRootSignature = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(void *)GetProcAddress(pLibD3D12, "D3D12SerializeRootSignature"); if (d3d_D3D12SerializeRootSignature == nullptr) { return E_INVALIDARG; } PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE d3d_D3D12SerializeVersionedRootSignature = (PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)(void *)GetProcAddress(pLibD3D12, "D3D12SerializeVersionedRootSignature"); - /* GODOT end */ switch (MaxVersion) { case D3D_ROOT_SIGNATURE_VERSION_1_0: switch (pRootSignatureDesc->Version) { case D3D_ROOT_SIGNATURE_VERSION_1_0: -/* GODOT start */ return d3d_D3D12SerializeRootSignature(&pRootSignatureDesc->Desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); -/* GODOT end */ case D3D_ROOT_SIGNATURE_VERSION_1_1: #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) @@ -1126,9 +1120,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( if (SUCCEEDED(hr)) { const CD3DX12_ROOT_SIGNATURE_DESC desc_1_0(desc_1_1.NumParameters, pParameters_1_0, desc_1_1.NumStaticSamplers, pStaticSamplers == nullptr ? desc_1_1.pStaticSamplers : pStaticSamplers, desc_1_1.Flags); -/* GODOT start */ hr = d3d_D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); -/* GODOT end */ } if (pParameters) @@ -1159,9 +1151,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( { case D3D_ROOT_SIGNATURE_VERSION_1_0: case D3D_ROOT_SIGNATURE_VERSION_1_1: -/* GODOT start */ return d3d_D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); -/* GODOT end */ #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) case D3D_ROOT_SIGNATURE_VERSION_1_2: @@ -1197,9 +1187,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( if (SUCCEEDED(hr)) { const CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC desc(desc_1_1.NumParameters, desc_1_1.pParameters, desc_1_1.NumStaticSamplers, pStaticSamplers == nullptr ? desc_1_1.pStaticSamplers : pStaticSamplers, desc_1_1.Flags); -/* GODOT start */ hr = d3d_D3D12SerializeVersionedRootSignature(&desc, ppBlob, ppErrorBlob); -/* GODOT end */ } if (pStaticSamplers) @@ -1215,9 +1203,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) case D3D_ROOT_SIGNATURE_VERSION_1_2: #endif -/* GODOT start */ return d3d_D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); -/* GODOT end */ } return E_INVALIDARG; diff --git a/thirdparty/directx_headers/patches/0001-mingw-pragma.patch b/thirdparty/directx_headers/patches/0001-mingw-pragma.patch new file mode 100644 index 00000000000..cf7dd55e617 --- /dev/null +++ b/thirdparty/directx_headers/patches/0001-mingw-pragma.patch @@ -0,0 +1,25 @@ +diff --git a/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h b/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h +index f061e79596..27c7f20448 100644 +--- a/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h ++++ b/thirdparty/directx_headers/include/directx/d3dx12_pipeline_state_stream.h +@@ -25,8 +25,10 @@ + struct DefaultSampleMask { operator UINT() noexcept { return UINT_MAX; } }; + struct DefaultSampleDesc { operator DXGI_SAMPLE_DESC() noexcept { return DXGI_SAMPLE_DESC{1, 0}; } }; + ++#if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable : 4324) ++#endif + template + class alignas(void*) CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT + { +@@ -42,7 +44,9 @@ public: + InnerStructType* operator&() noexcept { return &pssInner; } + InnerStructType const* operator&() const noexcept { return &pssInner; } + }; ++#if defined(_MSC_VER) + #pragma warning(pop) ++#endif + typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PIPELINE_STATE_FLAGS, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS> CD3DX12_PIPELINE_STATE_STREAM_FLAGS; + typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK> CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK; + typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< ID3D12RootSignature*, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE> CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE; diff --git a/thirdparty/directx_headers/patches/patch_d3d12_dynamic_load.diff b/thirdparty/directx_headers/patches/0002-win7-8-dynamic-load.patch similarity index 80% rename from thirdparty/directx_headers/patches/patch_d3d12_dynamic_load.diff rename to thirdparty/directx_headers/patches/0002-win7-8-dynamic-load.patch index d520a441721..db7da3b83a1 100644 --- a/thirdparty/directx_headers/patches/patch_d3d12_dynamic_load.diff +++ b/thirdparty/directx_headers/patches/0002-win7-8-dynamic-load.patch @@ -1,28 +1,24 @@ diff --git a/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h b/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h -index 572efed852..18efa7a0cb 100644 +index 572efed852..2da79d10f1 100644 --- a/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h +++ b/thirdparty/directx_headers/include/directx/d3dx12_root_signature.h -@@ -996,6 +996,9 @@ struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE +@@ -996,6 +996,7 @@ struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE // two code paths for building root signatures, this helper method reconstructs a 1.0 signature when // 1.1 is not supported. inline HRESULT D3DX12SerializeVersionedRootSignature( -+/* GODOT start */ + _In_ HMODULE pLibD3D12, -+/* GODOT end */ _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignatureDesc, D3D_ROOT_SIGNATURE_VERSION MaxVersion, _Outptr_ ID3DBlob** ppBlob, -@@ -1006,13 +1009,22 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( +@@ -1006,13 +1007,18 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( *ppErrorBlob = nullptr; } -+ /* GODOT start */ -+ PFN_D3D12_SERIALIZE_ROOT_SIGNATURE d3d_D3D12SerializeRootSignature = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(void *)GetProcAddress(pLibD3D12, "D3D12SerializeRootSignature"); ++ PFN_D3D12_SERIALIZE_ROOT_SIGNATURE d3d_D3D12SerializeRootSignature = (PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(void *)GetProcAddress(pLibD3D12, "D3D12SerializeRootSignature"); + if (d3d_D3D12SerializeRootSignature == nullptr) { + return E_INVALIDARG; + } + PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE d3d_D3D12SerializeVersionedRootSignature = (PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)(void *)GetProcAddress(pLibD3D12, "D3D12SerializeVersionedRootSignature"); -+ /* GODOT end */ switch (MaxVersion) { case D3D_ROOT_SIGNATURE_VERSION_1_0: @@ -30,53 +26,43 @@ index 572efed852..18efa7a0cb 100644 { case D3D_ROOT_SIGNATURE_VERSION_1_0: - return D3D12SerializeRootSignature(&pRootSignatureDesc->Desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); -+/* GODOT start */ + return d3d_D3D12SerializeRootSignature(&pRootSignatureDesc->Desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); -+/* GODOT end */ case D3D_ROOT_SIGNATURE_VERSION_1_1: #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) -@@ -1114,7 +1126,9 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( +@@ -1114,7 +1120,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( if (SUCCEEDED(hr)) { const CD3DX12_ROOT_SIGNATURE_DESC desc_1_0(desc_1_1.NumParameters, pParameters_1_0, desc_1_1.NumStaticSamplers, pStaticSamplers == nullptr ? desc_1_1.pStaticSamplers : pStaticSamplers, desc_1_1.Flags); - hr = D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); -+/* GODOT start */ + hr = d3d_D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); -+/* GODOT end */ } if (pParameters) -@@ -1145,7 +1159,9 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( +@@ -1145,7 +1151,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( { case D3D_ROOT_SIGNATURE_VERSION_1_0: case D3D_ROOT_SIGNATURE_VERSION_1_1: - return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); -+/* GODOT start */ + return d3d_D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); -+/* GODOT end */ #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) case D3D_ROOT_SIGNATURE_VERSION_1_2: -@@ -1181,7 +1197,9 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( +@@ -1181,7 +1187,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( if (SUCCEEDED(hr)) { const CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC desc(desc_1_1.NumParameters, desc_1_1.pParameters, desc_1_1.NumStaticSamplers, pStaticSamplers == nullptr ? desc_1_1.pStaticSamplers : pStaticSamplers, desc_1_1.Flags); - hr = D3D12SerializeVersionedRootSignature(&desc, ppBlob, ppErrorBlob); -+/* GODOT start */ + hr = d3d_D3D12SerializeVersionedRootSignature(&desc, ppBlob, ppErrorBlob); -+/* GODOT end */ } if (pStaticSamplers) -@@ -1197,7 +1215,9 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( +@@ -1197,7 +1203,7 @@ inline HRESULT D3DX12SerializeVersionedRootSignature( #if defined(D3D12_SDK_VERSION) && (D3D12_SDK_VERSION >= 609) case D3D_ROOT_SIGNATURE_VERSION_1_2: #endif - return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); -+/* GODOT start */ + return d3d_D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); -+/* GODOT end */ } return E_INVALIDARG; diff --git a/thirdparty/embree/common/algorithms/parallel_reduce.h b/thirdparty/embree/common/algorithms/parallel_reduce.h index 51ec0a64051..fbff38f6606 100644 --- a/thirdparty/embree/common/algorithms/parallel_reduce.h +++ b/thirdparty/embree/common/algorithms/parallel_reduce.h @@ -58,19 +58,15 @@ namespace embree const Value v = tbb::parallel_reduce(tbb::blocked_range(first,last,minStepSize),identity, [&](const tbb::blocked_range& r, const Value& start) { return reduction(start,func(range(r.begin(),r.end()))); }, reduction,context); - // -- GODOT start -- - // if (context.is_group_execution_cancelled()) - // throw std::runtime_error("task cancelled"); - // -- GODOT end -- + //if (context.is_group_execution_cancelled()) + // throw std::runtime_error("task cancelled"); return v; #else const Value v = tbb::parallel_reduce(tbb::blocked_range(first,last,minStepSize),identity, [&](const tbb::blocked_range& r, const Value& start) { return reduction(start,func(range(r.begin(),r.end()))); }, reduction); - // -- GODOT start -- - // if (tbb::task::self().is_cancelled()) - // throw std::runtime_error("task cancelled"); - // -- GODOT end -- + //if (tbb::task::self().is_cancelled()) + // throw std::runtime_error("task cancelled"); return v; #endif #else // TASKING_PPL diff --git a/thirdparty/embree/common/lexers/stringstream.cpp b/thirdparty/embree/common/lexers/stringstream.cpp index c93da0b420c..fa4266d0b9d 100644 --- a/thirdparty/embree/common/lexers/stringstream.cpp +++ b/thirdparty/embree/common/lexers/stringstream.cpp @@ -39,12 +39,10 @@ namespace embree std::vector str; str.reserve(64); while (cin->peek() != EOF && !isSeparator(cin->peek())) { int c = cin->get(); - // -- GODOT start -- - // if (!isValidChar(c)) throw std::runtime_error("invalid character "+std::string(1,c)+" in input"); + //if (!isValidChar(c)) throw std::runtime_error("invalid character "+std::string(1,c)+" in input"); if (!isValidChar(c)) { abort(); } - // -- GODOT end -- str.push_back((char)c); } str.push_back(0); diff --git a/thirdparty/embree/common/simd/arm/sse2neon.h b/thirdparty/embree/common/simd/arm/sse2neon.h index 76579f94975..5a75ccff20e 100644 --- a/thirdparty/embree/common/simd/arm/sse2neon.h +++ b/thirdparty/embree/common/simd/arm/sse2neon.h @@ -102,9 +102,7 @@ #include #include -// -- GODOT start -- #if defined(_WIN32) && !defined(__MINGW32__) -// -- GODOT end -- /* Definitions for _mm_{malloc,free} are provided by * from both MinGW-w64 and MSVC. */ @@ -1890,13 +1888,11 @@ FORCE_INLINE __m128 _mm_div_ss(__m128 a, __m128 b) #if !defined(SSE2NEON_ALLOC_DEFINED) FORCE_INLINE void _mm_free(void *addr) { -// -- GODOT start -- #if defined(_WIN32) _aligned_free(addr); #else free(addr); #endif -// -- GODOT end -- } #endif @@ -2088,7 +2084,6 @@ FORCE_INLINE void *_mm_malloc(size_t size, size_t align) return malloc(size); if (align == 2 || (sizeof(void *) == 8 && align == 4)) align = sizeof(void *); -// -- GODOT start -- #if defined(_WIN32) ptr = _aligned_malloc(size, align); if (ptr) @@ -2097,7 +2092,6 @@ FORCE_INLINE void *_mm_malloc(size_t size, size_t align) if (!posix_memalign(&ptr, align, size)) return ptr; #endif -// -- GODOT end -- return NULL; } #endif diff --git a/thirdparty/embree/common/sys/alloc.cpp b/thirdparty/embree/common/sys/alloc.cpp index 71616a39822..8e836460314 100644 --- a/thirdparty/embree/common/sys/alloc.cpp +++ b/thirdparty/embree/common/sys/alloc.cpp @@ -24,32 +24,28 @@ namespace embree void enableUSMAllocEmbree(sycl::context* context, sycl::device* device) { - // -- GODOT start -- - // if (tls_context_embree != nullptr) throw std::runtime_error("USM allocation already enabled"); - // if (tls_device_embree != nullptr) throw std::runtime_error("USM allocation already enabled"); + //if (tls_context_embree != nullptr) throw std::runtime_error("USM allocation already enabled"); + //if (tls_device_embree != nullptr) throw std::runtime_error("USM allocation already enabled"); if (tls_context_embree != nullptr) { abort(); } if (tls_device_embree != nullptr) { abort(); } - // -- GODOT end -- tls_context_embree = context; tls_device_embree = device; } void disableUSMAllocEmbree() { - // -- GODOT start -- - // if (tls_context_embree == nullptr) throw std::runtime_error("USM allocation not enabled"); - // if (tls_device_embree == nullptr) throw std::runtime_error("USM allocation not enabled"); + //if (tls_context_embree == nullptr) throw std::runtime_error("USM allocation not enabled"); + //if (tls_device_embree == nullptr) throw std::runtime_error("USM allocation not enabled"); if (tls_context_embree == nullptr) { abort(); } if (tls_device_embree == nullptr) { abort(); } - // -- GODOT end -- tls_context_embree = nullptr; tls_device_embree = nullptr; } @@ -64,16 +60,14 @@ namespace embree void disableUSMAllocTutorial() { - // -- GODOT start -- - // if (tls_context_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled"); - // if (tls_device_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled"); + //if (tls_context_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled"); + //if (tls_device_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled"); if (tls_context_tutorial == nullptr) { abort(); } if (tls_device_tutorial == nullptr) { abort(); } - // -- GODOT end -- tls_context_tutorial = nullptr; tls_device_tutorial = nullptr; @@ -88,13 +82,11 @@ namespace embree assert((align & (align-1)) == 0); void* ptr = _mm_malloc(size,align); - // -- GODOT start -- - // if (size != 0 && ptr == nullptr) - // throw std::bad_alloc(); + //if (size != 0 && ptr == nullptr) + // throw std::bad_alloc(); if (size != 0 && ptr == nullptr) { abort(); } - // -- GODOT end -- return ptr; } @@ -123,13 +115,11 @@ namespace embree else ptr = sycl::aligned_alloc_shared(align,size,*device,*context); - // -- GODOT start -- - // if (size != 0 && ptr == nullptr) - // throw std::bad_alloc(); + //if (size != 0 && ptr == nullptr) + // throw std::bad_alloc(); if (size != 0 && ptr == nullptr) { abort(); } - // -- GODOT end -- return ptr; } @@ -275,12 +265,10 @@ namespace embree /* fall back to 4k pages */ int flags = MEM_COMMIT | MEM_RESERVE; char* ptr = (char*) VirtualAlloc(nullptr,bytes,flags,PAGE_READWRITE); - // -- GODOT start -- - // if (ptr == nullptr) throw std::bad_alloc(); + //if (ptr == nullptr) throw std::bad_alloc(); if (ptr == nullptr) { abort(); } - // -- GODOT end -- hugepages = false; return ptr; } @@ -296,13 +284,11 @@ namespace embree if (bytesNew >= bytesOld) return bytesOld; - // -- GODOT start -- - // if (!VirtualFree((char*)ptr+bytesNew,bytesOld-bytesNew,MEM_DECOMMIT)) - // throw std::bad_alloc(); + //if (!VirtualFree((char*)ptr+bytesNew,bytesOld-bytesNew,MEM_DECOMMIT)) + // throw std::bad_alloc(); if (!VirtualFree((char*)ptr+bytesNew,bytesOld-bytesNew,MEM_DECOMMIT)) { abort(); } - // -- GODOT end -- return bytesNew; } @@ -312,13 +298,11 @@ namespace embree if (bytes == 0) return; - // -- GODOT start -- - // if (!VirtualFree(ptr,0,MEM_RELEASE)) - // throw std::bad_alloc(); + //if (!VirtualFree(ptr,0,MEM_RELEASE)) + // throw std::bad_alloc(); if (!VirtualFree(ptr,0,MEM_RELEASE)) { abort(); } - // -- GODOT end -- } void os_advise(void *ptr, size_t bytes) @@ -422,12 +406,10 @@ namespace embree /* fallback to 4k pages */ void* ptr = (char*) mmap(0, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); - // -- GODOT start -- - // if (ptr == MAP_FAILED) throw std::bad_alloc(); + //if (ptr == MAP_FAILED) throw std::bad_alloc(); if (ptr == MAP_FAILED) { abort(); } - // -- GODOT end -- hugepages = false; /* advise huge page hint for THP */ @@ -443,13 +425,11 @@ namespace embree if (bytesNew >= bytesOld) return bytesOld; - // -- GODOT start -- - // if (munmap((char*)ptr+bytesNew,bytesOld-bytesNew) == -1) - // throw std::bad_alloc(); + //if (munmap((char*)ptr+bytesNew,bytesOld-bytesNew) == -1) + // throw std::bad_alloc(); if (munmap((char*)ptr+bytesNew,bytesOld-bytesNew) == -1) { abort(); } - // -- GODOT end -- return bytesNew; } @@ -462,13 +442,11 @@ namespace embree /* for hugepages we need to also align the size */ const size_t pageSize = hugepages ? PAGE_SIZE_2M : PAGE_SIZE_4K; bytes = (bytes+pageSize-1) & ~(pageSize-1); - // -- GODOT start -- - // if (munmap(ptr,bytes) == -1) - // throw std::bad_alloc(); + //if (munmap(ptr,bytes) == -1) + // throw std::bad_alloc(); if (munmap(ptr,bytes) == -1) { abort(); } - // -- GODOT end -- } /* hint for transparent huge pages (THP) */ diff --git a/thirdparty/embree/common/sys/alloc.h b/thirdparty/embree/common/sys/alloc.h index 28b17f988d8..e2c942049a3 100644 --- a/thirdparty/embree/common/sys/alloc.h +++ b/thirdparty/embree/common/sys/alloc.h @@ -160,10 +160,8 @@ namespace embree typedef std::ptrdiff_t difference_type; __forceinline pointer allocate( size_type n ) { - // -- GODOT start -- - // throw std::runtime_error("no allocation supported"); + //throw std::runtime_error("no allocation supported"); abort(); - // -- GODOT end -- } __forceinline void deallocate( pointer p, size_type n ) { diff --git a/thirdparty/embree/common/sys/platform.h b/thirdparty/embree/common/sys/platform.h index d4a9b9e119a..9f08cd1516b 100644 --- a/thirdparty/embree/common/sys/platform.h +++ b/thirdparty/embree/common/sys/platform.h @@ -213,19 +213,15 @@ #define UPRINT4(x,y,z,w) embree_cout_uniform << STRING(x) << " = " << (x) << ", " << STRING(y) << " = " << (y) << ", " << STRING(z) << " = " << (z) << ", " << STRING(w) << " = " << (w) << embree_endl #if defined(DEBUG) // only report file and line in debug mode - // -- GODOT start -- - // #define THROW_RUNTIME_ERROR(str) \ - // throw std::runtime_error(std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str)); + //#define THROW_RUNTIME_ERROR(str) \ + // throw std::runtime_error(std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str)); #define THROW_RUNTIME_ERROR(str) \ printf("%s (%d): %s", __FILE__, __LINE__, std::string(str).c_str()), abort(); - // -- GODOT end -- #else - // -- GODOT start -- - // #define THROW_RUNTIME_ERROR(str) \ - // throw std::runtime_error(str); + //#define THROW_RUNTIME_ERROR(str) \ + // throw std::runtime_error(str); #define THROW_RUNTIME_ERROR(str) \ abort(); - // -- GODOT end -- #endif #define FATAL(x) THROW_RUNTIME_ERROR(x) diff --git a/thirdparty/embree/common/sys/sysinfo.cpp b/thirdparty/embree/common/sys/sysinfo.cpp index 4ecab052659..4583e49b1ca 100644 --- a/thirdparty/embree/common/sys/sysinfo.cpp +++ b/thirdparty/embree/common/sys/sysinfo.cpp @@ -647,11 +647,9 @@ namespace embree #if defined(__EMSCRIPTEN__) #include -// -- GODOT start -- extern "C" { extern int godot_js_os_hw_concurrency_get(); } -// -- GODOT end -- #endif namespace embree @@ -665,9 +663,24 @@ namespace embree nThreads = sysconf(_SC_NPROCESSORS_ONLN); // does not work in Linux LXC container assert(nThreads); #elif defined(__EMSCRIPTEN__) - // -- GODOT start -- nThreads = godot_js_os_hw_concurrency_get(); - // -- GODOT end -- +#if 0 + // WebAssembly supports pthreads, but not pthread_getaffinity_np. Get the number of logical + // threads from the browser or Node.js using JavaScript. + nThreads = MAIN_THREAD_EM_ASM_INT({ + const isBrowser = typeof window !== 'undefined'; + const isNode = typeof process !== 'undefined' && process.versions != null && + process.versions.node != null; + if (isBrowser) { + // Return 1 if the browser does not expose hardwareConcurrency. + return window.navigator.hardwareConcurrency || 1; + } else if (isNode) { + return require('os').cpus().length; + } else { + return 1; + } + }); +#endif #else cpu_set_t set; if (pthread_getaffinity_np(pthread_self(), sizeof(set), &set) == 0) diff --git a/thirdparty/embree/common/tasking/taskschedulerinternal.cpp b/thirdparty/embree/common/tasking/taskschedulerinternal.cpp index 88b88a30ec5..e89ae04f8bd 100644 --- a/thirdparty/embree/common/tasking/taskschedulerinternal.cpp +++ b/thirdparty/embree/common/tasking/taskschedulerinternal.cpp @@ -48,15 +48,13 @@ namespace embree { Task* prevTask = thread.task; thread.task = this; - // -- GODOT start -- - // try { - // if (context->cancellingException == nullptr) + //try { + // if (context->cancellingException == nullptr) closure->execute(); - // } catch (...) { - // if (context->cancellingException == nullptr) - // context->cancellingException = std::current_exception(); - // } - // -- GODOT end -- + //} catch (...) { + // if (context->cancellingException == nullptr) + // context->cancellingException = std::current_exception(); + //} thread.task = prevTask; add_dependencies(-1); } diff --git a/thirdparty/embree/common/tasking/taskschedulerinternal.h b/thirdparty/embree/common/tasking/taskschedulerinternal.h index 8e3befb739f..4a04323b80a 100644 --- a/thirdparty/embree/common/tasking/taskschedulerinternal.h +++ b/thirdparty/embree/common/tasking/taskschedulerinternal.h @@ -130,13 +130,11 @@ namespace embree __forceinline void* alloc(size_t bytes, size_t align = 64) { size_t ofs = bytes + ((align - stackPtr) & (align-1)); - // -- GODOT start -- - // if (stackPtr + ofs > CLOSURE_STACK_SIZE) - // throw std::runtime_error("closure stack overflow"); + //if (stackPtr + ofs > CLOSURE_STACK_SIZE) + // throw std::runtime_error("closure stack overflow"); if (stackPtr + ofs > CLOSURE_STACK_SIZE) { abort(); } - // -- GODOT end -- stackPtr += ofs; return &stack[stackPtr-bytes]; } @@ -144,13 +142,11 @@ namespace embree template __forceinline void push_right(Thread& thread, const size_t size, const Closure& closure, TaskGroupContext* context) { - // -- GODOT start -- - // if (right >= TASK_STACK_SIZE) - // throw std::runtime_error("task stack overflow"); + //if (right >= TASK_STACK_SIZE) + // throw std::runtime_error("task stack overflow"); if (right >= TASK_STACK_SIZE) { abort(); } - // -- GODOT end -- /* allocate new task on right side of stack */ size_t oldStackPtr = stackPtr; diff --git a/thirdparty/embree/kernels/bvh/bvh_statistics.cpp b/thirdparty/embree/kernels/bvh/bvh_statistics.cpp index 57f75bfd7e8..7ea9736c5c8 100644 --- a/thirdparty/embree/kernels/bvh/bvh_statistics.cpp +++ b/thirdparty/embree/kernels/bvh/bvh_statistics.cpp @@ -150,10 +150,8 @@ namespace embree } } else { - // -- GODOT start -- - // throw std::runtime_error("not supported node type in bvh_statistics"); + //throw std::runtime_error("not supported node type in bvh_statistics"); abort(); - // -- GODOT end -- } return s; } diff --git a/thirdparty/embree/kernels/common/alloc.h b/thirdparty/embree/kernels/common/alloc.h index 840d48c327b..8ac22e53ec7 100644 --- a/thirdparty/embree/kernels/common/alloc.h +++ b/thirdparty/embree/kernels/common/alloc.h @@ -189,13 +189,11 @@ namespace embree , atype(osAllocation ? EMBREE_OS_MALLOC : ALIGNED_MALLOC) , primrefarray(device,0) { - // -- GODOT start -- - // if (osAllocation && useUSM) - // throw std::runtime_error("USM allocation cannot be combined with OS allocation."); + //if (osAllocation && useUSM) + // throw std::runtime_error("USM allocation cannot be combined with OS allocation."); if (osAllocation && useUSM) { abort(); } - // -- GODOT end -- for (size_t i=0; imalloc(device,bytes,align,partial); - // -- GODOT start -- - // if (ptr == nullptr && !blockAllocation) - // throw std::bad_alloc(); + //if (ptr == nullptr && !blockAllocation) + // throw std::bad_alloc(); if (ptr == nullptr && !blockAllocation) { abort(); } - // -- GODOT end -- if (ptr) return ptr; } diff --git a/thirdparty/embree/kernels/common/rtcore.cpp b/thirdparty/embree/kernels/common/rtcore.cpp index eb8d2c0a587..e19c243bf68 100644 --- a/thirdparty/embree/kernels/common/rtcore.cpp +++ b/thirdparty/embree/kernels/common/rtcore.cpp @@ -257,17 +257,15 @@ RTC_NAMESPACE_BEGIN; RTC_TRACE(rtcSetSceneBuildQuality); RTC_VERIFY_HANDLE(hscene); RTC_ENTER_DEVICE(hscene); - // -- GODOT start -- - // if (quality != RTC_BUILD_QUALITY_LOW && - // quality != RTC_BUILD_QUALITY_MEDIUM && - // quality != RTC_BUILD_QUALITY_HIGH) - // throw std::runtime_error("invalid build quality"); + //if (quality != RTC_BUILD_QUALITY_LOW && + // quality != RTC_BUILD_QUALITY_MEDIUM && + // quality != RTC_BUILD_QUALITY_HIGH) + // throw std::runtime_error("invalid build quality"); if (quality != RTC_BUILD_QUALITY_LOW && quality != RTC_BUILD_QUALITY_MEDIUM && quality != RTC_BUILD_QUALITY_HIGH) { abort(); } - // -- GODOT end -- scene->setBuildQuality(quality); RTC_CATCH_END2(scene); } @@ -1570,19 +1568,17 @@ RTC_API void rtcSetGeometryTransform(RTCGeometry hgeometry, unsigned int timeSte RTC_TRACE(rtcSetGeometryBuildQuality); RTC_VERIFY_HANDLE(hgeometry); RTC_ENTER_DEVICE(hgeometry); - // -- GODOT start -- - // if (quality != RTC_BUILD_QUALITY_LOW && - // quality != RTC_BUILD_QUALITY_MEDIUM && - // quality != RTC_BUILD_QUALITY_HIGH && - // quality != RTC_BUILD_QUALITY_REFIT) - // throw std::runtime_error("invalid build quality"); + //if (quality != RTC_BUILD_QUALITY_LOW && + // quality != RTC_BUILD_QUALITY_MEDIUM && + // quality != RTC_BUILD_QUALITY_HIGH && + // quality != RTC_BUILD_QUALITY_REFIT) + // throw std::runtime_error("invalid build quality"); if (quality != RTC_BUILD_QUALITY_LOW && quality != RTC_BUILD_QUALITY_MEDIUM && quality != RTC_BUILD_QUALITY_HIGH && quality != RTC_BUILD_QUALITY_REFIT) { abort(); } - // -- GODOT end -- geometry->setBuildQuality(quality); RTC_CATCH_END2(geometry); } diff --git a/thirdparty/embree/kernels/common/rtcore.h b/thirdparty/embree/kernels/common/rtcore.h index 47526482c11..cd7a6f43952 100644 --- a/thirdparty/embree/kernels/common/rtcore.h +++ b/thirdparty/embree/kernels/common/rtcore.h @@ -13,13 +13,13 @@ namespace embree __forceinline bool isIncoherent(RTCRayQueryFlags flags) { return (flags & RTC_RAY_QUERY_FLAG_COHERENT) == RTC_RAY_QUERY_FLAG_INCOHERENT; } /*! Macros used in the rtcore API implementation */ -// -- GODOT start -- -#define RTC_CATCH_BEGIN -#define RTC_CATCH_END(device) -#define RTC_CATCH_END2(scene) -#define RTC_CATCH_END2_FALSE(scene) return false; -#if 0 -// -- GODOT end -- +#if 1 +# define RTC_CATCH_BEGIN +# define RTC_CATCH_END(device) +# define RTC_CATCH_END2(scene) +# define RTC_CATCH_END2_FALSE(scene) return false; +#else + #define RTC_CATCH_BEGIN try { #define RTC_CATCH_END(device) \ @@ -94,7 +94,6 @@ namespace embree #define RTC_TRACE(x) #endif -// -- GODOT start -- #if 0 /*! used to throw embree API errors */ struct rtcore_error : public std::exception @@ -116,13 +115,12 @@ namespace embree #if defined(DEBUG) // only report file and line in debug mode #define throw_RTCError(error,str) \ printf("%s (%d): %s", __FILE__, __LINE__, std::string(str).c_str()), abort(); - // throw rtcore_error(error,std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str)); + //throw rtcore_error(error,std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str)); #else #define throw_RTCError(error,str) \ abort(); - // throw rtcore_error(error,str); + //throw rtcore_error(error,str); #endif -// -- GODOT end -- #define RTC_BUILD_ARGUMENTS_HAS(settings,member) \ (settings.byteSize > (offsetof(RTCBuildArguments,member)+sizeof(settings.member))) diff --git a/thirdparty/embree/kernels/common/scene.cpp b/thirdparty/embree/kernels/common/scene.cpp index 10cb3c4becb..706cc512dfb 100644 --- a/thirdparty/embree/kernels/common/scene.cpp +++ b/thirdparty/embree/kernels/common/scene.cpp @@ -894,18 +894,16 @@ namespace embree } /* initiate build */ - // -- GODOT start -- - // try { + //try { TaskScheduler::TaskGroupContext context; scheduler->spawn_root([&]() { commit_task(); Lock lock(taskGroup->schedulerMutex); taskGroup->scheduler = nullptr; }, &context, 1, !join); - // } - // catch (...) { - // accels_clear(); - // Lock lock(taskGroup->schedulerMutex); - // taskGroup->scheduler = nullptr; - // throw; - // } - // -- GODOT end -- + //} + //catch (...) { + // accels_clear(); + // Lock lock(taskGroup->schedulerMutex); + // taskGroup->scheduler = nullptr; + // throw; + //} } #endif diff --git a/thirdparty/embree/kernels/common/state.cpp b/thirdparty/embree/kernels/common/state.cpp index 1d73ae9629e..8e83c95bd7e 100644 --- a/thirdparty/embree/kernels/common/state.cpp +++ b/thirdparty/embree/kernels/common/state.cpp @@ -194,15 +194,13 @@ namespace embree bool State::parseFile(const FileName& fileName) { Ref > file; - // -- GODOT start -- - // try { + //try { file = new FileStream(fileName); - // } - // catch (std::runtime_error& e) { - // (void) e; - // return false; - // } - // -- GODOT end -- + //} + //catch (std::runtime_error& e) { + // (void) e; + // return false; + //} std::vector syms; for (size_t i=0; i(first,last,minStepSize),identity, [&](const tbb::blocked_range& r, const Value& start) { return reduction(start,func(range(r.begin(),r.end()))); }, reduction,context); - if (context.is_group_execution_cancelled()) - throw std::runtime_error("task cancelled"); -+ // -- GODOT start -- -+ // if (context.is_group_execution_cancelled()) -+ // throw std::runtime_error("task cancelled"); -+ // -- GODOT end -- ++ //if (context.is_group_execution_cancelled()) ++ // throw std::runtime_error("task cancelled"); return v; #else const Value v = tbb::parallel_reduce(tbb::blocked_range(first,last,minStepSize),identity, @@ -19,51 +17,45 @@ index b52b1e2e13..51ec0a6405 100644 reduction); - if (tbb::task::self().is_cancelled()) - throw std::runtime_error("task cancelled"); -+ // -- GODOT start -- -+ // if (tbb::task::self().is_cancelled()) -+ // throw std::runtime_error("task cancelled"); -+ // -- GODOT end -- ++ //if (tbb::task::self().is_cancelled()) ++ // throw std::runtime_error("task cancelled"); return v; #endif #else // TASKING_PPL diff --git a/thirdparty/embree/common/lexers/stringstream.cpp b/thirdparty/embree/common/lexers/stringstream.cpp -index 42ffb10176..c93da0b420 100644 +index 42ffb10176..fa4266d0b9 100644 --- a/thirdparty/embree/common/lexers/stringstream.cpp +++ b/thirdparty/embree/common/lexers/stringstream.cpp -@@ -39,7 +39,12 @@ namespace embree +@@ -39,7 +39,10 @@ namespace embree std::vector str; str.reserve(64); while (cin->peek() != EOF && !isSeparator(cin->peek())) { int c = cin->get(); - if (!isValidChar(c)) throw std::runtime_error("invalid character "+std::string(1,c)+" in input"); -+ // -- GODOT start -- -+ // if (!isValidChar(c)) throw std::runtime_error("invalid character "+std::string(1,c)+" in input"); ++ //if (!isValidChar(c)) throw std::runtime_error("invalid character "+std::string(1,c)+" in input"); + if (!isValidChar(c)) { + abort(); + } -+ // -- GODOT end -- str.push_back((char)c); } str.push_back(0); diff --git a/thirdparty/embree/common/sys/alloc.cpp b/thirdparty/embree/common/sys/alloc.cpp -index de225fafc6..71616a3982 100644 +index de225fafc6..8e83646031 100644 --- a/thirdparty/embree/common/sys/alloc.cpp +++ b/thirdparty/embree/common/sys/alloc.cpp -@@ -24,16 +24,32 @@ namespace embree +@@ -24,16 +24,28 @@ namespace embree void enableUSMAllocEmbree(sycl::context* context, sycl::device* device) { - if (tls_context_embree != nullptr) throw std::runtime_error("USM allocation already enabled"); - if (tls_device_embree != nullptr) throw std::runtime_error("USM allocation already enabled"); -+ // -- GODOT start -- -+ // if (tls_context_embree != nullptr) throw std::runtime_error("USM allocation already enabled"); -+ // if (tls_device_embree != nullptr) throw std::runtime_error("USM allocation already enabled"); ++ //if (tls_context_embree != nullptr) throw std::runtime_error("USM allocation already enabled"); ++ //if (tls_device_embree != nullptr) throw std::runtime_error("USM allocation already enabled"); + if (tls_context_embree != nullptr) { + abort(); + } + if (tls_device_embree != nullptr) { + abort(); + } -+ // -- GODOT end -- tls_context_embree = context; tls_device_embree = device; } @@ -72,331 +64,292 @@ index de225fafc6..71616a3982 100644 { - if (tls_context_embree == nullptr) throw std::runtime_error("USM allocation not enabled"); - if (tls_device_embree == nullptr) throw std::runtime_error("USM allocation not enabled"); -+ // -- GODOT start -- -+ // if (tls_context_embree == nullptr) throw std::runtime_error("USM allocation not enabled"); -+ // if (tls_device_embree == nullptr) throw std::runtime_error("USM allocation not enabled"); ++ //if (tls_context_embree == nullptr) throw std::runtime_error("USM allocation not enabled"); ++ //if (tls_device_embree == nullptr) throw std::runtime_error("USM allocation not enabled"); + if (tls_context_embree == nullptr) { + abort(); + } + if (tls_device_embree == nullptr) { + abort(); + } -+ // -- GODOT end -- tls_context_embree = nullptr; tls_device_embree = nullptr; } -@@ -48,8 +64,16 @@ namespace embree +@@ -48,8 +60,14 @@ namespace embree void disableUSMAllocTutorial() { - if (tls_context_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled"); - if (tls_device_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled"); -+ // -- GODOT start -- -+ // if (tls_context_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled"); -+ // if (tls_device_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled"); ++ //if (tls_context_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled"); ++ //if (tls_device_tutorial == nullptr) throw std::runtime_error("USM allocation not enabled"); + if (tls_context_tutorial == nullptr) { + abort(); + } + if (tls_device_tutorial == nullptr) { + abort(); + } -+ // -- GODOT end -- tls_context_tutorial = nullptr; tls_device_tutorial = nullptr; -@@ -64,8 +88,13 @@ namespace embree +@@ -64,8 +82,11 @@ namespace embree assert((align & (align-1)) == 0); void* ptr = _mm_malloc(size,align); - if (size != 0 && ptr == nullptr) - throw std::bad_alloc(); -+ // -- GODOT start -- -+ // if (size != 0 && ptr == nullptr) -+ // throw std::bad_alloc(); ++ //if (size != 0 && ptr == nullptr) ++ // throw std::bad_alloc(); + if (size != 0 && ptr == nullptr) { + abort(); + } -+ // -- GODOT end -- return ptr; } -@@ -94,8 +123,13 @@ namespace embree +@@ -94,8 +115,11 @@ namespace embree else ptr = sycl::aligned_alloc_shared(align,size,*device,*context); - if (size != 0 && ptr == nullptr) - throw std::bad_alloc(); -+ // -- GODOT start -- -+ // if (size != 0 && ptr == nullptr) -+ // throw std::bad_alloc(); ++ //if (size != 0 && ptr == nullptr) ++ // throw std::bad_alloc(); + if (size != 0 && ptr == nullptr) { + abort(); + } -+ // -- GODOT end -- return ptr; } -@@ -241,7 +275,12 @@ namespace embree +@@ -241,7 +265,10 @@ namespace embree /* fall back to 4k pages */ int flags = MEM_COMMIT | MEM_RESERVE; char* ptr = (char*) VirtualAlloc(nullptr,bytes,flags,PAGE_READWRITE); - if (ptr == nullptr) throw std::bad_alloc(); -+ // -- GODOT start -- -+ // if (ptr == nullptr) throw std::bad_alloc(); ++ //if (ptr == nullptr) throw std::bad_alloc(); + if (ptr == nullptr) { + abort(); + } -+ // -- GODOT end -- hugepages = false; return ptr; } -@@ -257,8 +296,13 @@ namespace embree +@@ -257,8 +284,11 @@ namespace embree if (bytesNew >= bytesOld) return bytesOld; - if (!VirtualFree((char*)ptr+bytesNew,bytesOld-bytesNew,MEM_DECOMMIT)) - throw std::bad_alloc(); -+ // -- GODOT start -- -+ // if (!VirtualFree((char*)ptr+bytesNew,bytesOld-bytesNew,MEM_DECOMMIT)) -+ // throw std::bad_alloc(); ++ //if (!VirtualFree((char*)ptr+bytesNew,bytesOld-bytesNew,MEM_DECOMMIT)) ++ // throw std::bad_alloc(); + if (!VirtualFree((char*)ptr+bytesNew,bytesOld-bytesNew,MEM_DECOMMIT)) { + abort(); + } -+ // -- GODOT end -- return bytesNew; } -@@ -268,8 +312,13 @@ namespace embree +@@ -268,8 +298,11 @@ namespace embree if (bytes == 0) return; - if (!VirtualFree(ptr,0,MEM_RELEASE)) - throw std::bad_alloc(); -+ // -- GODOT start -- -+ // if (!VirtualFree(ptr,0,MEM_RELEASE)) -+ // throw std::bad_alloc(); ++ //if (!VirtualFree(ptr,0,MEM_RELEASE)) ++ // throw std::bad_alloc(); + if (!VirtualFree(ptr,0,MEM_RELEASE)) { + abort(); + } -+ // -- GODOT end -- } void os_advise(void *ptr, size_t bytes) -@@ -373,7 +422,12 @@ namespace embree +@@ -373,7 +406,10 @@ namespace embree /* fallback to 4k pages */ void* ptr = (char*) mmap(0, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); - if (ptr == MAP_FAILED) throw std::bad_alloc(); -+ // -- GODOT start -- -+ // if (ptr == MAP_FAILED) throw std::bad_alloc(); ++ //if (ptr == MAP_FAILED) throw std::bad_alloc(); + if (ptr == MAP_FAILED) { + abort(); + } -+ // -- GODOT end -- hugepages = false; /* advise huge page hint for THP */ -@@ -389,8 +443,13 @@ namespace embree +@@ -389,8 +425,11 @@ namespace embree if (bytesNew >= bytesOld) return bytesOld; - if (munmap((char*)ptr+bytesNew,bytesOld-bytesNew) == -1) - throw std::bad_alloc(); -+ // -- GODOT start -- -+ // if (munmap((char*)ptr+bytesNew,bytesOld-bytesNew) == -1) -+ // throw std::bad_alloc(); ++ //if (munmap((char*)ptr+bytesNew,bytesOld-bytesNew) == -1) ++ // throw std::bad_alloc(); + if (munmap((char*)ptr+bytesNew,bytesOld-bytesNew) == -1) { + abort(); + } -+ // -- GODOT end -- return bytesNew; } -@@ -403,8 +462,13 @@ namespace embree +@@ -403,8 +442,11 @@ namespace embree /* for hugepages we need to also align the size */ const size_t pageSize = hugepages ? PAGE_SIZE_2M : PAGE_SIZE_4K; bytes = (bytes+pageSize-1) & ~(pageSize-1); - if (munmap(ptr,bytes) == -1) - throw std::bad_alloc(); -+ // -- GODOT start -- -+ // if (munmap(ptr,bytes) == -1) -+ // throw std::bad_alloc(); ++ //if (munmap(ptr,bytes) == -1) ++ // throw std::bad_alloc(); + if (munmap(ptr,bytes) == -1) { + abort(); + } -+ // -- GODOT end -- } /* hint for transparent huge pages (THP) */ diff --git a/thirdparty/embree/common/sys/alloc.h b/thirdparty/embree/common/sys/alloc.h -index e19c2c221a..28b17f988d 100644 +index e19c2c221a..e2c942049a 100644 --- a/thirdparty/embree/common/sys/alloc.h +++ b/thirdparty/embree/common/sys/alloc.h -@@ -160,7 +160,10 @@ namespace embree +@@ -160,7 +160,8 @@ namespace embree typedef std::ptrdiff_t difference_type; __forceinline pointer allocate( size_type n ) { - throw std::runtime_error("no allocation supported"); -+ // -- GODOT start -- -+ // throw std::runtime_error("no allocation supported"); ++ //throw std::runtime_error("no allocation supported"); + abort(); -+ // -- GODOT end -- } __forceinline void deallocate( pointer p, size_type n ) { diff --git a/thirdparty/embree/common/sys/platform.h b/thirdparty/embree/common/sys/platform.h -index 6dc0cf3318..d4a9b9e119 100644 +index 6dc0cf3318..9f08cd1516 100644 --- a/thirdparty/embree/common/sys/platform.h +++ b/thirdparty/embree/common/sys/platform.h -@@ -213,11 +213,19 @@ +@@ -213,11 +213,15 @@ #define UPRINT4(x,y,z,w) embree_cout_uniform << STRING(x) << " = " << (x) << ", " << STRING(y) << " = " << (y) << ", " << STRING(z) << " = " << (z) << ", " << STRING(w) << " = " << (w) << embree_endl #if defined(DEBUG) // only report file and line in debug mode -+ // -- GODOT start -- -+ // #define THROW_RUNTIME_ERROR(str) \ -+ // throw std::runtime_error(std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str)); ++ //#define THROW_RUNTIME_ERROR(str) \ ++ // throw std::runtime_error(std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str)); #define THROW_RUNTIME_ERROR(str) \ - throw std::runtime_error(std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str)); + printf("%s (%d): %s", __FILE__, __LINE__, std::string(str).c_str()), abort(); -+ // -- GODOT end -- #else -+ // -- GODOT start -- -+ // #define THROW_RUNTIME_ERROR(str) \ -+ // throw std::runtime_error(str); ++ //#define THROW_RUNTIME_ERROR(str) \ ++ // throw std::runtime_error(str); #define THROW_RUNTIME_ERROR(str) \ - throw std::runtime_error(str); + abort(); -+ // -- GODOT end -- #endif #define FATAL(x) THROW_RUNTIME_ERROR(x) diff --git a/thirdparty/embree/common/tasking/taskschedulerinternal.cpp b/thirdparty/embree/common/tasking/taskschedulerinternal.cpp -index 83ead95122..88b88a30ec 100644 +index 83ead95122..e89ae04f8b 100644 --- a/thirdparty/embree/common/tasking/taskschedulerinternal.cpp +++ b/thirdparty/embree/common/tasking/taskschedulerinternal.cpp -@@ -48,13 +48,15 @@ namespace embree +@@ -48,13 +48,13 @@ namespace embree { Task* prevTask = thread.task; thread.task = this; - try { - if (context->cancellingException == nullptr) -+ // -- GODOT start -- -+ // try { -+ // if (context->cancellingException == nullptr) ++ //try { ++ // if (context->cancellingException == nullptr) closure->execute(); - } catch (...) { - if (context->cancellingException == nullptr) - context->cancellingException = std::current_exception(); - } -+ // } catch (...) { -+ // if (context->cancellingException == nullptr) -+ // context->cancellingException = std::current_exception(); -+ // } -+ // -- GODOT end -- ++ //} catch (...) { ++ // if (context->cancellingException == nullptr) ++ // context->cancellingException = std::current_exception(); ++ //} thread.task = prevTask; add_dependencies(-1); } diff --git a/thirdparty/embree/common/tasking/taskschedulerinternal.h b/thirdparty/embree/common/tasking/taskschedulerinternal.h -index 355648b3f8..e72d3b72ba 100644 +index b01bebf7c3..4a04323b80 100644 --- a/thirdparty/embree/common/tasking/taskschedulerinternal.h +++ b/thirdparty/embree/common/tasking/taskschedulerinternal.h -@@ -130,8 +130,13 @@ namespace embree +@@ -130,8 +130,11 @@ namespace embree __forceinline void* alloc(size_t bytes, size_t align = 64) { size_t ofs = bytes + ((align - stackPtr) & (align-1)); - if (stackPtr + ofs > CLOSURE_STACK_SIZE) - throw std::runtime_error("closure stack overflow"); -+ // -- GODOT start -- -+ // if (stackPtr + ofs > CLOSURE_STACK_SIZE) -+ // throw std::runtime_error("closure stack overflow"); ++ //if (stackPtr + ofs > CLOSURE_STACK_SIZE) ++ // throw std::runtime_error("closure stack overflow"); + if (stackPtr + ofs > CLOSURE_STACK_SIZE) { + abort(); + } -+ // -- GODOT end -- stackPtr += ofs; return &stack[stackPtr-bytes]; } -@@ -139,8 +144,13 @@ namespace embree +@@ -139,8 +142,11 @@ namespace embree template __forceinline void push_right(Thread& thread, const size_t size, const Closure& closure, TaskGroupContext* context) { - if (right >= TASK_STACK_SIZE) - throw std::runtime_error("task stack overflow"); -+ // -- GODOT start -- -+ // if (right >= TASK_STACK_SIZE) -+ // throw std::runtime_error("task stack overflow"); ++ //if (right >= TASK_STACK_SIZE) ++ // throw std::runtime_error("task stack overflow"); + if (right >= TASK_STACK_SIZE) { + abort(); + } -+ // -- GODOT end -- /* allocate new task on right side of stack */ size_t oldStackPtr = stackPtr; diff --git a/thirdparty/embree/kernels/bvh/bvh_statistics.cpp b/thirdparty/embree/kernels/bvh/bvh_statistics.cpp -index 40f9043736..57f75bfd7e 100644 +index 40f9043736..7ea9736c5c 100644 --- a/thirdparty/embree/kernels/bvh/bvh_statistics.cpp +++ b/thirdparty/embree/kernels/bvh/bvh_statistics.cpp -@@ -150,7 +150,10 @@ namespace embree +@@ -150,7 +150,8 @@ namespace embree } } else { - throw std::runtime_error("not supported node type in bvh_statistics"); -+ // -- GODOT start -- -+ // throw std::runtime_error("not supported node type in bvh_statistics"); ++ //throw std::runtime_error("not supported node type in bvh_statistics"); + abort(); -+ // -- GODOT end -- } return s; } diff --git a/thirdparty/embree/kernels/common/alloc.h b/thirdparty/embree/kernels/common/alloc.h -index 2bd292de4d..840d48c327 100644 +index 2bd292de4d..8ac22e53ec 100644 --- a/thirdparty/embree/kernels/common/alloc.h +++ b/thirdparty/embree/kernels/common/alloc.h -@@ -189,8 +189,13 @@ namespace embree +@@ -189,8 +189,11 @@ namespace embree , atype(osAllocation ? EMBREE_OS_MALLOC : ALIGNED_MALLOC) , primrefarray(device,0) { - if (osAllocation && useUSM) - throw std::runtime_error("USM allocation cannot be combined with OS allocation."); -+ // -- GODOT start -- -+ // if (osAllocation && useUSM) -+ // throw std::runtime_error("USM allocation cannot be combined with OS allocation."); ++ //if (osAllocation && useUSM) ++ // throw std::runtime_error("USM allocation cannot be combined with OS allocation."); + if (osAllocation && useUSM) { + abort(); + } -+ // -- GODOT end -- for (size_t i=0; imalloc(device,bytes,align,partial); - if (ptr == nullptr && !blockAllocation) - throw std::bad_alloc(); -+ // -- GODOT start -- -+ // if (ptr == nullptr && !blockAllocation) -+ // throw std::bad_alloc(); ++ //if (ptr == nullptr && !blockAllocation) ++ // throw std::bad_alloc(); + if (ptr == nullptr && !blockAllocation) { + abort(); + } -+ // -- GODOT end -- if (ptr) return ptr; } diff --git a/thirdparty/embree/kernels/common/rtcore.cpp b/thirdparty/embree/kernels/common/rtcore.cpp -index 8dc5d7045b..eb8d2c0a58 100644 +index 8dc5d7045b..e19c243bf6 100644 --- a/thirdparty/embree/kernels/common/rtcore.cpp +++ b/thirdparty/embree/kernels/common/rtcore.cpp -@@ -257,10 +257,17 @@ RTC_NAMESPACE_BEGIN; +@@ -257,10 +257,15 @@ RTC_NAMESPACE_BEGIN; RTC_TRACE(rtcSetSceneBuildQuality); RTC_VERIFY_HANDLE(hscene); RTC_ENTER_DEVICE(hscene); -+ // -- GODOT start -- -+ // if (quality != RTC_BUILD_QUALITY_LOW && -+ // quality != RTC_BUILD_QUALITY_MEDIUM && -+ // quality != RTC_BUILD_QUALITY_HIGH) -+ // throw std::runtime_error("invalid build quality"); ++ //if (quality != RTC_BUILD_QUALITY_LOW && ++ // quality != RTC_BUILD_QUALITY_MEDIUM && ++ // quality != RTC_BUILD_QUALITY_HIGH) ++ // throw std::runtime_error("invalid build quality"); if (quality != RTC_BUILD_QUALITY_LOW && quality != RTC_BUILD_QUALITY_MEDIUM && - quality != RTC_BUILD_QUALITY_HIGH) @@ -404,20 +357,18 @@ index 8dc5d7045b..eb8d2c0a58 100644 + quality != RTC_BUILD_QUALITY_HIGH) { + abort(); + } -+ // -- GODOT end -- scene->setBuildQuality(quality); RTC_CATCH_END2(scene); } -@@ -1563,11 +1570,19 @@ RTC_API void rtcSetGeometryTransform(RTCGeometry hgeometry, unsigned int timeSte +@@ -1563,11 +1568,17 @@ RTC_API void rtcSetGeometryTransform(RTCGeometry hgeometry, unsigned int timeSte RTC_TRACE(rtcSetGeometryBuildQuality); RTC_VERIFY_HANDLE(hgeometry); RTC_ENTER_DEVICE(hgeometry); -+ // -- GODOT start -- -+ // if (quality != RTC_BUILD_QUALITY_LOW && -+ // quality != RTC_BUILD_QUALITY_MEDIUM && -+ // quality != RTC_BUILD_QUALITY_HIGH && -+ // quality != RTC_BUILD_QUALITY_REFIT) -+ // throw std::runtime_error("invalid build quality"); ++ //if (quality != RTC_BUILD_QUALITY_LOW && ++ // quality != RTC_BUILD_QUALITY_MEDIUM && ++ // quality != RTC_BUILD_QUALITY_HIGH && ++ // quality != RTC_BUILD_QUALITY_REFIT) ++ // throw std::runtime_error("invalid build quality"); if (quality != RTC_BUILD_QUALITY_LOW && quality != RTC_BUILD_QUALITY_MEDIUM && quality != RTC_BUILD_QUALITY_HIGH && @@ -426,44 +377,31 @@ index 8dc5d7045b..eb8d2c0a58 100644 + quality != RTC_BUILD_QUALITY_REFIT) { + abort(); + } -+ // -- GODOT end -- geometry->setBuildQuality(quality); RTC_CATCH_END2(geometry); } diff --git a/thirdparty/embree/kernels/common/rtcore.h b/thirdparty/embree/kernels/common/rtcore.h -index 73a061de11..47526482c1 100644 +index 73a061de11..cd7a6f4395 100644 --- a/thirdparty/embree/kernels/common/rtcore.h +++ b/thirdparty/embree/kernels/common/rtcore.h -@@ -13,13 +13,13 @@ namespace embree +@@ -13,7 +13,7 @@ namespace embree __forceinline bool isIncoherent(RTCRayQueryFlags flags) { return (flags & RTC_RAY_QUERY_FLAG_COHERENT) == RTC_RAY_QUERY_FLAG_INCOHERENT; } /*! Macros used in the rtcore API implementation */ -+// -- GODOT start -- -+#define RTC_CATCH_BEGIN -+#define RTC_CATCH_END(device) -+#define RTC_CATCH_END2(scene) -+#define RTC_CATCH_END2_FALSE(scene) return false; - #if 0 --# define RTC_CATCH_BEGIN --# define RTC_CATCH_END(device) --# define RTC_CATCH_END2(scene) --# define RTC_CATCH_END2_FALSE(scene) return false; --#else -- -+// -- GODOT end -- - #define RTC_CATCH_BEGIN try { - - #define RTC_CATCH_END(device) \ -@@ -94,6 +94,8 @@ namespace embree +-#if 0 ++#if 1 + # define RTC_CATCH_BEGIN + # define RTC_CATCH_END(device) + # define RTC_CATCH_END2(scene) +@@ -94,6 +94,7 @@ namespace embree #define RTC_TRACE(x) #endif -+// -- GODOT start -- +#if 0 /*! used to throw embree API errors */ struct rtcore_error : public std::exception { -@@ -109,14 +111,18 @@ namespace embree +@@ -109,13 +110,16 @@ namespace embree RTCError error; std::string str; }; @@ -473,28 +411,25 @@ index 73a061de11..47526482c1 100644 #define throw_RTCError(error,str) \ - throw rtcore_error(error,std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str)); + printf("%s (%d): %s", __FILE__, __LINE__, std::string(str).c_str()), abort(); -+ // throw rtcore_error(error,std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str)); ++ //throw rtcore_error(error,std::string(__FILE__) + " (" + toString(__LINE__) + "): " + std::string(str)); #else #define throw_RTCError(error,str) \ - throw rtcore_error(error,str); + abort(); -+ // throw rtcore_error(error,str); ++ //throw rtcore_error(error,str); #endif -+// -- GODOT end -- #define RTC_BUILD_ARGUMENTS_HAS(settings,member) \ - (settings.byteSize > (offsetof(RTCBuildArguments,member)+sizeof(settings.member))) diff --git a/thirdparty/embree/kernels/common/scene.cpp b/thirdparty/embree/kernels/common/scene.cpp -index fda8dd938a..10cb3c4bec 100644 +index fda8dd938a..706cc512df 100644 --- a/thirdparty/embree/kernels/common/scene.cpp +++ b/thirdparty/embree/kernels/common/scene.cpp -@@ -894,16 +894,18 @@ namespace embree +@@ -894,16 +894,16 @@ namespace embree } /* initiate build */ - try { -+ // -- GODOT start -- -+ // try { ++ //try { TaskScheduler::TaskGroupContext context; scheduler->spawn_root([&]() { commit_task(); Lock lock(taskGroup->schedulerMutex); taskGroup->scheduler = nullptr; }, &context, 1, !join); - } @@ -504,40 +439,37 @@ index fda8dd938a..10cb3c4bec 100644 - taskGroup->scheduler = nullptr; - throw; - } -+ // } -+ // catch (...) { -+ // accels_clear(); -+ // Lock lock(taskGroup->schedulerMutex); -+ // taskGroup->scheduler = nullptr; -+ // throw; -+ // } -+ // -- GODOT end -- ++ //} ++ //catch (...) { ++ // accels_clear(); ++ // Lock lock(taskGroup->schedulerMutex); ++ // taskGroup->scheduler = nullptr; ++ // throw; ++ //} } #endif diff --git a/thirdparty/embree/kernels/common/state.cpp b/thirdparty/embree/kernels/common/state.cpp -index 4e3ab6ddfb..1d73ae9629 100644 +index 4e3ab6ddfb..8e83c95bd7 100644 --- a/thirdparty/embree/kernels/common/state.cpp +++ b/thirdparty/embree/kernels/common/state.cpp -@@ -194,13 +194,15 @@ namespace embree +@@ -194,13 +194,13 @@ namespace embree bool State::parseFile(const FileName& fileName) { Ref > file; - try { -+ // -- GODOT start -- -+ // try { ++ //try { file = new FileStream(fileName); - } - catch (std::runtime_error& e) { - (void) e; - return false; - } -+ // } -+ // catch (std::runtime_error& e) { -+ // (void) e; -+ // return false; -+ // } -+ // -- GODOT end -- ++ //} ++ //catch (std::runtime_error& e) { ++ // (void) e; ++ // return false; ++ //} std::vector syms; for (size_t i=0; i ++ ++extern "C" { ++extern int godot_js_os_hw_concurrency_get(); ++} + #endif + + namespace embree +@@ -659,6 +663,8 @@ namespace embree + nThreads = sysconf(_SC_NPROCESSORS_ONLN); // does not work in Linux LXC container + assert(nThreads); + #elif defined(__EMSCRIPTEN__) ++ nThreads = godot_js_os_hw_concurrency_get(); ++#if 0 + // WebAssembly supports pthreads, but not pthread_getaffinity_np. Get the number of logical + // threads from the browser or Node.js using JavaScript. + nThreads = MAIN_THREAD_EM_ASM_INT({ +@@ -674,6 +680,7 @@ namespace embree + return 1; + } + }); ++#endif + #else + cpu_set_t set; + if (pthread_getaffinity_np(pthread_self(), sizeof(set), &set) == 0) diff --git a/thirdparty/embree/patches/mingw-no-cpuidex.patch b/thirdparty/embree/patches/0004-mingw-no-cpuidex.patch similarity index 92% rename from thirdparty/embree/patches/mingw-no-cpuidex.patch rename to thirdparty/embree/patches/0004-mingw-no-cpuidex.patch index 5480334cebf..0124ae84674 100644 --- a/thirdparty/embree/patches/mingw-no-cpuidex.patch +++ b/thirdparty/embree/patches/0004-mingw-no-cpuidex.patch @@ -1,5 +1,5 @@ diff --git a/thirdparty/embree/common/sys/sysinfo.cpp b/thirdparty/embree/common/sys/sysinfo.cpp -index d01eab3c9d..4ecab05265 100644 +index d5b653fe5a..4583e49b1c 100644 --- a/thirdparty/embree/common/sys/sysinfo.cpp +++ b/thirdparty/embree/common/sys/sysinfo.cpp @@ -295,7 +295,7 @@ namespace embree diff --git a/thirdparty/embree/patches/mingw-llvm-arm64.diff b/thirdparty/embree/patches/0005-mingw-llvm-arm64.patch similarity index 69% rename from thirdparty/embree/patches/mingw-llvm-arm64.diff rename to thirdparty/embree/patches/0005-mingw-llvm-arm64.patch index c2ad4fb1dc0..da3012ef759 100644 --- a/thirdparty/embree/patches/mingw-llvm-arm64.diff +++ b/thirdparty/embree/patches/0005-mingw-llvm-arm64.patch @@ -1,46 +1,40 @@ diff --git a/thirdparty/embree/common/simd/arm/sse2neon.h b/thirdparty/embree/common/simd/arm/sse2neon.h -index b18d41e783..c54d0b7951 100644 +index b18d41e783..5a75ccff20 100644 --- a/thirdparty/embree/common/simd/arm/sse2neon.h +++ b/thirdparty/embree/common/simd/arm/sse2neon.h -@@ -102,7 +102,9 @@ +@@ -102,7 +102,7 @@ #include #include -#if defined(_WIN32) -+// -- GODOT start -- +#if defined(_WIN32) && !defined(__MINGW32__) -+// -- GODOT end -- /* Definitions for _mm_{malloc,free} are provided by * from both MinGW-w64 and MSVC. */ -@@ -2080,8 +2082,16 @@ FORCE_INLINE void *_mm_malloc(size_t size, size_t align) - return malloc(size); - if (align == 2 || (sizeof(void *) == 8 && align == 4)) - align = sizeof(void *); -- if (!posix_memalign(&ptr, align, size)) -+// -- GODOT start -- -+#if defined(_WIN32) -+ ptr = _aligned_malloc(size, align); -+ if (ptr) - return ptr; -+#else -+ if (!posix_memalign(&ptr, align, size)) -+ return ptr; -+#endif -+// -- GODOT end -- - return NULL; - } - #endif -@@ -1890,7 +1890,13 @@ FORCE_INLINE __m128 _mm_div_ss(__m128 a, __m128 b) +@@ -1888,7 +1888,11 @@ FORCE_INLINE __m128 _mm_div_ss(__m128 a, __m128 b) #if !defined(SSE2NEON_ALLOC_DEFINED) FORCE_INLINE void _mm_free(void *addr) { -+// -- GODOT start -- +#if defined(_WIN32) + _aligned_free(addr); +#else free(addr); +#endif -+// -- GODOT end -- + } + #endif + +@@ -2080,8 +2084,14 @@ FORCE_INLINE void *_mm_malloc(size_t size, size_t align) + return malloc(size); + if (align == 2 || (sizeof(void *) == 8 && align == 4)) + align = sizeof(void *); ++#if defined(_WIN32) ++ ptr = _aligned_malloc(size, align); ++ if (ptr) ++ return ptr; ++#else + if (!posix_memalign(&ptr, align, size)) + return ptr; ++#endif + return NULL; } #endif diff --git a/thirdparty/embree/patches/include-order-dllexport-fix.patch b/thirdparty/embree/patches/0006-include-order-dllexport.patch similarity index 100% rename from thirdparty/embree/patches/include-order-dllexport-fix.patch rename to thirdparty/embree/patches/0006-include-order-dllexport.patch diff --git a/thirdparty/embree/patches/emscripten-nthreads.patch b/thirdparty/embree/patches/emscripten-nthreads.patch deleted file mode 100644 index e42f203475f..00000000000 --- a/thirdparty/embree/patches/emscripten-nthreads.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/thirdparty/embree/common/sys/sysinfo.cpp b/thirdparty/embree/common/sys/sysinfo.cpp -index c98f61fa53..7f7a009a1e 100644 ---- a/thirdparty/embree/common/sys/sysinfo.cpp -+++ b/thirdparty/embree/common/sys/sysinfo.cpp -@@ -640,6 +640,12 @@ namespace embree - - #if defined(__EMSCRIPTEN__) - #include -+ -+// -- GODOT start -- -+extern "C" { -+extern int godot_js_os_hw_concurrency_get(); -+} -+// -- GODOT end -- - #endif - - namespace embree -@@ -653,21 +659,9 @@ namespace embree - nThreads = sysconf(_SC_NPROCESSORS_ONLN); // does not work in Linux LXC container - assert(nThreads); - #elif defined(__EMSCRIPTEN__) -- // WebAssembly supports pthreads, but not pthread_getaffinity_np. Get the number of logical -- // threads from the browser or Node.js using JavaScript. -- nThreads = MAIN_THREAD_EM_ASM_INT({ -- const isBrowser = typeof window !== 'undefined'; -- const isNode = typeof process !== 'undefined' && process.versions != null && -- process.versions.node != null; -- if (isBrowser) { -- // Return 1 if the browser does not expose hardwareConcurrency. -- return window.navigator.hardwareConcurrency || 1; -- } else if (isNode) { -- return require('os').cpus().length; -- } else { -- return 1; -- } -- }); -+ // -- GODOT start -- -+ nThreads = godot_js_os_hw_concurrency_get(); -+ // -- GODOT end -- - #else - cpu_set_t set; - if (pthread_getaffinity_np(pthread_self(), sizeof(set), &set) == 0) diff --git a/thirdparty/enet/enet/enet.h b/thirdparty/enet/enet/enet.h index ed0dd652478..ccd8382c238 100644 --- a/thirdparty/enet/enet/enet.h +++ b/thirdparty/enet/enet/enet.h @@ -13,7 +13,6 @@ extern "C" #include #include -// -- Godot start -- #if 0 #ifdef _WIN32 #include "enet/win32.h" @@ -21,8 +20,7 @@ extern "C" #include "enet/unix.h" #endif #endif -#include "enet/godot.h" -// -- Godot end -- +#include "enet/enet_godot.h" #include "enet/types.h" #include "enet/protocol.h" @@ -93,7 +91,6 @@ typedef enum _ENetSocketShutdown * but not for enet_host_create. Once a server responds to a broadcast, the * address is updated from ENET_HOST_BROADCAST to the server's actual IP address. */ -// -- Godot start -- #if 0 typedef struct _ENetAddress { @@ -101,7 +98,6 @@ typedef struct _ENetAddress enet_uint16 port; } ENetAddress; #endif -// -- Godot end -- /** * Packet flag bit constants. @@ -618,9 +614,7 @@ ENET_API size_t enet_range_coder_decompress (void *, const enet_uint8 *, size_t, extern size_t enet_protocol_command_size (enet_uint8); -// -- Godot start -- -#include "enet/godot_ext.h" -// -- Godot end -- +#include "enet/enet_godot_ext.h" #ifdef __cplusplus } diff --git a/thirdparty/enet/enet/godot.h b/thirdparty/enet/enet/enet_godot.h similarity index 97% rename from thirdparty/enet/enet/godot.h rename to thirdparty/enet/enet/enet_godot.h index 1c60fdbb1fd..faeb5f262be 100644 --- a/thirdparty/enet/enet/godot.h +++ b/thirdparty/enet/enet/enet_godot.h @@ -1,5 +1,5 @@ /**************************************************************************/ -/* godot.h */ +/* enet_godot.h */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -29,7 +29,7 @@ /**************************************************************************/ /** - @file godot.h + @file enet_godot.h @brief ENet Godot header */ diff --git a/thirdparty/enet/enet/enet_godot_ext.h b/thirdparty/enet/enet/enet_godot_ext.h new file mode 100644 index 00000000000..ba81c78b28a --- /dev/null +++ b/thirdparty/enet/enet/enet_godot_ext.h @@ -0,0 +1,53 @@ +/**************************************************************************/ +/* enet_godot_ext.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +/** + @ *file enet_godot_ext.h + @brief ENet Godot extensions header + */ + +#ifndef __ENET_GODOT_EXT_H__ +#define __ENET_GODOT_EXT_H__ + +/** Sets the host field in the address parameter from ip struct. + @param address destination to store resolved address + @param ip the ip struct to read from + @param size the size of the ip struct. + @retval 0 on success + @retval != 0 on failure + @returns the address of the given ip in address on success. +*/ +ENET_API void enet_address_set_ip(ENetAddress * address, const uint8_t * ip, size_t size); + +ENET_API int enet_host_dtls_server_setup (ENetHost *, void *); +ENET_API int enet_host_dtls_client_setup (ENetHost *, const char *, void *); +ENET_API void enet_host_refuse_new_connections (ENetHost *, int); + +#endif // __ENET_GODOT_EXT_H__ diff --git a/thirdparty/enet/enet/godot_ext.h b/thirdparty/enet/enet/godot_ext.h deleted file mode 100644 index 06a621b790e..00000000000 --- a/thirdparty/enet/enet/godot_ext.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __ENET_GODOT_EXT_H__ -#define __ENET_GODOT_EXT_H__ - -/** Sets the host field in the address parameter from ip struct. - @param address destination to store resolved address - @param ip the ip struct to read from - @param size the size of the ip struct. - @retval 0 on success - @retval != 0 on failure - @returns the address of the given ip in address on success. -*/ -ENET_API void enet_address_set_ip(ENetAddress * address, const uint8_t * ip, size_t size); - -ENET_API int enet_host_dtls_server_setup (ENetHost *, void *); -ENET_API int enet_host_dtls_client_setup (ENetHost *, const char *, void *); -ENET_API void enet_host_refuse_new_connections (ENetHost *, int); - -#endif // __ENET_GODOT_EXT_H__ diff --git a/thirdparty/enet/godot.cpp b/thirdparty/enet/enet_godot.cpp similarity index 99% rename from thirdparty/enet/godot.cpp rename to thirdparty/enet/enet_godot.cpp index 9e766e52c3e..6465779528a 100644 --- a/thirdparty/enet/godot.cpp +++ b/thirdparty/enet/enet_godot.cpp @@ -1,5 +1,5 @@ /**************************************************************************/ -/* godot.cpp */ +/* enet_godot.cpp */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -29,7 +29,7 @@ /**************************************************************************/ /** - @file godot.cpp + @file enet_godot.cpp @brief ENet Godot specific functions */ diff --git a/thirdparty/enet/patches/godot_socket.patch b/thirdparty/enet/patches/0001-godot-socket.patch similarity index 88% rename from thirdparty/enet/patches/godot_socket.patch rename to thirdparty/enet/patches/0001-godot-socket.patch index d0fb97fb925..314ee4e6547 100644 --- a/thirdparty/enet/patches/godot_socket.patch +++ b/thirdparty/enet/patches/0001-godot-socket.patch @@ -1,15 +1,14 @@ diff --git a/thirdparty/enet/enet/enet.h b/thirdparty/enet/enet/enet.h -index 4a207041b3..5232f8a869 100644 +index 3001018763..ccd8382c23 100644 --- a/thirdparty/enet/enet/enet.h +++ b/thirdparty/enet/enet/enet.h -@@ -10,13 +10,19 @@ extern "C" +@@ -10,13 +10,17 @@ extern "C" { #endif +#include #include -+// -- Godot start -- +#if 0 #ifdef _WIN32 #include "enet/win32.h" @@ -17,16 +16,14 @@ index 4a207041b3..5232f8a869 100644 #include "enet/unix.h" #endif +#endif -+#include "enet/godot.h" -+// -- Godot end -- ++#include "enet/enet_godot.h" #include "enet/types.h" #include "enet/protocol.h" -@@ -87,11 +93,15 @@ typedef enum _ENetSocketShutdown +@@ -87,11 +91,13 @@ typedef enum _ENetSocketShutdown * but not for enet_host_create. Once a server responds to a broadcast, the * address is updated from ENET_HOST_BROADCAST to the server's actual IP address. */ -+// -- Godot start -- +#if 0 typedef struct _ENetAddress { @@ -34,17 +31,14 @@ index 4a207041b3..5232f8a869 100644 enet_uint16 port; } ENetAddress; +#endif -+// -- Godot end -- /** * Packet flag bit constants. -@@ -608,6 +618,10 @@ ENET_API size_t enet_range_coder_decompress (void *, const enet_uint8 *, size_t, +@@ -608,6 +614,8 @@ ENET_API size_t enet_range_coder_decompress (void *, const enet_uint8 *, size_t, extern size_t enet_protocol_command_size (enet_uint8); -+// -- Godot start -- -+#include "enet/godot_ext.h" -+// -- Godot end -- ++#include "enet/enet_godot_ext.h" + #ifdef __cplusplus } diff --git a/thirdparty/etcpak/patches/bc7e_remove.patch b/thirdparty/etcpak/patches/0001-remove-bc7enc.patch similarity index 100% rename from thirdparty/etcpak/patches/bc7e_remove.patch rename to thirdparty/etcpak/patches/0001-remove-bc7enc.patch diff --git a/thirdparty/glad/patches/patch_enable_both_gl_and_gles.diff b/thirdparty/glad/patches/0001-enable-both-gl-and-gles.patch similarity index 96% rename from thirdparty/glad/patches/patch_enable_both_gl_and_gles.diff rename to thirdparty/glad/patches/0001-enable-both-gl-and-gles.patch index a98efe51d8e..b8274020ce0 100644 --- a/thirdparty/glad/patches/patch_enable_both_gl_and_gles.diff +++ b/thirdparty/glad/patches/0001-enable-both-gl-and-gles.patch @@ -1,5 +1,5 @@ diff --git a/thirdparty/glad/gl.c b/thirdparty/glad/gl.c -index a0b59dbbfb..9f10f6544a 100644 +index e8cc5ff1d9..ee0cc188fc 100644 --- a/thirdparty/glad/gl.c +++ b/thirdparty/glad/gl.c @@ -2475,7 +2475,7 @@ static GLADapiproc glad_gl_get_proc(void *vuserptr, const char *name) { @@ -49,7 +49,7 @@ index a0b59dbbfb..9f10f6544a 100644 } diff --git a/thirdparty/glad/glad/gl.h b/thirdparty/glad/glad/gl.h -index 905c16aeed..f3cb7d8cb5 100644 +index 7f77d6a13f..307ea4dbb8 100644 --- a/thirdparty/glad/glad/gl.h +++ b/thirdparty/glad/glad/gl.h @@ -67,6 +67,7 @@ diff --git a/thirdparty/glslang/patches/disable-absolute-paths-for-apple-compat.patch b/thirdparty/glslang/patches/0001-apple-disable-absolute-paths.patch similarity index 96% rename from thirdparty/glslang/patches/disable-absolute-paths-for-apple-compat.patch rename to thirdparty/glslang/patches/0001-apple-disable-absolute-paths.patch index 135020737ea..3f4fa9fbe42 100644 --- a/thirdparty/glslang/patches/disable-absolute-paths-for-apple-compat.patch +++ b/thirdparty/glslang/patches/0001-apple-disable-absolute-paths.patch @@ -1,5 +1,5 @@ diff --git a/thirdparty/glslang/glslang/Include/InfoSink.h b/thirdparty/glslang/glslang/Include/InfoSink.h -index 23f495dc..137ede85 100644 +index 23f495dcb7..137ede8510 100644 --- a/thirdparty/glslang/glslang/Include/InfoSink.h +++ b/thirdparty/glslang/glslang/Include/InfoSink.h @@ -36,7 +36,7 @@ diff --git a/thirdparty/glslang/patches/fix-build-gcc15.patch b/thirdparty/glslang/patches/0002-gcc15-include-fix.patch similarity index 100% rename from thirdparty/glslang/patches/fix-build-gcc15.patch rename to thirdparty/glslang/patches/0002-gcc15-include-fix.patch diff --git a/thirdparty/jpeg-compressor/patches/clang-fortify-fix.patch b/thirdparty/jpeg-compressor/patches/0001-clang-fortify-fix.patch similarity index 100% rename from thirdparty/jpeg-compressor/patches/clang-fortify-fix.patch rename to thirdparty/jpeg-compressor/patches/0001-clang-fortify-fix.patch diff --git a/thirdparty/libbacktrace/patches/patch_big_files.diff b/thirdparty/libbacktrace/patches/0001-big-files-support.patch similarity index 71% rename from thirdparty/libbacktrace/patches/patch_big_files.diff rename to thirdparty/libbacktrace/patches/0001-big-files-support.patch index 6c3185c8d16..8258b781759 100644 --- a/thirdparty/libbacktrace/patches/patch_big_files.diff +++ b/thirdparty/libbacktrace/patches/0001-big-files-support.patch @@ -1,8 +1,8 @@ diff --git a/thirdparty/libbacktrace/read.c b/thirdparty/libbacktrace/read.c -index 1811c8d2e0..fda8e222d4 100644 +index 7af66602fd..a7e937667c 100644 --- a/thirdparty/libbacktrace/read.c +++ b/thirdparty/libbacktrace/read.c -@@ -52,14 +52,9 @@ backtrace_get_view (struct backtrace_state *state, int descriptor, +@@ -52,14 +52,7 @@ backtrace_get_view (struct backtrace_state *state, int descriptor, { uint64_t got; ssize_t r; @@ -14,34 +14,27 @@ index 1811c8d2e0..fda8e222d4 100644 - } - - if (lseek (descriptor, offset, SEEK_SET) < 0) -+/* GODOT start */ + if (_lseeki64 (descriptor, offset, SEEK_SET) < 0) -+/* GODOT end */ { error_callback (data, "lseek", errno); return 0; -@@ -74,7 +69,13 @@ backtrace_get_view (struct backtrace_state *state, int descriptor, +@@ -74,7 +67,10 @@ backtrace_get_view (struct backtrace_state *state, int descriptor, got = 0; while (got < size) { - r = read (descriptor, view->base, size - got); -+/* GODOT start */ + uint64_t sz = size - got; -+ if (sz > INT_MAX) { ++ if (sz > INT_MAX) + sz = INT_MAX; -+ } + r = _read (descriptor, view->base, sz); -+/* GODOT end */ if (r < 0) { error_callback (data, "read", errno); -@@ -84,6 +85,9 @@ backtrace_get_view (struct backtrace_state *state, int descriptor, +@@ -84,6 +80,7 @@ backtrace_get_view (struct backtrace_state *state, int descriptor, if (r == 0) break; got += (uint64_t) r; -+/* GODOT start */ + view->base += r; -+/* GODOT end */ } if (got < size) diff --git a/thirdparty/libbacktrace/read.c b/thirdparty/libbacktrace/read.c index 9f6997c79e0..a7e937667cc 100644 --- a/thirdparty/libbacktrace/read.c +++ b/thirdparty/libbacktrace/read.c @@ -52,9 +52,7 @@ backtrace_get_view (struct backtrace_state *state, int descriptor, { uint64_t got; ssize_t r; -/* GODOT start */ if (_lseeki64 (descriptor, offset, SEEK_SET) < 0) -/* GODOT end */ { error_callback (data, "lseek", errno); return 0; @@ -69,13 +67,10 @@ backtrace_get_view (struct backtrace_state *state, int descriptor, got = 0; while (got < size) { -/* GODOT start */ uint64_t sz = size - got; - if (sz > INT_MAX) { + if (sz > INT_MAX) sz = INT_MAX; - } r = _read (descriptor, view->base, sz); -/* GODOT end */ if (r < 0) { error_callback (data, "read", errno); @@ -85,9 +80,7 @@ backtrace_get_view (struct backtrace_state *state, int descriptor, if (r == 0) break; got += (uint64_t) r; -/* GODOT start */ view->base += r; -/* GODOT end */ } if (got < size) diff --git a/thirdparty/libktx/patches/0001-external-basisu.patch b/thirdparty/libktx/patches/0001-external-basisu.patch new file mode 100644 index 00000000000..a4b6de06026 --- /dev/null +++ b/thirdparty/libktx/patches/0001-external-basisu.patch @@ -0,0 +1,30 @@ +diff --git a/thirdparty/libktx/lib/basis_transcode.cpp b/thirdparty/libktx/lib/basis_transcode.cpp +index ca68545e4a..d7ecb7a0fd 100644 +--- a/thirdparty/libktx/lib/basis_transcode.cpp ++++ b/thirdparty/libktx/lib/basis_transcode.cpp +@@ -29,9 +29,9 @@ + #include "vkformat_enum.h" + #include "vk_format.h" + #include "basis_sgd.h" +-#include "basisu/transcoder/basisu_file_headers.h" +-#include "basisu/transcoder/basisu_transcoder.h" +-#include "basisu/transcoder/basisu_transcoder_internal.h" ++#include "transcoder/basisu_file_headers.h" ++#include "transcoder/basisu_transcoder.h" ++#include "transcoder/basisu_transcoder_internal.h" + + #undef DECLARE_PRIVATE + #undef DECLARE_PROTECTED +diff --git a/thirdparty/libktx/lib/miniz_wrapper.cpp b/thirdparty/libktx/lib/miniz_wrapper.cpp +index 07920c4809..cbd7da540a 100644 +--- a/thirdparty/libktx/lib/miniz_wrapper.cpp ++++ b/thirdparty/libktx/lib/miniz_wrapper.cpp +@@ -30,7 +30,7 @@ + #pragma GCC diagnostic ignored "-Wextra" + #pragma GCC diagnostic ignored "-Wmisleading-indentation" + #endif +-#include "basisu/encoder/basisu_miniz.h" ++#include "encoder/basisu_miniz.h" + #ifdef __GNUC__ + #pragma GCC diagnostic pop + #endif diff --git a/thirdparty/libktx/patches/godot.patch b/thirdparty/libktx/patches/0002-disable-astc-block-ext.patch similarity index 56% rename from thirdparty/libktx/patches/godot.patch rename to thirdparty/libktx/patches/0002-disable-astc-block-ext.patch index 13468813fb5..73299f485b3 100644 --- a/thirdparty/libktx/patches/godot.patch +++ b/thirdparty/libktx/patches/0002-disable-astc-block-ext.patch @@ -1,20 +1,3 @@ -diff --git a/thirdparty/libktx/lib/basis_transcode.cpp b/thirdparty/libktx/lib/basis_transcode.cpp -index ca68545e4a..d7ecb7a0fd 100644 ---- a/thirdparty/libktx/lib/basis_transcode.cpp -+++ b/thirdparty/libktx/lib/basis_transcode.cpp -@@ -29,9 +29,9 @@ - #include "vkformat_enum.h" - #include "vk_format.h" - #include "basis_sgd.h" --#include "basisu/transcoder/basisu_file_headers.h" --#include "basisu/transcoder/basisu_transcoder.h" --#include "basisu/transcoder/basisu_transcoder_internal.h" -+#include "transcoder/basisu_file_headers.h" -+#include "transcoder/basisu_transcoder.h" -+#include "transcoder/basisu_transcoder_internal.h" - - #undef DECLARE_PRIVATE - #undef DECLARE_PROTECTED diff --git a/thirdparty/libktx/lib/dfdutils/vk2dfd.inl b/thirdparty/libktx/lib/dfdutils/vk2dfd.inl index 5104c8fcb4..3398441e8c 100644 --- a/thirdparty/libktx/lib/dfdutils/vk2dfd.inl @@ -35,16 +18,3 @@ index 5104c8fcb4..3398441e8c 100644 case VK_FORMAT_R16G16_S10_5_NV: return createDFDUnpacked(0, 2, 2, 0, s_S10_5); case VK_FORMAT_A1B5G5R5_UNORM_PACK16_KHR: { int channels[] = {0,1,2,3}; int bits[] = {5,5,5,1}; -diff --git a/thirdparty/libktx/lib/miniz_wrapper.cpp b/thirdparty/libktx/lib/miniz_wrapper.cpp -index 07920c4809..cbd7da540a 100644 ---- a/thirdparty/libktx/lib/miniz_wrapper.cpp -+++ b/thirdparty/libktx/lib/miniz_wrapper.cpp -@@ -30,7 +30,7 @@ - #pragma GCC diagnostic ignored "-Wextra" - #pragma GCC diagnostic ignored "-Wmisleading-indentation" - #endif --#include "basisu/encoder/basisu_miniz.h" -+#include "encoder/basisu_miniz.h" - #ifdef __GNUC__ - #pragma GCC diagnostic pop - #endif diff --git a/thirdparty/libwebp/patches/godot-node-debug-fix.patch b/thirdparty/libwebp/patches/0001-msvc-node-debug-rename.patch similarity index 67% rename from thirdparty/libwebp/patches/godot-node-debug-fix.patch rename to thirdparty/libwebp/patches/0001-msvc-node-debug-rename.patch index 848664dccf9..e0301aa9b9e 100644 --- a/thirdparty/libwebp/patches/godot-node-debug-fix.patch +++ b/thirdparty/libwebp/patches/0001-msvc-node-debug-rename.patch @@ -1,15 +1,13 @@ diff --git a/thirdparty/libwebp/src/enc/quant_enc.c b/thirdparty/libwebp/src/enc/quant_enc.c -index 6d8202d277..8f9a3c8668 100644 ---- a/src/enc/quant_enc.c -+++ b/src/enc/quant_enc.c -@@ -556,6 +556,11 @@ static void AddScore(VP8ModeScore* WEBP_RESTRICT const dst, +index 6d8202d277..302e8047f2 100644 +--- a/thirdparty/libwebp/src/enc/quant_enc.c ++++ b/thirdparty/libwebp/src/enc/quant_enc.c +@@ -556,6 +556,9 @@ static void AddScore(VP8ModeScore* WEBP_RESTRICT const dst, //------------------------------------------------------------------------------ // Performs trellis-optimized quantization. -+// -- GODOT start -- +// Prevents Visual Studio debugger from using this Node struct in place of the Godot Node class. +#define Node Node_libwebp_quant -+// -- GODOT end -- + // Trellis node typedef struct { diff --git a/thirdparty/libwebp/patches/godot-msvc-arm64-fpstrict-fix.patch b/thirdparty/libwebp/patches/0002-msvc-arm64-fpstrict.patch similarity index 80% rename from thirdparty/libwebp/patches/godot-msvc-arm64-fpstrict-fix.patch rename to thirdparty/libwebp/patches/0002-msvc-arm64-fpstrict.patch index b0be515ea82..f7bd6a9a5e9 100644 --- a/thirdparty/libwebp/patches/godot-msvc-arm64-fpstrict-fix.patch +++ b/thirdparty/libwebp/patches/0002-msvc-arm64-fpstrict.patch @@ -1,18 +1,16 @@ diff --git a/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.c b/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.c -index 09028428ac..3184e2b80f 100644 +index 09028428ac..6f1a88bf1a 100644 --- a/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.c +++ b/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.c -@@ -26,7 +26,13 @@ static uint32_t kGammaToLinearTabS[GAMMA_TO_LINEAR_TAB_SIZE + 2]; +@@ -26,7 +26,11 @@ static uint32_t kGammaToLinearTabS[GAMMA_TO_LINEAR_TAB_SIZE + 2]; #define LINEAR_TO_GAMMA_TAB_SIZE (1 << LINEAR_TO_GAMMA_TAB_BITS) static uint32_t kLinearToGammaTabS[LINEAR_TO_GAMMA_TAB_SIZE + 2]; -+// -- GODOT start -- +#if defined(_MSC_VER) +static const double kGammaF = 2.222222222222222; +#else static const double kGammaF = 1. / 0.45; +#endif -+// -- GODOT end -- #define GAMMA_TO_LINEAR_BITS 16 static volatile int kGammaTablesSOk = 0; diff --git a/thirdparty/libwebp/patches/godot-clang-cl-fix.patch b/thirdparty/libwebp/patches/0003-clang-cl-sse2-sse41.patch similarity index 100% rename from thirdparty/libwebp/patches/godot-clang-cl-fix.patch rename to thirdparty/libwebp/patches/0003-clang-cl-sse2-sse41.patch diff --git a/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.c b/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.c index 73b75e98b4a..6f1a88bf1af 100644 --- a/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.c +++ b/thirdparty/libwebp/sharpyuv/sharpyuv_gamma.c @@ -26,13 +26,11 @@ static uint32_t kGammaToLinearTabS[GAMMA_TO_LINEAR_TAB_SIZE + 2]; #define LINEAR_TO_GAMMA_TAB_SIZE (1 << LINEAR_TO_GAMMA_TAB_BITS) static uint32_t kLinearToGammaTabS[LINEAR_TO_GAMMA_TAB_SIZE + 2]; -// -- GODOT start -- #if defined(_MSC_VER) static const double kGammaF = 2.222222222222222; #else static const double kGammaF = 1. / 0.45; #endif -// -- GODOT end -- #define GAMMA_TO_LINEAR_BITS 16 static volatile int kGammaTablesSOk = 0; diff --git a/thirdparty/libwebp/src/enc/quant_enc.c b/thirdparty/libwebp/src/enc/quant_enc.c index 8f9a3c86682..302e8047f25 100644 --- a/thirdparty/libwebp/src/enc/quant_enc.c +++ b/thirdparty/libwebp/src/enc/quant_enc.c @@ -556,10 +556,8 @@ static void AddScore(VP8ModeScore* WEBP_RESTRICT const dst, //------------------------------------------------------------------------------ // Performs trellis-optimized quantization. -// -- GODOT start -- // Prevents Visual Studio debugger from using this Node struct in place of the Godot Node class. #define Node Node_libwebp_quant -// -- GODOT end -- // Trellis node typedef struct { diff --git a/thirdparty/linuxbsd_headers/README.md b/thirdparty/linuxbsd_headers/README.md index 4f36f1f0cbb..3ea30b81b25 100644 --- a/thirdparty/linuxbsd_headers/README.md +++ b/thirdparty/linuxbsd_headers/README.md @@ -11,7 +11,10 @@ readability. - Version: 1.1.3-5 - License: LGPL-2.1+ -Patches in the `patches` directory should be re-applied after updates. +Patches: + +- `0001-musl-standard-poll.patch` (GH-71934) +- `0002-freebsd-sys-endian.patch` (GH-100047) ## dbus diff --git a/thirdparty/linuxbsd_headers/alsa/patches/0001-musl-standard-poll.patch b/thirdparty/linuxbsd_headers/alsa/patches/0001-musl-standard-poll.patch new file mode 100644 index 00000000000..9c5b6bf49fb --- /dev/null +++ b/thirdparty/linuxbsd_headers/alsa/patches/0001-musl-standard-poll.patch @@ -0,0 +1,13 @@ +diff --git a/thirdparty/linuxbsd_headers/alsa/asoundlib.h b/thirdparty/linuxbsd_headers/alsa/asoundlib.h +index 3c2766e325..a546194382 100644 +--- a/thirdparty/linuxbsd_headers/alsa/asoundlib.h ++++ b/thirdparty/linuxbsd_headers/alsa/asoundlib.h +@@ -35,7 +35,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include diff --git a/thirdparty/linuxbsd_headers/alsa/patches/freebsd_endian.diff b/thirdparty/linuxbsd_headers/alsa/patches/0002-freebsd-sys-endian.patch similarity index 100% rename from thirdparty/linuxbsd_headers/alsa/patches/freebsd_endian.diff rename to thirdparty/linuxbsd_headers/alsa/patches/0002-freebsd-sys-endian.patch diff --git a/thirdparty/linuxbsd_headers/alsa/patches/use-standard-poll-h.diff b/thirdparty/linuxbsd_headers/alsa/patches/use-standard-poll-h.diff deleted file mode 100644 index 8d536df5791..00000000000 --- a/thirdparty/linuxbsd_headers/alsa/patches/use-standard-poll-h.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- a/asoundlib.h -+++ b/asoundlib.h -@@ -35,7 +35,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include diff --git a/thirdparty/mbedtls/patches/msvc-redeclaration-bug.diff b/thirdparty/mbedtls/patches/0001-msvc-2019-psa-redeclaration.patch similarity index 100% rename from thirdparty/mbedtls/patches/msvc-redeclaration-bug.diff rename to thirdparty/mbedtls/patches/0001-msvc-2019-psa-redeclaration.patch diff --git a/thirdparty/meshoptimizer/patches/distance-only-metric.patch b/thirdparty/meshoptimizer/patches/0001-simplifier-distance-only-error.patch similarity index 100% rename from thirdparty/meshoptimizer/patches/distance-only-metric.patch rename to thirdparty/meshoptimizer/patches/0001-simplifier-distance-only-error.patch diff --git a/thirdparty/mingw-std-threads/godot.patch b/thirdparty/mingw-std-threads/patches/0001-disable-exceptions.patch similarity index 65% rename from thirdparty/mingw-std-threads/godot.patch rename to thirdparty/mingw-std-threads/patches/0001-disable-exceptions.patch index 9d772a2e531..012a9e7b17f 100644 --- a/thirdparty/mingw-std-threads/godot.patch +++ b/thirdparty/mingw-std-threads/patches/0001-disable-exceptions.patch @@ -1,16 +1,7 @@ diff --git a/thirdparty/mingw-std-threads/mingw.condition_variable.h b/thirdparty/mingw-std-threads/mingw.condition_variable.h -index 50c5ebd6df..d099fad2ec 100644 +index 05086ac429..d099fad2ec 100644 --- a/thirdparty/mingw-std-threads/mingw.condition_variable.h +++ b/thirdparty/mingw-std-threads/mingw.condition_variable.h -@@ -58,7 +58,7 @@ - - namespace mingw_stdthread - { --#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) -+#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) - enum class cv_status { no_timeout, timeout }; - #else - using std::cv_status; @@ -87,12 +87,12 @@ public: : mSemaphore(CreateSemaphoreA(NULL, 0, 0xFFFF, NULL)) { @@ -35,17 +26,8 @@ index 50c5ebd6df..d099fad2ec 100644 } } public: -@@ -547,7 +547,7 @@ namespace std - // was none. Direct specification (std::), however, would be unaffected. - // Take the safe option, and include only in the presence of MinGW's win32 - // implementation. --#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) -+#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) - using mingw_stdthread::cv_status; - using mingw_stdthread::condition_variable; - using mingw_stdthread::condition_variable_any; diff --git a/thirdparty/mingw-std-threads/mingw.mutex.h b/thirdparty/mingw-std-threads/mingw.mutex.h -index 03efa13f8b..1e881e6c7d 100644 +index 3bf9bd02a7..1e881e6c7d 100644 --- a/thirdparty/mingw-std-threads/mingw.mutex.h +++ b/thirdparty/mingw-std-threads/mingw.mutex.h @@ -132,7 +132,7 @@ struct _OwnerThread @@ -73,17 +55,8 @@ index 03efa13f8b..1e881e6c7d 100644 } bool try_lock() { -@@ -480,7 +480,7 @@ namespace std - // was none. Direct specification (std::), however, would be unaffected. - // Take the safe option, and include only in the presence of MinGW's win32 - // implementation. --#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) -+#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) - using mingw_stdthread::recursive_mutex; - using mingw_stdthread::mutex; - using mingw_stdthread::recursive_timed_mutex; diff --git a/thirdparty/mingw-std-threads/mingw.shared_mutex.h b/thirdparty/mingw-std-threads/mingw.shared_mutex.h -index ff1ac65135..ddc46bb826 100644 +index de89b57966..ddc46bb826 100644 --- a/thirdparty/mingw-std-threads/mingw.shared_mutex.h +++ b/thirdparty/mingw-std-threads/mingw.shared_mutex.h @@ -134,7 +134,7 @@ public: @@ -125,21 +98,8 @@ index ff1ac65135..ddc46bb826 100644 mMutex->unlock_shared(); mOwns = false; } -@@ -484,10 +484,10 @@ namespace std - // was none. Direct specification (std::), however, would be unaffected. - // Take the safe option, and include only in the presence of MinGW's win32 - // implementation. --#if (__cplusplus < 201703L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS)) -+#if (__cplusplus < 201703L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)) - using mingw_stdthread::shared_mutex; - #endif --#if (__cplusplus < 201402L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS)) -+#if (__cplusplus < 201402L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)) - using mingw_stdthread::shared_timed_mutex; - using mingw_stdthread::shared_lock; - #elif !defined(MINGW_STDTHREAD_REDUNDANCY_WARNING) // Skip repetition diff --git a/thirdparty/mingw-std-threads/mingw.thread.h b/thirdparty/mingw-std-threads/mingw.thread.h -index bcdd1a36a8..60d2200db2 100644 +index 011c2d8c56..60d2200db2 100644 --- a/thirdparty/mingw-std-threads/mingw.thread.h +++ b/thirdparty/mingw-std-threads/mingw.thread.h @@ -193,10 +193,9 @@ public: @@ -178,12 +138,3 @@ index bcdd1a36a8..60d2200db2 100644 } if (mHandle != kInvalidHandle) { -@@ -326,7 +325,7 @@ namespace std - // was none. Direct specification (std::), however, would be unaffected. - // Take the safe option, and include only in the presence of MinGW's win32 - // implementation. --#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) -+#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) - using mingw_stdthread::thread; - // Remove ambiguity immediately, to avoid problems arising from the above. - //using std::thread; diff --git a/thirdparty/mingw-std-threads/patches/0002-clang-std-replacements-leak.patch b/thirdparty/mingw-std-threads/patches/0002-clang-std-replacements-leak.patch new file mode 100644 index 00000000000..ab67299c3a8 --- /dev/null +++ b/thirdparty/mingw-std-threads/patches/0002-clang-std-replacements-leak.patch @@ -0,0 +1,65 @@ +diff --git a/thirdparty/mingw-std-threads/mingw.condition_variable.h b/thirdparty/mingw-std-threads/mingw.condition_variable.h +index f9e248c154..d099fad2ec 100644 +--- a/thirdparty/mingw-std-threads/mingw.condition_variable.h ++++ b/thirdparty/mingw-std-threads/mingw.condition_variable.h +@@ -58,7 +58,7 @@ + + namespace mingw_stdthread + { +-#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) ++#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) + enum class cv_status { no_timeout, timeout }; + #else + using std::cv_status; +@@ -547,7 +547,7 @@ namespace std + // was none. Direct specification (std::), however, would be unaffected. + // Take the safe option, and include only in the presence of MinGW's win32 + // implementation. +-#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) ++#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) + using mingw_stdthread::cv_status; + using mingw_stdthread::condition_variable; + using mingw_stdthread::condition_variable_any; +diff --git a/thirdparty/mingw-std-threads/mingw.mutex.h b/thirdparty/mingw-std-threads/mingw.mutex.h +index 73698d13cb..1e881e6c7d 100644 +--- a/thirdparty/mingw-std-threads/mingw.mutex.h ++++ b/thirdparty/mingw-std-threads/mingw.mutex.h +@@ -480,7 +480,7 @@ namespace std + // was none. Direct specification (std::), however, would be unaffected. + // Take the safe option, and include only in the presence of MinGW's win32 + // implementation. +-#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) ++#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) + using mingw_stdthread::recursive_mutex; + using mingw_stdthread::mutex; + using mingw_stdthread::recursive_timed_mutex; +diff --git a/thirdparty/mingw-std-threads/mingw.shared_mutex.h b/thirdparty/mingw-std-threads/mingw.shared_mutex.h +index 5375b0fbd1..ddc46bb826 100644 +--- a/thirdparty/mingw-std-threads/mingw.shared_mutex.h ++++ b/thirdparty/mingw-std-threads/mingw.shared_mutex.h +@@ -484,10 +484,10 @@ namespace std + // was none. Direct specification (std::), however, would be unaffected. + // Take the safe option, and include only in the presence of MinGW's win32 + // implementation. +-#if (__cplusplus < 201703L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS)) ++#if (__cplusplus < 201703L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)) + using mingw_stdthread::shared_mutex; + #endif +-#if (__cplusplus < 201402L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS)) ++#if (__cplusplus < 201402L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)) + using mingw_stdthread::shared_timed_mutex; + using mingw_stdthread::shared_lock; + #elif !defined(MINGW_STDTHREAD_REDUNDANCY_WARNING) // Skip repetition +diff --git a/thirdparty/mingw-std-threads/mingw.thread.h b/thirdparty/mingw-std-threads/mingw.thread.h +index 4bcc63e1b1..60d2200db2 100644 +--- a/thirdparty/mingw-std-threads/mingw.thread.h ++++ b/thirdparty/mingw-std-threads/mingw.thread.h +@@ -325,7 +325,7 @@ namespace std + // was none. Direct specification (std::), however, would be unaffected. + // Take the safe option, and include only in the presence of MinGW's win32 + // implementation. +-#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) ++#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) + using mingw_stdthread::thread; + // Remove ambiguity immediately, to avoid problems arising from the above. + //using std::thread; diff --git a/thirdparty/minimp3/minimp3.h b/thirdparty/minimp3/minimp3.h index 2a9975cc86b..49708b9846b 100644 --- a/thirdparty/minimp3/minimp3.h +++ b/thirdparty/minimp3/minimp3.h @@ -1566,7 +1566,6 @@ static void mp3d_synth(float *xl, mp3d_sample_t *dstl, int nch, float *lins) #else /* MINIMP3_FLOAT_OUTPUT */ -// -- GODOT start -- #if defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_ARM)) static f4 g_scale; g_scale = vsetq_lane_f32(1.0f/32768.0f, g_scale, 0); @@ -1576,7 +1575,6 @@ static void mp3d_synth(float *xl, mp3d_sample_t *dstl, int nch, float *lins) #else static const f4 g_scale = { 1.0f/32768.0f, 1.0f/32768.0f, 1.0f/32768.0f, 1.0f/32768.0f }; #endif -// -- GODOT end -- a = VMUL(a, g_scale); b = VMUL(b, g_scale); @@ -1825,17 +1823,15 @@ void mp3dec_f32_to_s16(const float *in, int16_t *out, int num_samples) for(; i < aligned_count; i += 8) { -// -- GODOT start -- #if defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_ARM)) - static f4 g_scale; - g_scale = vsetq_lane_f32(32768.0f, g_scale, 0); - g_scale = vsetq_lane_f32(32768.0f, g_scale, 1); - g_scale = vsetq_lane_f32(32768.0f, g_scale, 2); - g_scale = vsetq_lane_f32(32768.0f, g_scale, 3); + static f4 g_scale; + g_scale = vsetq_lane_f32(32768.0f, g_scale, 0); + g_scale = vsetq_lane_f32(32768.0f, g_scale, 1); + g_scale = vsetq_lane_f32(32768.0f, g_scale, 2); + g_scale = vsetq_lane_f32(32768.0f, g_scale, 3); #else static const f4 g_scale = { 32768.0f, 32768.0f, 32768.0f, 32768.0f }; #endif -// -- GODOT end -- f4 a = VMUL(VLD(&in[i ]), g_scale); f4 b = VMUL(VLD(&in[i+4]), g_scale); diff --git a/thirdparty/minimp3/patches/msvc-arm-fix.patch b/thirdparty/minimp3/patches/0001-msvc-arm.patch similarity index 69% rename from thirdparty/minimp3/patches/msvc-arm-fix.patch rename to thirdparty/minimp3/patches/0001-msvc-arm.patch index bca915acebf..8121dec9eb3 100644 --- a/thirdparty/minimp3/patches/msvc-arm-fix.patch +++ b/thirdparty/minimp3/patches/0001-msvc-arm.patch @@ -1,12 +1,11 @@ diff --git a/thirdparty/minimp3/minimp3.h b/thirdparty/minimp3/minimp3.h -index 3220ae1a85..2a9975cc86 100644 +index 3220ae1a85..49708b9846 100644 --- a/thirdparty/minimp3/minimp3.h +++ b/thirdparty/minimp3/minimp3.h -@@ -1566,7 +1566,18 @@ static void mp3d_synth(float *xl, mp3d_sample_t *dstl, int nch, float *lins) +@@ -1566,7 +1566,16 @@ static void mp3d_synth(float *xl, mp3d_sample_t *dstl, int nch, float *lins) #else /* MINIMP3_FLOAT_OUTPUT */ -+// -- GODOT start -- +#if defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_ARM)) + static f4 g_scale; + g_scale = vsetq_lane_f32(1.0f/32768.0f, g_scale, 0); @@ -16,27 +15,24 @@ index 3220ae1a85..2a9975cc86 100644 +#else static const f4 g_scale = { 1.0f/32768.0f, 1.0f/32768.0f, 1.0f/32768.0f, 1.0f/32768.0f }; +#endif -+// -- GODOT end -- + a = VMUL(a, g_scale); b = VMUL(b, g_scale); #if HAVE_SSE -@@ -1813,7 +1824,19 @@ void mp3dec_f32_to_s16(const float *in, int16_t *out, int num_samples) +@@ -1813,7 +1822,17 @@ void mp3dec_f32_to_s16(const float *in, int16_t *out, int num_samples) int aligned_count = num_samples & ~7; for(; i < aligned_count; i += 8) { + -+// -- GODOT start -- +#if defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC) || defined(_M_ARM)) -+ static f4 g_scale; -+ g_scale = vsetq_lane_f32(32768.0f, g_scale, 0); -+ g_scale = vsetq_lane_f32(32768.0f, g_scale, 1); -+ g_scale = vsetq_lane_f32(32768.0f, g_scale, 2); -+ g_scale = vsetq_lane_f32(32768.0f, g_scale, 3); ++ static f4 g_scale; ++ g_scale = vsetq_lane_f32(32768.0f, g_scale, 0); ++ g_scale = vsetq_lane_f32(32768.0f, g_scale, 1); ++ g_scale = vsetq_lane_f32(32768.0f, g_scale, 2); ++ g_scale = vsetq_lane_f32(32768.0f, g_scale, 3); +#else static const f4 g_scale = { 32768.0f, 32768.0f, 32768.0f, 32768.0f }; +#endif -+// -- GODOT end -- + f4 a = VMUL(VLD(&in[i ]), g_scale); f4 b = VMUL(VLD(&in[i+4]), g_scale); diff --git a/thirdparty/minimp3/patches/msvc-warnings-fixes.patch b/thirdparty/minimp3/patches/0002-msvc-warnings.patch similarity index 100% rename from thirdparty/minimp3/patches/msvc-warnings-fixes.patch rename to thirdparty/minimp3/patches/0002-msvc-warnings.patch diff --git a/thirdparty/minizip/ioapi.c b/thirdparty/minizip/ioapi.c index 2e89f5f41af..2e393aca2dd 100644 --- a/thirdparty/minizip/ioapi.c +++ b/thirdparty/minizip/ioapi.c @@ -75,16 +75,12 @@ void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filef p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; - /* GODOT start */ p_filefunc64_32->zfile_func64.alloc_mem = p_filefunc32->alloc_mem; p_filefunc64_32->zfile_func64.free_mem = p_filefunc32->free_mem; - /* GODOT end */ } -/* GODOT start */ -/* -// GODOT end +#if 0 static voidpf ZCALLBACK fopen_file_func(voidpf opaque, const char* filename, int mode) { FILE* file = NULL; @@ -236,6 +232,5 @@ void fill_fopen64_filefunc(zlib_filefunc64_def* pzlib_filefunc_def) { pzlib_filefunc_def->zerror_file = ferror_file_func; pzlib_filefunc_def->opaque = NULL; } -// GODOT start -*/ -/* GODOT end */ + +#endif diff --git a/thirdparty/minizip/ioapi.h b/thirdparty/minizip/ioapi.h index 509b52da8af..556dd8ad181 100644 --- a/thirdparty/minizip/ioapi.h +++ b/thirdparty/minizip/ioapi.h @@ -155,10 +155,8 @@ typedef struct zlib_filefunc_def_s close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; - /* GODOT start */ alloc_func alloc_mem; free_func free_mem; - /* GODOT end */ } zlib_filefunc_def; typedef ZPOS64_T (ZCALLBACK *tell64_file_func) (voidpf opaque, voidpf stream); @@ -175,10 +173,8 @@ typedef struct zlib_filefunc64_def_s close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; - /* GODOT start */ alloc_func alloc_mem; free_func free_mem; - /* GODOT end */ } zlib_filefunc64_def; void fill_fopen64_filefunc(zlib_filefunc64_def* pzlib_filefunc_def); diff --git a/thirdparty/minizip/patches/godot-seek.patch b/thirdparty/minizip/patches/0001-godot-seek.patch similarity index 80% rename from thirdparty/minizip/patches/godot-seek.patch rename to thirdparty/minizip/patches/0001-godot-seek.patch index 649de2fe2fb..ed6161eef27 100644 --- a/thirdparty/minizip/patches/godot-seek.patch +++ b/thirdparty/minizip/patches/0001-godot-seek.patch @@ -1,108 +1,97 @@ diff --git a/thirdparty/minizip/ioapi.c b/thirdparty/minizip/ioapi.c -index 782d32469a..2e89f5f41a 100644 +index 782d32469a..2e393aca2d 100644 --- a/thirdparty/minizip/ioapi.c +++ b/thirdparty/minizip/ioapi.c -@@ -75,8 +75,15 @@ void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filef +@@ -75,9 +75,12 @@ void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filef p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; -+ /* GODOT start */ + p_filefunc64_32->zfile_func64.alloc_mem = p_filefunc32->alloc_mem; + p_filefunc64_32->zfile_func64.free_mem = p_filefunc32->free_mem; -+ /* GODOT end */ } -+/* GODOT start */ -+/* -+// GODOT end ++#if 0 static voidpf ZCALLBACK fopen_file_func(voidpf opaque, const char* filename, int mode) { -@@ -229,3 +236,6 @@ void fill_fopen64_filefunc(zlib_filefunc64_def* pzlib_filefunc_def) { + FILE* file = NULL; +@@ -229,3 +232,5 @@ void fill_fopen64_filefunc(zlib_filefunc64_def* pzlib_filefunc_def) { pzlib_filefunc_def->zerror_file = ferror_file_func; pzlib_filefunc_def->opaque = NULL; } -+// GODOT start -+*/ -+/* GODOT end */ ++ ++#endif diff --git a/thirdparty/minizip/ioapi.h b/thirdparty/minizip/ioapi.h -index a2d2e6e60d..509b52da8a 100644 +index a2d2e6e60d..556dd8ad18 100644 --- a/thirdparty/minizip/ioapi.h +++ b/thirdparty/minizip/ioapi.h -@@ -155,6 +155,10 @@ typedef struct zlib_filefunc_def_s +@@ -155,6 +155,8 @@ typedef struct zlib_filefunc_def_s close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; -+ /* GODOT start */ + alloc_func alloc_mem; + free_func free_mem; -+ /* GODOT end */ } zlib_filefunc_def; typedef ZPOS64_T (ZCALLBACK *tell64_file_func) (voidpf opaque, voidpf stream); -@@ -171,6 +175,10 @@ typedef struct zlib_filefunc64_def_s +@@ -171,6 +173,8 @@ typedef struct zlib_filefunc64_def_s close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; -+ /* GODOT start */ + alloc_func alloc_mem; + free_func free_mem; -+ /* GODOT end */ } zlib_filefunc64_def; void fill_fopen64_filefunc(zlib_filefunc64_def* pzlib_filefunc_def); diff --git a/thirdparty/minizip/unzip.c b/thirdparty/minizip/unzip.c -index ea05b7d62a..981ba3c0cb 100644 +index ea05b7d62a..7e8a6ac2d3 100644 --- a/thirdparty/minizip/unzip.c +++ b/thirdparty/minizip/unzip.c -@@ -152,6 +152,9 @@ typedef struct +@@ -152,6 +152,7 @@ typedef struct uLong compression_method; /* compression method (0==store) */ ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ int raw; -+ /* GODOT start */ + int extra_size; -+ /* GODOT end */ } file_in_zip64_read_info_s; -@@ -513,9 +516,10 @@ local unzFile unzOpenInternal(const void *path, +@@ -513,9 +514,9 @@ local unzFile unzOpenInternal(const void *path, us.z_filefunc.zseek32_file = NULL; us.z_filefunc.ztell32_file = NULL; if (pzlib_filefunc64_32_def==NULL) - fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); - else - us.z_filefunc = *pzlib_filefunc64_32_def; -+ /* GODOT start */ ++ //fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); + return NULL; // standard i/o not supported + us.z_filefunc = *pzlib_filefunc64_32_def; -+ /* GODOT end */ us.is64bitOpenFunction = is64bitOpenFunction; -@@ -703,6 +707,18 @@ extern unzFile ZEXPORT unzOpen64(const void *path) { +@@ -703,6 +704,15 @@ extern unzFile ZEXPORT unzOpen64(const void *path) { return unzOpenInternal(path, NULL, 1); } -+/* GODOT start */ +extern void* unzGetOpaque(unzFile file) { -+ + unz64_s* s; + if (file==NULL) + return NULL; + s=(unz64_s*)file; + + return s->z_filefunc.zfile_func64.opaque; -+}; -+/* GODOT end */ ++} + /* Close a ZipFile opened with unzOpen. If there is files inside the .Zip opened with unzOpenCurrentFile (see later), -@@ -905,10 +921,23 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file, +@@ -905,10 +915,19 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file, if (lSeek!=0) { -+ /* GODOT start */ +- if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) +- lSeek=0; +- else +- err=UNZ_ERRNO; + if (lSeek<0) { + // WORKAROUND for backwards seeking + ZPOS64_T pos = ZTELL64(s->z_filefunc, s->filestream); @@ -111,47 +100,38 @@ index ea05b7d62a..981ba3c0cb 100644 + else + err=UNZ_ERRNO; + } else { -+ /* GODOT end */ - if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; -+ /* GODOT start */ ++ if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) ++ lSeek=0; ++ else ++ err=UNZ_ERRNO; + } -+ /* GODOT end */ } while(acc < file_info.size_file_extra) -@@ -1446,8 +1475,10 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, +@@ -1446,8 +1465,8 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, } else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw)) { - pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; - pfile_in_zip_read_info->stream.zfree = (free_func)0; -+ /* GODOT start */ + pfile_in_zip_read_info->stream.zalloc = s->z_filefunc.zfile_func64.alloc_mem; + pfile_in_zip_read_info->stream.zfree = s->z_filefunc.zfile_func64.free_mem; -+ /* GODOT end */ pfile_in_zip_read_info->stream.opaque = (voidpf)0; pfile_in_zip_read_info->stream.next_in = 0; pfile_in_zip_read_info->stream.avail_in = 0; -@@ -1480,6 +1511,9 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, +@@ -1480,6 +1499,7 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, iSizeVar; pfile_in_zip_read_info->stream.avail_in = (uInt)0; -+ /* GODOT start */ + pfile_in_zip_read_info->extra_size = iSizeVar; -+ /* GODOT end */ s->pfile_in_zip_read = pfile_in_zip_read_info; s->encrypted = 0; -@@ -1510,6 +1544,85 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, +@@ -1510,6 +1530,82 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, return UNZ_OK; } -+/* GODOT start */ +extern int ZEXPORT unzSeekCurrentFile(unzFile file, int pos) { -+ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) @@ -226,69 +206,60 @@ index ea05b7d62a..981ba3c0cb 100644 + + return pos; +} -+/* GODOT end */ + extern int ZEXPORT unzOpenCurrentFile(unzFile file) { return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); } diff --git a/thirdparty/minizip/unzip.h b/thirdparty/minizip/unzip.h -index 5cfc9c6274..0639674574 100644 +index 5cfc9c6274..37ff29b22a 100644 --- a/thirdparty/minizip/unzip.h +++ b/thirdparty/minizip/unzip.h -@@ -202,6 +202,10 @@ extern int ZEXPORT unzClose(unzFile file); +@@ -202,6 +202,8 @@ extern int ZEXPORT unzClose(unzFile file); these files MUST be closed with unzCloseCurrentFile before call unzClose. return UNZ_OK if there is no problem. */ -+/* GODOT start */ +extern void* unzGetOpaque(unzFile file); -+/* GODOT end */ + extern int ZEXPORT unzGetGlobalInfo(unzFile file, unz_global_info *pglobal_info); -@@ -390,6 +394,13 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, +@@ -390,6 +392,11 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, (UNZ_ERRNO for IO error, or zLib error for uncompress error) */ -+/* GODOT start */ +extern int ZEXPORT unzSeekCurrentFile(unzFile file, int pos); +/* + Seek to position in uncompressed data +*/ -+/* GODOT end */ + extern z_off_t ZEXPORT unztell(unzFile file); extern ZPOS64_T ZEXPORT unztell64(unzFile file); diff --git a/thirdparty/minizip/zip.c b/thirdparty/minizip/zip.c -index 60bdffac34..1d2d918e72 100644 +index 60bdffac34..078a0a82ec 100644 --- a/thirdparty/minizip/zip.c +++ b/thirdparty/minizip/zip.c -@@ -820,9 +820,11 @@ extern zipFile ZEXPORT zipOpen3(const void *pathname, int append, zipcharpc* glo +@@ -820,9 +820,9 @@ extern zipFile ZEXPORT zipOpen3(const void *pathname, int append, zipcharpc* glo ziinit.z_filefunc.zseek32_file = NULL; ziinit.z_filefunc.ztell32_file = NULL; - if (pzlib_filefunc64_32_def==NULL) - fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64); - else -+ /* GODOT start */ + if (pzlib_filefunc64_32_def==NULL) { + //fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64); + } else -+ /* GODOT end */ ziinit.z_filefunc = *pzlib_filefunc64_32_def; ziinit.filestream = ZOPEN64(ziinit.z_filefunc, -@@ -1182,8 +1184,10 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c +@@ -1182,8 +1182,8 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c { if(zi->ci.method == Z_DEFLATED) { - zi->ci.stream.zalloc = (alloc_func)0; - zi->ci.stream.zfree = (free_func)0; -+ /* GODOT start */ + zi->ci.stream.zalloc = zi->z_filefunc.zfile_func64.alloc_mem; + zi->ci.stream.zfree = zi->z_filefunc.zfile_func64.free_mem; -+ /* GODOT end */ zi->ci.stream.opaque = (voidpf)0; if (windowBits>0) diff --git a/thirdparty/minizip/unzip.c b/thirdparty/minizip/unzip.c index 981ba3c0cb7..7e8a6ac2d38 100644 --- a/thirdparty/minizip/unzip.c +++ b/thirdparty/minizip/unzip.c @@ -152,9 +152,7 @@ typedef struct uLong compression_method; /* compression method (0==store) */ ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ int raw; - /* GODOT start */ int extra_size; - /* GODOT end */ } file_in_zip64_read_info_s; @@ -516,10 +514,9 @@ local unzFile unzOpenInternal(const void *path, us.z_filefunc.zseek32_file = NULL; us.z_filefunc.ztell32_file = NULL; if (pzlib_filefunc64_32_def==NULL) - /* GODOT start */ + //fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); return NULL; // standard i/o not supported us.z_filefunc = *pzlib_filefunc64_32_def; - /* GODOT end */ us.is64bitOpenFunction = is64bitOpenFunction; @@ -707,17 +704,14 @@ extern unzFile ZEXPORT unzOpen64(const void *path) { return unzOpenInternal(path, NULL, 1); } -/* GODOT start */ extern void* unzGetOpaque(unzFile file) { - unz64_s* s; if (file==NULL) return NULL; s=(unz64_s*)file; return s->z_filefunc.zfile_func64.opaque; -}; -/* GODOT end */ +} /* Close a ZipFile opened with unzOpen. @@ -921,7 +915,6 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file, if (lSeek!=0) { - /* GODOT start */ if (lSeek<0) { // WORKAROUND for backwards seeking ZPOS64_T pos = ZTELL64(s->z_filefunc, s->filestream); @@ -930,14 +923,11 @@ local int unz64local_GetCurrentFileInfoInternal(unzFile file, else err=UNZ_ERRNO; } else { - /* GODOT end */ - if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) - lSeek=0; - else - err=UNZ_ERRNO; - /* GODOT start */ + if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; } - /* GODOT end */ } while(acc < file_info.size_file_extra) @@ -1475,10 +1465,8 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, } else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw)) { - /* GODOT start */ pfile_in_zip_read_info->stream.zalloc = s->z_filefunc.zfile_func64.alloc_mem; pfile_in_zip_read_info->stream.zfree = s->z_filefunc.zfile_func64.free_mem; - /* GODOT end */ pfile_in_zip_read_info->stream.opaque = (voidpf)0; pfile_in_zip_read_info->stream.next_in = 0; pfile_in_zip_read_info->stream.avail_in = 0; @@ -1511,9 +1499,7 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, iSizeVar; pfile_in_zip_read_info->stream.avail_in = (uInt)0; - /* GODOT start */ pfile_in_zip_read_info->extra_size = iSizeVar; - /* GODOT end */ s->pfile_in_zip_read = pfile_in_zip_read_info; s->encrypted = 0; @@ -1544,9 +1530,7 @@ extern int ZEXPORT unzOpenCurrentFile3(unzFile file, int* method, return UNZ_OK; } -/* GODOT start */ extern int ZEXPORT unzSeekCurrentFile(unzFile file, int pos) { - unz64_s* s; file_in_zip64_read_info_s* pfile_in_zip_read_info; if (file==NULL) @@ -1621,7 +1605,6 @@ extern int ZEXPORT unzSeekCurrentFile(unzFile file, int pos) { return pos; } -/* GODOT end */ extern int ZEXPORT unzOpenCurrentFile(unzFile file) { return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); diff --git a/thirdparty/minizip/unzip.h b/thirdparty/minizip/unzip.h index 06396745744..37ff29b22a9 100644 --- a/thirdparty/minizip/unzip.h +++ b/thirdparty/minizip/unzip.h @@ -202,9 +202,7 @@ extern int ZEXPORT unzClose(unzFile file); these files MUST be closed with unzCloseCurrentFile before call unzClose. return UNZ_OK if there is no problem. */ -/* GODOT start */ extern void* unzGetOpaque(unzFile file); -/* GODOT end */ extern int ZEXPORT unzGetGlobalInfo(unzFile file, unz_global_info *pglobal_info); @@ -394,12 +392,10 @@ extern int ZEXPORT unzReadCurrentFile(unzFile file, (UNZ_ERRNO for IO error, or zLib error for uncompress error) */ -/* GODOT start */ extern int ZEXPORT unzSeekCurrentFile(unzFile file, int pos); /* Seek to position in uncompressed data */ -/* GODOT end */ extern z_off_t ZEXPORT unztell(unzFile file); diff --git a/thirdparty/minizip/zip.c b/thirdparty/minizip/zip.c index 1d2d918e72a..078a0a82ec0 100644 --- a/thirdparty/minizip/zip.c +++ b/thirdparty/minizip/zip.c @@ -820,11 +820,9 @@ extern zipFile ZEXPORT zipOpen3(const void *pathname, int append, zipcharpc* glo ziinit.z_filefunc.zseek32_file = NULL; ziinit.z_filefunc.ztell32_file = NULL; - /* GODOT start */ if (pzlib_filefunc64_32_def==NULL) { //fill_fopen64_filefunc(&ziinit.z_filefunc.zfile_func64); } else - /* GODOT end */ ziinit.z_filefunc = *pzlib_filefunc64_32_def; ziinit.filestream = ZOPEN64(ziinit.z_filefunc, @@ -1184,10 +1182,8 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c { if(zi->ci.method == Z_DEFLATED) { - /* GODOT start */ zi->ci.stream.zalloc = zi->z_filefunc.zfile_func64.alloc_mem; zi->ci.stream.zfree = zi->z_filefunc.zfile_func64.free_mem; - /* GODOT end */ zi->ci.stream.opaque = (voidpf)0; if (windowBits>0) diff --git a/thirdparty/noise/FastNoiseLite.h b/thirdparty/misc/FastNoiseLite.h similarity index 100% rename from thirdparty/noise/FastNoiseLite.h rename to thirdparty/misc/FastNoiseLite.h diff --git a/thirdparty/misc/ifaddrs-android.h b/thirdparty/misc/ifaddrs-android.h index 8de94324b8d..04ff2ca58bd 100644 --- a/thirdparty/misc/ifaddrs-android.h +++ b/thirdparty/misc/ifaddrs-android.h @@ -24,19 +24,19 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + #ifndef TALK_BASE_IFADDRS_ANDROID_H_ #define TALK_BASE_IFADDRS_ANDROID_H_ + #include #include // Implementation of getifaddrs for Android. // Fills out a list of ifaddr structs (see below) which contain information // about every network interface available on the host. // See 'man getifaddrs' on Linux or OS X (nb: it is not a POSIX function). -// -- GODOT start -- #ifdef __cplusplus extern "C" { #endif -// -- GODOT end -- struct ifaddrs { struct ifaddrs* ifa_next; char* ifa_name; @@ -45,7 +45,6 @@ struct ifaddrs { struct sockaddr* ifa_netmask; // Real ifaddrs has broadcast, point to point and data members. // We don't need them (yet?). - // -- GODOT start -- // We never initialize the following members. We only define them to match the ifaddrs struct. union { @@ -53,13 +52,12 @@ struct ifaddrs { struct sockaddr *ifu_dstaddr; } ifa_ifu; void *ifa_data; - // -- GODOT end -- }; -// -- GODOT start -- #ifdef __cplusplus } #endif -// -- GODOT end -- + int getifaddrs(struct ifaddrs** result); void freeifaddrs(struct ifaddrs* addrs); + #endif // TALK_BASE_IFADDRS_ANDROID_H_ diff --git a/thirdparty/nvapi/nvapi_minimal.h b/thirdparty/misc/nvapi_minimal.h similarity index 100% rename from thirdparty/nvapi/nvapi_minimal.h rename to thirdparty/misc/nvapi_minimal.h diff --git a/thirdparty/noise/patches/namespace-warnings.patch b/thirdparty/misc/patches/FastNoiseLite-0001-namespace-warnings.patch similarity index 88% rename from thirdparty/noise/patches/namespace-warnings.patch rename to thirdparty/misc/patches/FastNoiseLite-0001-namespace-warnings.patch index 6348ae1f058..6635900973b 100644 --- a/thirdparty/noise/patches/namespace-warnings.patch +++ b/thirdparty/misc/patches/FastNoiseLite-0001-namespace-warnings.patch @@ -1,7 +1,7 @@ -diff --git a/thirdparty/noise/FastNoiseLite.h b/thirdparty/noise/FastNoiseLite.h +diff --git a/thirdparty/misc/FastNoiseLite.h b/thirdparty/misc/FastNoiseLite.h index ed97b0fcac..fb6dbcb92a 100644 ---- a/thirdparty/noise/FastNoiseLite.h -+++ b/thirdparty/noise/FastNoiseLite.h +--- a/thirdparty/misc/FastNoiseLite.h ++++ b/thirdparty/misc/FastNoiseLite.h @@ -52,6 +52,8 @@ #include diff --git a/thirdparty/misc/patches/ifaddrs-android-0001-complete-struct.patch b/thirdparty/misc/patches/ifaddrs-android-0001-complete-struct.patch new file mode 100644 index 00000000000..e2894ba2a8c --- /dev/null +++ b/thirdparty/misc/patches/ifaddrs-android-0001-complete-struct.patch @@ -0,0 +1,32 @@ +diff --git a/thirdparty/misc/ifaddrs-android.h b/thirdparty/misc/ifaddrs-android.h +index e7d81e813f..04ff2ca58b 100644 +--- a/thirdparty/misc/ifaddrs-android.h ++++ b/thirdparty/misc/ifaddrs-android.h +@@ -34,6 +34,9 @@ + // Fills out a list of ifaddr structs (see below) which contain information + // about every network interface available on the host. + // See 'man getifaddrs' on Linux or OS X (nb: it is not a POSIX function). ++#ifdef __cplusplus ++extern "C" { ++#endif + struct ifaddrs { + struct ifaddrs* ifa_next; + char* ifa_name; +@@ -42,7 +45,17 @@ struct ifaddrs { + struct sockaddr* ifa_netmask; + // Real ifaddrs has broadcast, point to point and data members. + // We don't need them (yet?). ++ // We never initialize the following members. We only define them to match the ifaddrs struct. ++ union ++ { ++ struct sockaddr *ifu_broadaddr; ++ struct sockaddr *ifu_dstaddr; ++ } ifa_ifu; ++ void *ifa_data; + }; ++#ifdef __cplusplus ++} ++#endif + + int getifaddrs(struct ifaddrs** result); + void freeifaddrs(struct ifaddrs* addrs); diff --git a/thirdparty/misc/patches/polypartition-godot-types.patch b/thirdparty/misc/patches/polypartition-0001-godot-types.patch similarity index 98% rename from thirdparty/misc/patches/polypartition-godot-types.patch rename to thirdparty/misc/patches/polypartition-0001-godot-types.patch index 5d8aba34371..f0a2ccef1a1 100644 --- a/thirdparty/misc/patches/polypartition-godot-types.patch +++ b/thirdparty/misc/patches/polypartition-0001-godot-types.patch @@ -1,5 +1,5 @@ diff --git a/thirdparty/misc/polypartition.cpp b/thirdparty/misc/polypartition.cpp -index 3a8a6efa83..8c5409bf24 100644 +index 3a8a6efa83..a725125ed0 100644 --- a/thirdparty/misc/polypartition.cpp +++ b/thirdparty/misc/polypartition.cpp @@ -26,7 +26,6 @@ @@ -528,15 +528,15 @@ index 3a8a6efa83..8c5409bf24 100644 // a tree, complexity requirements for operations are the same as // for the balanced binary search tree. - std::set edgeTree; -+ Set edgeTree; ++ RBSet edgeTree; // Store iterators to the edge tree elements. // This makes deleting existing edges much faster. - std::set::iterator *edgeTreeIterators, edgeIter; - edgeTreeIterators = new std::set::iterator[maxnumvertices]; - std::pair::iterator, bool> edgeTreeRet; -+ Set::Element **edgeTreeIterators, *edgeIter; -+ edgeTreeIterators = new Set::Element *[maxnumvertices]; -+ //Pair::iterator, bool> edgeTreeRet; ++ RBSet::Element **edgeTreeIterators, *edgeIter; ++ edgeTreeIterators = new RBSet::Element *[maxnumvertices]; ++ //Pair::iterator, bool> edgeTreeRet; for (i = 0; i < numvertices; i++) { - edgeTreeIterators[i] = edgeTree.end(); + edgeTreeIterators[i] = nullptr; @@ -671,8 +671,8 @@ index 3a8a6efa83..8c5409bf24 100644 void TPPLPartition::AddDiagonal(MonotoneVertex *vertices, long *numvertices, long index1, long index2, - TPPLVertexType *vertextypes, std::set::iterator *edgeTreeIterators, - std::set *edgeTree, long *helpers) { -+ TPPLVertexType *vertextypes, Set::Element **edgeTreeIterators, -+ Set *edgeTree, long *helpers) { ++ TPPLVertexType *vertextypes, RBSet::Element **edgeTreeIterators, ++ RBSet *edgeTree, long *helpers) { long newindex1, newindex2; newindex1 = *numvertices; @@ -713,7 +713,7 @@ index 3a8a6efa83..8c5409bf24 100644 } } diff --git a/thirdparty/misc/polypartition.h b/thirdparty/misc/polypartition.h -index f163f5d217..b2d905a3ef 100644 +index e1df6cef9e..c084bdf74c 100644 --- a/thirdparty/misc/polypartition.h +++ b/thirdparty/misc/polypartition.h @@ -24,8 +24,9 @@ @@ -724,7 +724,7 @@ index f163f5d217..b2d905a3ef 100644 -#include +#include "core/math/vector2.h" +#include "core/templates/list.h" -+#include "core/templates/set.h" ++#include "core/templates/rb_set.h" typedef double tppl_float; @@ -809,8 +809,8 @@ index f163f5d217..b2d905a3ef 100644 void AddDiagonal(MonotoneVertex *vertices, long *numvertices, long index1, long index2, - TPPLVertexType *vertextypes, std::set::iterator *edgeTreeIterators, - std::set *edgeTree, long *helpers); -+ TPPLVertexType *vertextypes, Set::Element **edgeTreeIterators, -+ Set *edgeTree, long *helpers); ++ TPPLVertexType *vertextypes, RBSet::Element **edgeTreeIterators, ++ RBSet *edgeTree, long *helpers); // Triangulates a monotone polygon, used in Triangulate_MONO. int TriangulateMonotone(TPPLPoly *inPoly, TPPLPolyList *triangles); diff --git a/thirdparty/misc/patches/polypartition-hole.patch b/thirdparty/misc/patches/polypartition-0002-shadow-warning.patch similarity index 100% rename from thirdparty/misc/patches/polypartition-hole.patch rename to thirdparty/misc/patches/polypartition-0002-shadow-warning.patch diff --git a/thirdparty/misc/patches/smaz-0001-write-string-warning.patch b/thirdparty/misc/patches/smaz-0001-write-string-warning.patch new file mode 100644 index 00000000000..c76d0590235 --- /dev/null +++ b/thirdparty/misc/patches/smaz-0001-write-string-warning.patch @@ -0,0 +1,54 @@ +diff --git a/thirdparty/misc/smaz.c b/thirdparty/misc/smaz.c +index aa674c3858..6f9ea20e67 100644 +--- a/thirdparty/misc/smaz.c ++++ b/thirdparty/misc/smaz.c +@@ -1,7 +1,7 @@ + #include + + /* Our compression codebook, used for compression */ +-static char *Smaz_cb[241] = { ++static const char *Smaz_cb[241] = { + "\002s,\266", "\003had\232\002leW", "\003on \216", "", "\001yS", + "\002ma\255\002li\227", "\003or \260", "", "\002ll\230\003s t\277", + "\004fromg\002mel", "", "\003its\332", "\001z\333", "\003ingF", "\001>\336", +@@ -76,7 +76,7 @@ static char *Smaz_rcb[254] = { + "e, ", " it", "whi", " ma", "ge", "x", "e c", "men", ".com" + }; + +-int smaz_compress(char *in, int inlen, char *out, int outlen) { ++int smaz_compress(const char *in, int inlen, char *out, int outlen) { + unsigned int h1,h2,h3=0; + int verblen = 0, _outlen = outlen; + char verb[256], *_out = out; +@@ -154,7 +154,7 @@ out: + return out-_out; + } + +-int smaz_decompress(char *in, int inlen, char *out, int outlen) { ++int smaz_decompress(const char *in, int inlen, char *out, int outlen) { + unsigned char *c = (unsigned char*) in; + char *_out = out; + int _outlen = outlen; +@@ -179,7 +179,7 @@ int smaz_decompress(char *in, int inlen, char *out, int outlen) { + inlen -= 2+len; + } else { + /* Codebook entry */ +- char *s = Smaz_rcb[*c]; ++ const char *s = Smaz_rcb[*c]; + int len = strlen(s); + + if (outlen < len) return _outlen+1; +diff --git a/thirdparty/misc/smaz.h b/thirdparty/misc/smaz.h +index ce9c35d6b2..d8e1f8a6a5 100644 +--- a/thirdparty/misc/smaz.h ++++ b/thirdparty/misc/smaz.h +@@ -1,7 +1,7 @@ + #ifndef _SMAZ_H + #define _SMAZ_H + +-int smaz_compress(char *in, int inlen, char *out, int outlen); +-int smaz_decompress(char *in, int inlen, char *out, int outlen); ++int smaz_compress(const char *in, int inlen, char *out, int outlen); ++int smaz_decompress(const char *in, int inlen, char *out, int outlen); + + #endif diff --git a/thirdparty/noise/LICENSE b/thirdparty/noise/LICENSE deleted file mode 100644 index dd6df2c160a..00000000000 --- a/thirdparty/noise/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright(c) 2020 Jordan Peck (jordan.me2@gmail.com) -Copyright(c) 2020 Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/thirdparty/openxr/patches/use-egl-from-glad.diff b/thirdparty/openxr/patches/0001-glad-egl.patch similarity index 68% rename from thirdparty/openxr/patches/use-egl-from-glad.diff rename to thirdparty/openxr/patches/0001-glad-egl.patch index 29c746d5c7a..9ab6c2efdf5 100644 --- a/thirdparty/openxr/patches/use-egl-from-glad.diff +++ b/thirdparty/openxr/patches/0001-glad-egl.patch @@ -1,6 +1,7 @@ -diff -Nur openxr-orig/src/common/xr_dependencies.h openxr/src/common/xr_dependencies.h ---- openxr-orig/src/common/xr_dependencies.h 2024-11-04 10:38:11.940682727 -0600 -+++ openxr/src/common/xr_dependencies.h 2024-11-04 10:38:46.351415476 -0600 +diff --git a/thirdparty/openxr/src/common/xr_dependencies.h b/thirdparty/openxr/src/common/xr_dependencies.h +index 55d93bfbac..a192a2ec6d 100644 +--- a/thirdparty/openxr/src/common/xr_dependencies.h ++++ b/thirdparty/openxr/src/common/xr_dependencies.h @@ -65,7 +65,11 @@ #endif // XR_USE_GRAPHICS_API_OPENGL diff --git a/thirdparty/spirv-reflect/patches/1-specialization-constants.patch b/thirdparty/spirv-reflect/patches/0001-specialization-constants.patch similarity index 88% rename from thirdparty/spirv-reflect/patches/1-specialization-constants.patch rename to thirdparty/spirv-reflect/patches/0001-specialization-constants.patch index ff11841451c..e8003e8d5c4 100644 --- a/thirdparty/spirv-reflect/patches/1-specialization-constants.patch +++ b/thirdparty/spirv-reflect/patches/0001-specialization-constants.patch @@ -1,19 +1,17 @@ diff --git a/thirdparty/spirv-reflect/spirv_reflect.c b/thirdparty/spirv-reflect/spirv_reflect.c -index b4f6bc17c2..c96dd85439 100644 +index b4f6bc17c2..ba64a3f54d 100644 --- a/thirdparty/spirv-reflect/spirv_reflect.c +++ b/thirdparty/spirv-reflect/spirv_reflect.c -@@ -1571,6 +1571,10 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle +@@ -1571,6 +1571,8 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle } break; case SpvDecorationSpecId: { -+// -- GODOT begin -- + uint32_t word_offset = p_node->word_offset + member_offset+ 3; + CHECKED_READU32(p_parser, word_offset, p_target_decorations->spec_id); -+// -- GODOT end -- spec_constant_count++; } break; -@@ -1692,21 +1696,45 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle +@@ -1692,21 +1694,43 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle } for (uint32_t i = 0; i < p_parser->node_count; ++i) { SpvReflectPrvNode* p_node = &(p_parser->nodes[i]); @@ -28,7 +26,6 @@ index b4f6bc17c2..c96dd85439 100644 - SpvReflectPrvNode* target_node = FindNode(p_parser, p_module->spec_constants[count].spirv_id); - if (IsNotNull(target_node)) { - p_module->spec_constants[count].name = target_node->name; -+// -- GODOT begin -- + const uint32_t count = p_module->spec_constant_count; + switch(p_node->op) { + default: continue; @@ -68,19 +65,17 @@ index b4f6bc17c2..c96dd85439 100644 + p_module->spec_constants[count].spirv_id = p_node->result_id; + + p_module->spec_constant_count++; -+// -- GODOT end -- } return SPV_REFLECT_RESULT_SUCCESS; diff --git a/thirdparty/spirv-reflect/spirv_reflect.h b/thirdparty/spirv-reflect/spirv_reflect.h -index 9a42f14eed..4ea0319c5e 100644 +index 9a42f14eed..cf8cfe2183 100644 --- a/thirdparty/spirv-reflect/spirv_reflect.h +++ b/thirdparty/spirv-reflect/spirv_reflect.h -@@ -568,6 +568,17 @@ typedef struct SpvReflectCapability { +@@ -568,6 +568,15 @@ typedef struct SpvReflectCapability { } SpvReflectCapability; -+// -- GODOT begin -- +/*! @enum SpvReflectSpecializationConstantType + +*/ @@ -89,22 +84,19 @@ index 9a42f14eed..4ea0319c5e 100644 + SPV_REFLECT_SPECIALIZATION_CONSTANT_INT = 1, + SPV_REFLECT_SPECIALIZATION_CONSTANT_FLOAT = 2, +} SpvReflectSpecializationConstantType; -+// -- GODOT end -- + /*! @struct SpvReflectSpecId */ -@@ -575,6 +586,13 @@ typedef struct SpvReflectSpecializationConstant { +@@ -575,6 +584,11 @@ typedef struct SpvReflectSpecializationConstant { uint32_t spirv_id; uint32_t constant_id; const char* name; -+// -- GODOT begin -- + SpvReflectSpecializationConstantType constant_type; + union { + float float_value; + uint32_t int_bool_value; + } default_value; -+// -- GODOT end -- } SpvReflectSpecializationConstant; /*! @struct SpvReflectShaderModule diff --git a/thirdparty/spirv-reflect/patches/2-zero-size-for-sc-sized-arrays.patch b/thirdparty/spirv-reflect/patches/0002-zero-size-for-sc-sized-arrays.patch similarity index 86% rename from thirdparty/spirv-reflect/patches/2-zero-size-for-sc-sized-arrays.patch rename to thirdparty/spirv-reflect/patches/0002-zero-size-for-sc-sized-arrays.patch index dbf6069d075..b12642cd56c 100644 --- a/thirdparty/spirv-reflect/patches/2-zero-size-for-sc-sized-arrays.patch +++ b/thirdparty/spirv-reflect/patches/0002-zero-size-for-sc-sized-arrays.patch @@ -1,18 +1,16 @@ diff --git a/thirdparty/spirv-reflect/spirv_reflect.c b/thirdparty/spirv-reflect/spirv_reflect.c -index c96dd85439..2ca9c8580d 100644 +index ba64a3f54d..599667be26 100644 --- a/thirdparty/spirv-reflect/spirv_reflect.c +++ b/thirdparty/spirv-reflect/spirv_reflect.c -@@ -2692,6 +2692,13 @@ static SpvReflectResult ParseDescriptorBlockVariableSizes(SpvReflectPrvParser* p +@@ -2688,6 +2688,11 @@ static SpvReflectResult ParseDescriptorBlockVariableSizes(SpvReflectPrvParser* p // ...then array uint32_t element_count = (p_member_var->array.dims_count > 0 ? 1 : 0); for (uint32_t i = 0; i < p_member_var->array.dims_count; ++i) { -+// -- GODOT begin -- + if (p_member_var->array.spec_constant_op_ids[i] != (uint32_t)INVALID_VALUE) { + // Force size to be reported as 0 to effectively disable buffer size validation, since + // the value is unreliable anyway as only valid for the default values of the SCs involved. + element_count = 0; + } -+// -- GODOT end -- element_count *= p_member_var->array.dims[i]; } p_member_var->size = element_count * p_member_var->array.stride; diff --git a/thirdparty/spirv-reflect/spirv_reflect.c b/thirdparty/spirv-reflect/spirv_reflect.c index d6c926b40a1..599667be265 100644 --- a/thirdparty/spirv-reflect/spirv_reflect.c +++ b/thirdparty/spirv-reflect/spirv_reflect.c @@ -1571,10 +1571,8 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle } break; case SpvDecorationSpecId: { -// -- GODOT begin -- uint32_t word_offset = p_node->word_offset + member_offset+ 3; CHECKED_READU32(p_parser, word_offset, p_target_decorations->spec_id); -// -- GODOT end -- spec_constant_count++; } break; @@ -1696,7 +1694,6 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle } for (uint32_t i = 0; i < p_parser->node_count; ++i) { SpvReflectPrvNode* p_node = &(p_parser->nodes[i]); -// -- GODOT begin -- const uint32_t count = p_module->spec_constant_count; switch(p_node->op) { default: continue; @@ -1734,7 +1731,6 @@ static SpvReflectResult ParseDecorations(SpvReflectPrvParser* p_parser, SpvRefle p_module->spec_constants[count].spirv_id = p_node->result_id; p_module->spec_constant_count++; -// -- GODOT end -- } return SPV_REFLECT_RESULT_SUCCESS; @@ -2692,13 +2688,11 @@ static SpvReflectResult ParseDescriptorBlockVariableSizes(SpvReflectPrvParser* p // ...then array uint32_t element_count = (p_member_var->array.dims_count > 0 ? 1 : 0); for (uint32_t i = 0; i < p_member_var->array.dims_count; ++i) { -// -- GODOT begin -- if (p_member_var->array.spec_constant_op_ids[i] != (uint32_t)INVALID_VALUE) { // Force size to be reported as 0 to effectively disable buffer size validation, since // the value is unreliable anyway as only valid for the default values of the SCs involved. element_count = 0; } -// -- GODOT end -- element_count *= p_member_var->array.dims[i]; } p_member_var->size = element_count * p_member_var->array.stride; diff --git a/thirdparty/spirv-reflect/spirv_reflect.h b/thirdparty/spirv-reflect/spirv_reflect.h index 4ea0319c5e0..cf8cfe2183c 100644 --- a/thirdparty/spirv-reflect/spirv_reflect.h +++ b/thirdparty/spirv-reflect/spirv_reflect.h @@ -568,7 +568,6 @@ typedef struct SpvReflectCapability { } SpvReflectCapability; -// -- GODOT begin -- /*! @enum SpvReflectSpecializationConstantType */ @@ -577,7 +576,6 @@ typedef enum SpvReflectSpecializationConstantType { SPV_REFLECT_SPECIALIZATION_CONSTANT_INT = 1, SPV_REFLECT_SPECIALIZATION_CONSTANT_FLOAT = 2, } SpvReflectSpecializationConstantType; -// -- GODOT end -- /*! @struct SpvReflectSpecId @@ -586,13 +584,11 @@ typedef struct SpvReflectSpecializationConstant { uint32_t spirv_id; uint32_t constant_id; const char* name; -// -- GODOT begin -- SpvReflectSpecializationConstantType constant_type; union { float float_value; uint32_t int_bool_value; } default_value; -// -- GODOT end -- } SpvReflectSpecializationConstant; /*! @struct SpvReflectShaderModule diff --git a/thirdparty/thorvg/patches/revert-tvgLines-bezier-precision-change.patch b/thirdparty/thorvg/patches/0001-revert-tvglines-bezier-precision.patch similarity index 100% rename from thirdparty/thorvg/patches/revert-tvgLines-bezier-precision-change.patch rename to thirdparty/thorvg/patches/0001-revert-tvglines-bezier-precision.patch diff --git a/thirdparty/thorvg/patches/fix-build-gcc15.patch b/thirdparty/thorvg/patches/0002-gcc15-include-fix.patch similarity index 100% rename from thirdparty/thorvg/patches/fix-build-gcc15.patch rename to thirdparty/thorvg/patches/0002-gcc15-include-fix.patch diff --git a/thirdparty/tinyexr/patches/0001-external-zlib.patch b/thirdparty/tinyexr/patches/0001-external-zlib.patch new file mode 100644 index 00000000000..90e02790a88 --- /dev/null +++ b/thirdparty/tinyexr/patches/0001-external-zlib.patch @@ -0,0 +1,12 @@ +diff --git a/thirdparty/tinyexr/tinyexr.cc b/thirdparty/tinyexr/tinyexr.cc +index fef8f66c98..7bdf827ed3 100644 +--- a/thirdparty/tinyexr/tinyexr.cc ++++ b/thirdparty/tinyexr/tinyexr.cc +@@ -4,5 +4,7 @@ + #endif + #endif + ++#include // Should come before including tinyexr. ++ + #define TINYEXR_IMPLEMENTATION + #include "tinyexr.h" diff --git a/thirdparty/tinyexr/tinyexr.cc b/thirdparty/tinyexr/tinyexr.cc index 70115ea5c29..7bdf827ed3f 100644 --- a/thirdparty/tinyexr/tinyexr.cc +++ b/thirdparty/tinyexr/tinyexr.cc @@ -4,9 +4,7 @@ #endif #endif -// -- GODOT start -- #include // Should come before including tinyexr. -// -- GODOT end -- #define TINYEXR_IMPLEMENTATION #include "tinyexr.h" diff --git a/thirdparty/vhacd/inc/btAlignedAllocator.h b/thirdparty/vhacd/inc/btAlignedAllocator.h index 94e71d51250..8011595d89b 100644 --- a/thirdparty/vhacd/inc/btAlignedAllocator.h +++ b/thirdparty/vhacd/inc/btAlignedAllocator.h @@ -22,9 +22,7 @@ subject to the following restrictions: #include "btScalar.h" -// -- GODOT start -- namespace VHACD { -// -- GODOT end -- //#define BT_DEBUG_MEMORY_ALLOCATIONS 1 #ifdef BT_DEBUG_MEMORY_ALLOCATIONS @@ -106,8 +104,6 @@ public: friend bool operator==(const self_type&, const self_type&) { return true; } }; -// -- GODOT start -- }; // namespace VHACD -// -- GODOT end -- #endif //BT_ALIGNED_ALLOCATOR diff --git a/thirdparty/vhacd/inc/btAlignedObjectArray.h b/thirdparty/vhacd/inc/btAlignedObjectArray.h index 1ce03d21bce..7446a8bfd92 100644 --- a/thirdparty/vhacd/inc/btAlignedObjectArray.h +++ b/thirdparty/vhacd/inc/btAlignedObjectArray.h @@ -38,9 +38,7 @@ subject to the following restrictions: #include //for placement new #endif //BT_USE_PLACEMENT_NEW -// -- GODOT start -- namespace VHACD { -// -- GODOT end -- ///The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods ///It is developed to replace stl::vector to avoid portability issues, including STL alignment issues to add SIMD/SSE data @@ -449,8 +447,6 @@ public: } }; -// -- GODOT start -- }; // namespace VHACD -// -- GODOT end -- #endif //BT_OBJECT_ARRAY__ diff --git a/thirdparty/vhacd/inc/btConvexHullComputer.h b/thirdparty/vhacd/inc/btConvexHullComputer.h index 04bb96f64aa..194917cdecc 100644 --- a/thirdparty/vhacd/inc/btConvexHullComputer.h +++ b/thirdparty/vhacd/inc/btConvexHullComputer.h @@ -18,9 +18,7 @@ subject to the following restrictions: #include "btAlignedObjectArray.h" #include "btVector3.h" -// -- GODOT start -- namespace VHACD { -// -- GODOT end -- /// Convex hull implementation based on Preparata and Hong /// See http://code.google.com/p/bullet/issues/detail?id=275 @@ -98,8 +96,6 @@ public: } }; -// -- GODOT start -- }; // namespace VHACD -// -- GODOT end -- #endif //BT_CONVEX_HULL_COMPUTER_H diff --git a/thirdparty/vhacd/inc/btMinMax.h b/thirdparty/vhacd/inc/btMinMax.h index 9bc1e1c7707..12aaeda9c4d 100644 --- a/thirdparty/vhacd/inc/btMinMax.h +++ b/thirdparty/vhacd/inc/btMinMax.h @@ -17,9 +17,7 @@ subject to the following restrictions: #include "btScalar.h" -// -- GODOT start -- namespace VHACD { -// -- GODOT end -- template SIMD_FORCE_INLINE const T& btMin(const T& a, const T& b) @@ -66,8 +64,6 @@ SIMD_FORCE_INLINE void btClamp(T& a, const T& lb, const T& ub) } } -// -- GODOT start -- }; // namespace VHACD -// -- GODOT end -- #endif //BT_GEN_MINMAX_H diff --git a/thirdparty/vhacd/inc/btScalar.h b/thirdparty/vhacd/inc/btScalar.h index da2a5993cab..ef8546a4b5a 100644 --- a/thirdparty/vhacd/inc/btScalar.h +++ b/thirdparty/vhacd/inc/btScalar.h @@ -28,18 +28,14 @@ subject to the following restrictions: /* SVN $Revision$ on $Date$ from http://bullet.googlecode.com*/ #define BT_BULLET_VERSION 279 -// -- GODOT start -- namespace VHACD { -// -- GODOT end -- inline int32_t btGetVersion() { return BT_BULLET_VERSION; } -// -- GODOT start -- }; // namespace VHACD -// -- GODOT end -- #if defined(DEBUG) || defined(_DEBUG) #define BT_DEBUG @@ -72,10 +68,8 @@ inline int32_t btGetVersion() #define btFsel(a, b, c) __fsel((a), (b), (c)) #else -// -- GODOT start -- //#if (defined(_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined(BT_USE_DOUBLE_PRECISION)) #if (defined(_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined(BT_USE_DOUBLE_PRECISION)) && (!defined(_M_ARM)) && (!defined(_M_ARM64)) -// -- GODOT end -- #define BT_USE_SSE #include #endif @@ -210,9 +204,7 @@ inline int32_t btGetVersion() #endif //__CELLOS_LV2__ #endif -// -- GODOT start -- namespace VHACD { -// -- GODOT end -- ///The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision. #if defined(BT_USE_DOUBLE_PRECISION) @@ -546,7 +538,6 @@ struct btTypedObject { } }; -// -- GODOT start -- // Cherry-picked from Bullet 2.88 to fix GH-27926 ///align a pointer to the provided alignment, upwards template @@ -567,10 +558,7 @@ T *btAlignPointer(T *unalignedPtr, size_t alignment) converter.integer &= bit_mask; return converter.ptr; } -// -- GODOT end -- -// -- GODOT start -- }; // namespace VHACD -// -- GODOT end -- #endif //BT_SCALAR_H diff --git a/thirdparty/vhacd/inc/btVector3.h b/thirdparty/vhacd/inc/btVector3.h index 4ed97167341..356a6a9cfce 100644 --- a/thirdparty/vhacd/inc/btVector3.h +++ b/thirdparty/vhacd/inc/btVector3.h @@ -26,9 +26,7 @@ subject to the following restrictions: #define btVector3DataName "btVector3FloatData" #endif //BT_USE_DOUBLE_PRECISION -// -- GODOT start -- namespace VHACD { -// -- GODOT end -- /**@brief btVector3 can be used to represent 3D points and vectors. * It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user @@ -716,8 +714,6 @@ SIMD_FORCE_INLINE void btVector3::deSerialize(const struct btVector3Data& dataIn m_floats[i] = dataIn.m_floats[i]; } -// -- GODOT start -- }; // namespace VHACD -// -- GODOT end -- #endif //BT_VECTOR3_H diff --git a/thirdparty/vhacd/inc/vhacdICHull.h b/thirdparty/vhacd/inc/vhacdICHull.h index 925584cf52d..4075a9e0547 100644 --- a/thirdparty/vhacd/inc/vhacdICHull.h +++ b/thirdparty/vhacd/inc/vhacdICHull.h @@ -18,9 +18,7 @@ #include "vhacdManifoldMesh.h" #include "vhacdVector.h" -// -- GODOT start -- #include -// -- GODOT end -- namespace VHACD { //! Incremental Convex Hull algorithm (cf. http://cs.smith.edu/~orourke/books/ftp.html ). diff --git a/thirdparty/vhacd/inc/vhacdManifoldMesh.h b/thirdparty/vhacd/inc/vhacdManifoldMesh.h index 5eed4e13aa3..3f9d0394709 100644 --- a/thirdparty/vhacd/inc/vhacdManifoldMesh.h +++ b/thirdparty/vhacd/inc/vhacdManifoldMesh.h @@ -19,9 +19,7 @@ All rights reserved. #include "vhacdSArray.h" #include "vhacdVector.h" -// -- GODOT start -- #include -// -- GODOT end -- namespace VHACD { class TMMTriangle; diff --git a/thirdparty/vhacd/inc/vhacdMutex.h b/thirdparty/vhacd/inc/vhacdMutex.h index d587dd6387c..22acc2135a8 100644 --- a/thirdparty/vhacd/inc/vhacdMutex.h +++ b/thirdparty/vhacd/inc/vhacdMutex.h @@ -71,9 +71,7 @@ #include #endif -// -- GODOT start -- #if defined(__APPLE__) || !defined(__GLIBC__) -// -- GODOT end -- #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE #endif diff --git a/thirdparty/vhacd/0001-bullet-namespace.patch b/thirdparty/vhacd/patches/0001-bullet-namespace.patch similarity index 69% rename from thirdparty/vhacd/0001-bullet-namespace.patch rename to thirdparty/vhacd/patches/0001-bullet-namespace.patch index cfb1ffeff07..095451bcdaf 100644 --- a/thirdparty/vhacd/0001-bullet-namespace.patch +++ b/thirdparty/vhacd/patches/0001-bullet-namespace.patch @@ -1,213 +1,177 @@ diff --git a/thirdparty/vhacd/inc/btAlignedAllocator.h b/thirdparty/vhacd/inc/btAlignedAllocator.h -index 11f6e12dc..94e71d512 100644 +index 11f6e12dca..8011595d89 100644 --- a/thirdparty/vhacd/inc/btAlignedAllocator.h +++ b/thirdparty/vhacd/inc/btAlignedAllocator.h -@@ -21,6 +21,11 @@ subject to the following restrictions: +@@ -21,6 +21,9 @@ subject to the following restrictions: ///that is better portable and more predictable #include "btScalar.h" + -+// -- GODOT start -- +namespace VHACD { -+// -- GODOT end -- + //#define BT_DEBUG_MEMORY_ALLOCATIONS 1 #ifdef BT_DEBUG_MEMORY_ALLOCATIONS -@@ -101,4 +106,8 @@ public: +@@ -101,4 +104,6 @@ public: friend bool operator==(const self_type&, const self_type&) { return true; } }; -+// -- GODOT start -- +}; // namespace VHACD -+// -- GODOT end -- + #endif //BT_ALIGNED_ALLOCATOR diff --git a/thirdparty/vhacd/inc/btAlignedObjectArray.h b/thirdparty/vhacd/inc/btAlignedObjectArray.h -index e6620adf6..1ce03d21b 100644 +index e6620adf6f..7446a8bfd9 100644 --- a/thirdparty/vhacd/inc/btAlignedObjectArray.h +++ b/thirdparty/vhacd/inc/btAlignedObjectArray.h -@@ -38,6 +38,10 @@ subject to the following restrictions: +@@ -38,6 +38,8 @@ subject to the following restrictions: #include //for placement new #endif //BT_USE_PLACEMENT_NEW -+// -- GODOT start -- +namespace VHACD { -+// -- GODOT end -- + ///The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods ///It is developed to replace stl::vector to avoid portability issues, including STL alignment issues to add SIMD/SSE data template -@@ -445,4 +449,8 @@ public: +@@ -445,4 +447,6 @@ public: } }; -+// -- GODOT start -- +}; // namespace VHACD -+// -- GODOT end -- + #endif //BT_OBJECT_ARRAY__ diff --git a/thirdparty/vhacd/inc/btConvexHullComputer.h b/thirdparty/vhacd/inc/btConvexHullComputer.h -index 3c5075c2c..04bb96f64 100644 +index 3c5075c2cb..194917cdec 100644 --- a/thirdparty/vhacd/inc/btConvexHullComputer.h +++ b/thirdparty/vhacd/inc/btConvexHullComputer.h -@@ -18,6 +18,10 @@ subject to the following restrictions: +@@ -18,6 +18,8 @@ subject to the following restrictions: #include "btAlignedObjectArray.h" #include "btVector3.h" -+// -- GODOT start -- +namespace VHACD { -+// -- GODOT end -- + /// Convex hull implementation based on Preparata and Hong /// See http://code.google.com/p/bullet/issues/detail?id=275 /// Ole Kniemeyer, MAXON Computer GmbH -@@ -94,4 +98,8 @@ public: +@@ -94,4 +96,6 @@ public: } }; -+// -- GODOT start -- +}; // namespace VHACD -+// -- GODOT end -- + #endif //BT_CONVEX_HULL_COMPUTER_H diff --git a/thirdparty/vhacd/inc/btMinMax.h b/thirdparty/vhacd/inc/btMinMax.h -index 40b0ceb6e..9bc1e1c77 100644 +index 40b0ceb6ed..12aaeda9c4 100644 --- a/thirdparty/vhacd/inc/btMinMax.h +++ b/thirdparty/vhacd/inc/btMinMax.h -@@ -17,6 +17,10 @@ subject to the following restrictions: +@@ -17,6 +17,8 @@ subject to the following restrictions: #include "btScalar.h" -+// -- GODOT start -- +namespace VHACD { -+// -- GODOT end -- + template SIMD_FORCE_INLINE const T& btMin(const T& a, const T& b) { -@@ -62,4 +66,8 @@ SIMD_FORCE_INLINE void btClamp(T& a, const T& lb, const T& ub) +@@ -62,4 +64,6 @@ SIMD_FORCE_INLINE void btClamp(T& a, const T& lb, const T& ub) } } -+// -- GODOT start -- +}; // namespace VHACD -+// -- GODOT end -- + #endif //BT_GEN_MINMAX_H diff --git a/thirdparty/vhacd/inc/btScalar.h b/thirdparty/vhacd/inc/btScalar.h -index b814474bd..617fd7c44 100644 +index b814474bdf..404bcbcfe1 100644 --- a/thirdparty/vhacd/inc/btScalar.h +++ b/thirdparty/vhacd/inc/btScalar.h -@@ -28,11 +28,19 @@ subject to the following restrictions: +@@ -28,11 +28,15 @@ subject to the following restrictions: /* SVN $Revision$ on $Date$ from http://bullet.googlecode.com*/ #define BT_BULLET_VERSION 279 -+// -- GODOT start -- +namespace VHACD { -+// -- GODOT end -- + inline int32_t btGetVersion() { return BT_BULLET_VERSION; } -+// -- GODOT start -- +}; // namespace VHACD -+// -- GODOT end -- + #if defined(DEBUG) || defined(_DEBUG) #define BT_DEBUG #endif -@@ -199,6 +207,10 @@ inline int32_t btGetVersion() +@@ -199,6 +203,8 @@ inline int32_t btGetVersion() #endif //__CELLOS_LV2__ #endif -+// -- GODOT start -- +namespace VHACD { -+// -- GODOT end -- + ///The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision. #if defined(BT_USE_DOUBLE_PRECISION) typedef double btScalar; -@@ -530,4 +542,9 @@ struct btTypedObject { +@@ -530,4 +536,7 @@ struct btTypedObject { return m_objectType; } }; + -+// -- GODOT start -- +}; // namespace VHACD -+// -- GODOT end -- + #endif //BT_SCALAR_H diff --git a/thirdparty/vhacd/inc/btVector3.h b/thirdparty/vhacd/inc/btVector3.h -index 0f2fefbbd..4ed971673 100644 +index 0f2fefbbd5..356a6a9cfc 100644 --- a/thirdparty/vhacd/inc/btVector3.h +++ b/thirdparty/vhacd/inc/btVector3.h -@@ -26,6 +26,10 @@ subject to the following restrictions: +@@ -26,6 +26,8 @@ subject to the following restrictions: #define btVector3DataName "btVector3FloatData" #endif //BT_USE_DOUBLE_PRECISION -+// -- GODOT start -- +namespace VHACD { -+// -- GODOT end -- + /**@brief btVector3 can be used to represent 3D points and vectors. * It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user * Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers -@@ -712,4 +716,8 @@ SIMD_FORCE_INLINE void btVector3::deSerialize(const struct btVector3Data& dataIn +@@ -712,4 +714,6 @@ SIMD_FORCE_INLINE void btVector3::deSerialize(const struct btVector3Data& dataIn m_floats[i] = dataIn.m_floats[i]; } -+// -- GODOT start -- +}; // namespace VHACD -+// -- GODOT end -- + #endif //BT_VECTOR3_H diff --git a/thirdparty/vhacd/src/btAlignedAllocator.cpp b/thirdparty/vhacd/src/btAlignedAllocator.cpp -index 11d594f6c..ce0e7f26f 100644 +index 11d594f6c9..bbb8baa107 100644 --- a/thirdparty/vhacd/src/btAlignedAllocator.cpp +++ b/thirdparty/vhacd/src/btAlignedAllocator.cpp -@@ -15,6 +15,10 @@ subject to the following restrictions: +@@ -15,6 +15,8 @@ subject to the following restrictions: #include "btAlignedAllocator.h" -+// -- GODOT start -- +namespace VHACD { -+// -- GODOT end -- + #ifdef _MSC_VER #pragma warning(disable:4311 4302) #endif -@@ -177,4 +181,8 @@ void btAlignedFreeInternal(void* ptr) +@@ -177,4 +179,6 @@ void btAlignedFreeInternal(void* ptr) sAlignedFreeFunc(ptr); } -+// -- GODOT start -- +}; // namespace VHACD -+// -- GODOT end -- + #endif //BT_DEBUG_MEMORY_ALLOCATIONS diff --git a/thirdparty/vhacd/src/btConvexHullComputer.cpp b/thirdparty/vhacd/src/btConvexHullComputer.cpp -index d3d749adb..8ab34af2a 100644 +index d3d749adbe..4f224c8360 100644 --- a/thirdparty/vhacd/src/btConvexHullComputer.cpp +++ b/thirdparty/vhacd/src/btConvexHullComputer.cpp -@@ -49,6 +49,10 @@ typedef unsigned long long int32_t uint64_t; +@@ -49,6 +49,8 @@ typedef unsigned long long int32_t uint64_t; #include #endif -+// -- GODOT start -- +namespace VHACD { -+// -- GODOT end -- + // Convex hull implementation based on Preparata and Hong // Ole Kniemeyer, MAXON Computer GmbH class btConvexHullInternal { -@@ -2477,3 +2481,7 @@ btScalar btConvexHullComputer::compute(const void* coords, bool doubleCoords, in +@@ -2477,3 +2479,5 @@ btScalar btConvexHullComputer::compute(const void* coords, bool doubleCoords, in return shift; } + -+// -- GODOT start -- +}; // namespace VHACD -+// -- GODOT end -- diff --git a/thirdparty/vhacd/0002-fpermissive-fix.patch b/thirdparty/vhacd/patches/0002-fpermissive-fix.patch similarity index 82% rename from thirdparty/vhacd/0002-fpermissive-fix.patch rename to thirdparty/vhacd/patches/0002-fpermissive-fix.patch index 965df2944ab..f1de1abfc50 100644 --- a/thirdparty/vhacd/0002-fpermissive-fix.patch +++ b/thirdparty/vhacd/patches/0002-fpermissive-fix.patch @@ -1,12 +1,11 @@ diff --git a/thirdparty/vhacd/inc/btScalar.h b/thirdparty/vhacd/inc/btScalar.h -index 487205062..52297cd78 100644 +index 404bcbcfe1..db00a3c428 100644 --- a/thirdparty/vhacd/inc/btScalar.h +++ b/thirdparty/vhacd/inc/btScalar.h -@@ -535,6 +535,29 @@ struct btTypedObject { +@@ -537,6 +537,27 @@ struct btTypedObject { } }; -+// -- GODOT start -- +// Cherry-picked from Bullet 2.88 to fix GH-27926 +///align a pointer to the provided alignment, upwards +template @@ -27,27 +26,24 @@ index 487205062..52297cd78 100644 + converter.integer &= bit_mask; + return converter.ptr; +} -+// -- GODOT end -- + - // -- GODOT start -- }; // namespace VHACD - // -- GODOT end -- + + #endif //BT_SCALAR_H diff --git a/thirdparty/vhacd/src/btAlignedAllocator.cpp b/thirdparty/vhacd/src/btAlignedAllocator.cpp -index ce0e7f26f..8dee31e7e 100644 +index bbb8baa107..4d7f4b1b2f 100644 --- a/thirdparty/vhacd/src/btAlignedAllocator.cpp +++ b/thirdparty/vhacd/src/btAlignedAllocator.cpp -@@ -72,8 +72,12 @@ static inline void* btAlignedAllocDefault(size_t size, int32_t alignment) +@@ -70,8 +70,10 @@ static inline void* btAlignedAllocDefault(size_t size, int32_t alignment) real = (char*)sAllocFunc(size + sizeof(void*) + (alignment - 1)); if (real) { - offset = (alignment - (unsigned long)(real + sizeof(void*))) & (alignment - 1); - ret = (void*)((real + sizeof(void*)) + offset); -+ // -- GODOT start -- + // Synced with Bullet 2.88 to fix GH-27926 + //offset = (alignment - (unsigned long)(real + sizeof(void*))) & (alignment - 1); + //ret = (void*)((real + sizeof(void*)) + offset); + ret = btAlignPointer(real + sizeof(void *), alignment); -+ // -- GODOT end -- *((void**)(ret)-1) = (void*)(real); } else { diff --git a/thirdparty/vhacd/0003-fix-musl-build.patch b/thirdparty/vhacd/patches/0003-fix-musl-build.patch similarity index 77% rename from thirdparty/vhacd/0003-fix-musl-build.patch rename to thirdparty/vhacd/patches/0003-fix-musl-build.patch index 67af8546f36..15a92a222f1 100644 --- a/thirdparty/vhacd/0003-fix-musl-build.patch +++ b/thirdparty/vhacd/patches/0003-fix-musl-build.patch @@ -1,15 +1,13 @@ diff --git a/thirdparty/vhacd/inc/vhacdMutex.h b/thirdparty/vhacd/inc/vhacdMutex.h -index 6b09259200..d587dd6387 100644 +index 6b09259200..22acc2135a 100644 --- a/thirdparty/vhacd/inc/vhacdMutex.h +++ b/thirdparty/vhacd/inc/vhacdMutex.h -@@ -71,7 +71,9 @@ +@@ -71,7 +71,7 @@ #include #endif -#if defined(__APPLE__) -+// -- GODOT start -- +#if defined(__APPLE__) || !defined(__GLIBC__) -+// -- GODOT end -- #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE #endif diff --git a/thirdparty/vhacd/0004-fix-uwp-arm-build.patch b/thirdparty/vhacd/patches/0004-fix-msvc-arm-build.patch similarity index 82% rename from thirdparty/vhacd/0004-fix-uwp-arm-build.patch rename to thirdparty/vhacd/patches/0004-fix-msvc-arm-build.patch index 8a57aae7fd6..c927f68bed8 100644 --- a/thirdparty/vhacd/0004-fix-uwp-arm-build.patch +++ b/thirdparty/vhacd/patches/0004-fix-msvc-arm-build.patch @@ -1,16 +1,14 @@ diff --git a/thirdparty/vhacd/inc/btScalar.h b/thirdparty/vhacd/inc/btScalar.h -index 3999a71521..4c9e0cf7ab 100644 +index db00a3c428..ef8546a4b5 100644 --- a/thirdparty/vhacd/inc/btScalar.h +++ b/thirdparty/vhacd/inc/btScalar.h -@@ -72,7 +72,10 @@ inline int32_t btGetVersion() +@@ -68,7 +68,8 @@ inline int32_t btGetVersion() #define btFsel(a, b, c) __fsel((a), (b), (c)) #else -#if (defined(_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined(BT_USE_DOUBLE_PRECISION)) -+// -- GODOT start -- +//#if (defined(_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined(BT_USE_DOUBLE_PRECISION)) +#if (defined(_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined(BT_USE_DOUBLE_PRECISION)) && (!defined(_M_ARM)) && (!defined(_M_ARM64)) -+// -- GODOT end -- #define BT_USE_SSE #include #endif diff --git a/thirdparty/vhacd/0005-fix-scale-calculation.patch b/thirdparty/vhacd/patches/0005-fix-scale-calculation.patch similarity index 100% rename from thirdparty/vhacd/0005-fix-scale-calculation.patch rename to thirdparty/vhacd/patches/0005-fix-scale-calculation.patch diff --git a/thirdparty/vhacd/0006-fix-gcc13.patch b/thirdparty/vhacd/patches/0006-gcc13-include-fix.patch similarity index 66% rename from thirdparty/vhacd/0006-fix-gcc13.patch rename to thirdparty/vhacd/patches/0006-gcc13-include-fix.patch index b8df42b9362..fbbcfc6fede 100644 --- a/thirdparty/vhacd/0006-fix-gcc13.patch +++ b/thirdparty/vhacd/patches/0006-gcc13-include-fix.patch @@ -1,38 +1,27 @@ diff --git a/thirdparty/vhacd/inc/vhacdICHull.h b/thirdparty/vhacd/inc/vhacdICHull.h -index 132bdcfb3e..925584cf52 100644 +index 132bdcfb3e..4075a9e054 100644 --- a/thirdparty/vhacd/inc/vhacdICHull.h +++ b/thirdparty/vhacd/inc/vhacdICHull.h -@@ -18,6 +18,10 @@ +@@ -18,6 +18,8 @@ #include "vhacdManifoldMesh.h" #include "vhacdVector.h" -+// -- GODOT start -- +#include -+// -- GODOT end -- + namespace VHACD { //! Incremental Convex Hull algorithm (cf. http://cs.smith.edu/~orourke/books/ftp.html ). enum ICHullError { diff --git a/thirdparty/vhacd/inc/vhacdManifoldMesh.h b/thirdparty/vhacd/inc/vhacdManifoldMesh.h -index a48f53c5c5..5eed4e13aa 100644 +index a48f53c5c5..3f9d039470 100644 --- a/thirdparty/vhacd/inc/vhacdManifoldMesh.h +++ b/thirdparty/vhacd/inc/vhacdManifoldMesh.h -@@ -18,6 +18,11 @@ All rights reserved. +@@ -18,6 +18,9 @@ All rights reserved. #include "vhacdCircularList.h" #include "vhacdSArray.h" #include "vhacdVector.h" + -+// -- GODOT start -- +#include -+// -- GODOT end -- + namespace VHACD { class TMMTriangle; class TMMEdge; -@@ -139,4 +144,4 @@ private: - friend class ICHull; - }; - } --#endif // VHACD_MANIFOLD_MESH_H -\ No newline at end of file -+#endif // VHACD_MANIFOLD_MESH_H diff --git a/thirdparty/vhacd/src/btAlignedAllocator.cpp b/thirdparty/vhacd/src/btAlignedAllocator.cpp index 8dee31e7e36..4d7f4b1b2f1 100644 --- a/thirdparty/vhacd/src/btAlignedAllocator.cpp +++ b/thirdparty/vhacd/src/btAlignedAllocator.cpp @@ -15,9 +15,7 @@ subject to the following restrictions: #include "btAlignedAllocator.h" -// -- GODOT start -- namespace VHACD { -// -- GODOT end -- #ifdef _MSC_VER #pragma warning(disable:4311 4302) @@ -72,12 +70,10 @@ static inline void* btAlignedAllocDefault(size_t size, int32_t alignment) real = (char*)sAllocFunc(size + sizeof(void*) + (alignment - 1)); if (real) { - // -- GODOT start -- // Synced with Bullet 2.88 to fix GH-27926 //offset = (alignment - (unsigned long)(real + sizeof(void*))) & (alignment - 1); //ret = (void*)((real + sizeof(void*)) + offset); ret = btAlignPointer(real + sizeof(void *), alignment); - // -- GODOT end -- *((void**)(ret)-1) = (void*)(real); } else { @@ -185,8 +181,6 @@ void btAlignedFreeInternal(void* ptr) sAlignedFreeFunc(ptr); } -// -- GODOT start -- }; // namespace VHACD -// -- GODOT end -- #endif //BT_DEBUG_MEMORY_ALLOCATIONS diff --git a/thirdparty/vhacd/src/btConvexHullComputer.cpp b/thirdparty/vhacd/src/btConvexHullComputer.cpp index 8ab34af2abd..4f224c83604 100644 --- a/thirdparty/vhacd/src/btConvexHullComputer.cpp +++ b/thirdparty/vhacd/src/btConvexHullComputer.cpp @@ -49,9 +49,7 @@ typedef unsigned long long int32_t uint64_t; #include #endif -// -- GODOT start -- namespace VHACD { -// -- GODOT end -- // Convex hull implementation based on Preparata and Hong // Ole Kniemeyer, MAXON Computer GmbH @@ -2482,6 +2480,4 @@ btScalar btConvexHullComputer::compute(const void* coords, bool doubleCoords, in return shift; } -// -- GODOT start -- }; // namespace VHACD -// -- GODOT end -- diff --git a/thirdparty/vulkan/patches/VKEnumStringHelper-use-godot-vulkan.patch b/thirdparty/vulkan/patches/0001-VKEnumStringHelper-godot-vulkan.patch similarity index 100% rename from thirdparty/vulkan/patches/VKEnumStringHelper-use-godot-vulkan.patch rename to thirdparty/vulkan/patches/0001-VKEnumStringHelper-godot-vulkan.patch diff --git a/thirdparty/vulkan/patches/VMA-use-godot-vulkan.patch b/thirdparty/vulkan/patches/0002-VMA-godot-vulkan.patch similarity index 100% rename from thirdparty/vulkan/patches/VMA-use-godot-vulkan.patch rename to thirdparty/vulkan/patches/0002-VMA-godot-vulkan.patch diff --git a/thirdparty/vulkan/patches/0003-VMA-add-vmaCalculateLazilyAllocatedBytes.patch b/thirdparty/vulkan/patches/0003-VMA-add-vmaCalculateLazilyAllocatedBytes.patch index 4c0d9093522..6c5f68932a6 100644 --- a/thirdparty/vulkan/patches/0003-VMA-add-vmaCalculateLazilyAllocatedBytes.patch +++ b/thirdparty/vulkan/patches/0003-VMA-add-vmaCalculateLazilyAllocatedBytes.patch @@ -1,12 +1,11 @@ diff --git a/thirdparty/vulkan/vk_mem_alloc.h b/thirdparty/vulkan/vk_mem_alloc.h -index ecb84094b9..50ff4ea1c2 100644 +index ecb84094b9..c436209896 100644 --- a/thirdparty/vulkan/vk_mem_alloc.h +++ b/thirdparty/vulkan/vk_mem_alloc.h -@@ -1713,6 +1713,21 @@ VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStatistics( +@@ -1713,6 +1713,19 @@ VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStatistics( VmaAllocator VMA_NOT_NULL allocator, VmaTotalStatistics* VMA_NOT_NULL pStats); -+// -- GODOT begin -- +/** \brief Retrieves lazily allocated bytes + +This function is called "calculate" not "get" because it has to traverse all @@ -19,16 +18,14 @@ index ecb84094b9..50ff4ea1c2 100644 +*/ +VMA_CALL_PRE uint64_t VMA_CALL_POST vmaCalculateLazilyAllocatedBytes( + VmaAllocator VMA_NOT_NULL allocator); -+// -- GODOT end -- + /** \brief Retrieves information about current memory usage and budget for all memory heaps. \param allocator -@@ -14912,6 +14927,28 @@ VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStatistics( +@@ -14912,6 +14925,26 @@ VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStatistics( allocator->CalculateStatistics(pStats); } -+// -- GODOT begin -- +VMA_CALL_PRE uint64_t VMA_CALL_POST vmaCalculateLazilyAllocatedBytes( + VmaAllocator allocator) +{ @@ -48,7 +45,6 @@ index ecb84094b9..50ff4ea1c2 100644 + } + return total_lazilily_allocated_bytes; +} -+// -- GODOT end -- + VMA_CALL_PRE void VMA_CALL_POST vmaGetHeapBudgets( VmaAllocator allocator, diff --git a/thirdparty/vulkan/vk_mem_alloc.h b/thirdparty/vulkan/vk_mem_alloc.h index 50ff4ea1c23..c4362098964 100644 --- a/thirdparty/vulkan/vk_mem_alloc.h +++ b/thirdparty/vulkan/vk_mem_alloc.h @@ -1713,7 +1713,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStatistics( VmaAllocator VMA_NOT_NULL allocator, VmaTotalStatistics* VMA_NOT_NULL pStats); -// -- GODOT begin -- /** \brief Retrieves lazily allocated bytes This function is called "calculate" not "get" because it has to traverse all @@ -1726,7 +1725,6 @@ become outdated. */ VMA_CALL_PRE uint64_t VMA_CALL_POST vmaCalculateLazilyAllocatedBytes( VmaAllocator VMA_NOT_NULL allocator); -// -- GODOT end -- /** \brief Retrieves information about current memory usage and budget for all memory heaps. @@ -14927,7 +14925,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStatistics( allocator->CalculateStatistics(pStats); } -// -- GODOT begin -- VMA_CALL_PRE uint64_t VMA_CALL_POST vmaCalculateLazilyAllocatedBytes( VmaAllocator allocator) { @@ -14947,7 +14944,6 @@ VMA_CALL_PRE uint64_t VMA_CALL_POST vmaCalculateLazilyAllocatedBytes( } return total_lazilily_allocated_bytes; } -// -- GODOT end -- VMA_CALL_PRE void VMA_CALL_POST vmaGetHeapBudgets( VmaAllocator allocator, diff --git a/thirdparty/wslay/patches/0001-msvc-build-fix.patch b/thirdparty/wslay/patches/0001-msvc-build-fix.patch new file mode 100644 index 00000000000..dab365bba62 --- /dev/null +++ b/thirdparty/wslay/patches/0001-msvc-build-fix.patch @@ -0,0 +1,16 @@ +diff --git a/thirdparty/wslay/wslay/wslay.h b/thirdparty/wslay/wslay/wslay.h +index 7ab850111a..7d63bdb2ce 100644 +--- a/thirdparty/wslay/wslay/wslay.h ++++ b/thirdparty/wslay/wslay/wslay.h +@@ -33,6 +33,11 @@ extern "C" { + #include + #include + ++#if defined(_MSC_VER) ++#include ++typedef SSIZE_T ssize_t; ++#endif ++ + /* + * wslay/wslayver.h is generated from wslay/wslayver.h.in by + * configure. The projects which do not use autotools can set diff --git a/thirdparty/wslay/patches/msvcfix.diff b/thirdparty/wslay/patches/msvcfix.diff deleted file mode 100644 index f58b6d44f07..00000000000 --- a/thirdparty/wslay/patches/msvcfix.diff +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/thirdparty/wslay/includes/wslay/wslay.h b/thirdparty/wslay/includes/wslay/wslay.h -index 77a4e8253f..ac6873613f 100644 ---- a/thirdparty/wslay/includes/wslay/wslay.h -+++ b/thirdparty/wslay/includes/wslay/wslay.h -@@ -33,6 +33,13 @@ extern "C" { - #include - #include - -+/* GODOT ADDITTION */ -+#if defined(_MSC_VER) -+#include -+typedef SSIZE_T ssize_t; -+#endif -+/* GODOT END */ -+ - /* - * wslay/wslayver.h is generated from wslay/wslayver.h.in by - * configure. The projects which do not use autotools can set diff --git a/thirdparty/wslay/wslay/wslay.h b/thirdparty/wslay/wslay/wslay.h index b7fe516ba3b..7d63bdb2ce0 100644 --- a/thirdparty/wslay/wslay/wslay.h +++ b/thirdparty/wslay/wslay/wslay.h @@ -33,12 +33,10 @@ extern "C" { #include #include -/* GODOT ADDITTION */ #if defined(_MSC_VER) #include typedef SSIZE_T ssize_t; #endif -/* GODOT END */ /* * wslay/wslayver.h is generated from wslay/wslayver.h.in by