summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/basis_universal/SCsub23
-rw-r--r--modules/basis_universal/register_types.cpp4
-rw-r--r--modules/basis_universal/texture_basisu.cpp2
-rw-r--r--modules/basis_universal/texture_basisu.h2
-rw-r--r--modules/gdnative/include/gdnative/callable.h1
-rw-r--r--modules/gdnative/include/gdnative/signal.h1
-rw-r--r--modules/raycast/config.py8
-rw-r--r--modules/raycast/lightmap_raycaster.cpp6
8 files changed, 33 insertions, 14 deletions
diff --git a/modules/basis_universal/SCsub b/modules/basis_universal/SCsub
index 351628a0e3..1f9fde966d 100644
--- a/modules/basis_universal/SCsub
+++ b/modules/basis_universal/SCsub
@@ -11,40 +11,45 @@ thirdparty_obj = []
# Not unbundled so far since not widespread as shared library
thirdparty_dir = "#thirdparty/basis_universal/"
-tool_sources = [
+# Sync list with upstream CMakeLists.txt
+encoder_sources = [
+ "apg_bmp.c",
"basisu_astc_decomp.cpp",
"basisu_backend.cpp",
"basisu_basis_file.cpp",
+ "basisu_bc7enc.cpp",
"basisu_comp.cpp",
"basisu_enc.cpp",
"basisu_etc.cpp",
"basisu_frontend.cpp",
"basisu_global_selector_palette_helpers.cpp",
"basisu_gpu_texture.cpp",
+ "basisu_kernels_sse.cpp",
"basisu_pvrtc1_4.cpp",
- "basisu_resample_filters.cpp",
"basisu_resampler.cpp",
+ "basisu_resample_filters.cpp",
"basisu_ssim.cpp",
+ "basisu_uastc_enc.cpp",
+ "jpgd.cpp",
"lodepng.cpp",
]
-tool_sources = [thirdparty_dir + file for file in tool_sources]
+encoder_sources = [thirdparty_dir + "encoder/" + file for file in encoder_sources]
transcoder_sources = [thirdparty_dir + "transcoder/basisu_transcoder.cpp"]
# Treat Basis headers as system headers to avoid raising warnings. Not supported on MSVC.
if not env.msvc:
- env_basisu.Append(
- CPPFLAGS=["-isystem", Dir(thirdparty_dir).path, "-isystem", Dir(thirdparty_dir + "transcoder").path]
- )
+ env_basisu.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path])
else:
- env_basisu.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "transcoder"])
+ env_basisu.Prepend(CPPPATH=[thirdparty_dir])
if env["target"] == "debug":
- env_basisu.Append(CPPFLAGS=["-DBASISU_DEVEL_MESSAGES=1", "-DBASISD_ENABLE_DEBUG_FLAGS=1"])
+ env_basisu.Append(CPPDEFINES=[("BASISU_DEVEL_MESSAGES", 1), ("BASISD_ENABLE_DEBUG_FLAGS", 1)])
env_thirdparty = env_basisu.Clone()
env_thirdparty.disable_warnings()
if env["tools"]:
- env_thirdparty.add_source_files(thirdparty_obj, tool_sources)
+ env_thirdparty.Append(CPPDEFINES=["BASISU_NO_IMG_LOADERS"])
+ env_thirdparty.add_source_files(thirdparty_obj, encoder_sources)
env_thirdparty.add_source_files(thirdparty_obj, transcoder_sources)
env.modules_sources += thirdparty_obj
diff --git a/modules/basis_universal/register_types.cpp b/modules/basis_universal/register_types.cpp
index cf5581265b..772ac87dbf 100644
--- a/modules/basis_universal/register_types.cpp
+++ b/modules/basis_universal/register_types.cpp
@@ -35,7 +35,7 @@
#include "texture_basisu.h"
#ifdef TOOLS_ENABLED
-#include <basisu_comp.h>
+#include <encoder/basisu_comp.h>
#endif
#include <transcoder/basisu_transcoder.h>
@@ -233,7 +233,7 @@ static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) {
basist::basisu_image_info info;
tr.get_image_info(ptr, size, info, 0);
- int block_size = basist::basis_get_bytes_per_block(format);
+ int block_size = basist::basis_get_bytes_per_block_or_pixel(format);
Vector<uint8_t> gpudata;
gpudata.resize(info.m_total_blocks * block_size);
diff --git a/modules/basis_universal/texture_basisu.cpp b/modules/basis_universal/texture_basisu.cpp
index 92882a1cc8..6a5f6313c4 100644
--- a/modules/basis_universal/texture_basisu.cpp
+++ b/modules/basis_universal/texture_basisu.cpp
@@ -33,7 +33,7 @@
#include "core/os/os.h"
#ifdef TOOLS_ENABLED
-#include <basisu_comp.h>
+#include <encoder/basisu_comp.h>
#endif
#include <transcoder/basisu_transcoder.h>
diff --git a/modules/basis_universal/texture_basisu.h b/modules/basis_universal/texture_basisu.h
index 282a0dfc8a..3316035404 100644
--- a/modules/basis_universal/texture_basisu.h
+++ b/modules/basis_universal/texture_basisu.h
@@ -34,7 +34,7 @@
#include "scene/resources/texture.h"
#ifdef TOOLS_ENABLED
-#include <basisu_comp.h>
+#include <encoder/basisu_comp.h>
#endif
#include <transcoder/basisu_transcoder.h>
diff --git a/modules/gdnative/include/gdnative/callable.h b/modules/gdnative/include/gdnative/callable.h
index b84b0c1f1f..1d52ca7a68 100644
--- a/modules/gdnative/include/gdnative/callable.h
+++ b/modules/gdnative/include/gdnative/callable.h
@@ -37,6 +37,7 @@ extern "C" {
#include <stdint.h>
+// Alignment hardcoded in `core/variant/callable.h`.
#define GODOT_CALLABLE_SIZE (16)
#ifndef GODOT_CORE_API_GODOT_CALLABLE_TYPE_DEFINED
diff --git a/modules/gdnative/include/gdnative/signal.h b/modules/gdnative/include/gdnative/signal.h
index f4dc17e089..41a76d0510 100644
--- a/modules/gdnative/include/gdnative/signal.h
+++ b/modules/gdnative/include/gdnative/signal.h
@@ -37,6 +37,7 @@ extern "C" {
#include <stdint.h>
+// Alignment hardcoded in `core/variant/callable.h`.
#define GODOT_SIGNAL_SIZE (16)
#ifndef GODOT_CORE_API_GODOT_SIGNAL_TYPE_DEFINED
diff --git a/modules/raycast/config.py b/modules/raycast/config.py
index 26493da41b..3da9ace9d8 100644
--- a/modules/raycast/config.py
+++ b/modules/raycast/config.py
@@ -1,10 +1,16 @@
def can_build(env, platform):
+ # Depends on Embree library, which supports only x86_64 (originally)
+ # and aarch64 (thanks to the embree-aarch64 fork).
+
if platform == "android":
- return env["android_arch"] in ["arm64v8", "x86", "x86_64"]
+ return env["android_arch"] in ["arm64v8", "x86_64"]
if platform == "javascript":
return False # No SIMD support yet
+ if env["bits"] == "32":
+ return False
+
return True
diff --git a/modules/raycast/lightmap_raycaster.cpp b/modules/raycast/lightmap_raycaster.cpp
index 56bdb5900b..0583acc119 100644
--- a/modules/raycast/lightmap_raycaster.cpp
+++ b/modules/raycast/lightmap_raycaster.cpp
@@ -32,7 +32,9 @@
#include "lightmap_raycaster.h"
+#ifdef __SSE2__
#include <pmmintrin.h>
+#endif
LightmapRaycaster *LightmapRaycasterEmbree::create_embree_raycaster() {
return memnew(LightmapRaycasterEmbree);
@@ -171,8 +173,10 @@ void embree_error_handler(void *p_user_data, RTCError p_code, const char *p_str)
}
LightmapRaycasterEmbree::LightmapRaycasterEmbree() {
+#ifdef __SSE2__
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
+#endif
embree_device = rtcNewDevice(nullptr);
rtcSetDeviceErrorFunction(embree_device, &embree_error_handler, nullptr);
@@ -180,8 +184,10 @@ LightmapRaycasterEmbree::LightmapRaycasterEmbree() {
}
LightmapRaycasterEmbree::~LightmapRaycasterEmbree() {
+#ifdef __SSE2__
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_OFF);
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_OFF);
+#endif
if (embree_scene != nullptr) {
rtcReleaseScene(embree_scene);