-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libktx: Update to 4.3.1 #88075
libktx: Update to 4.3.1 #88075
Conversation
Seems like the guards employed in |
d34bab6
to
b4e5fe3
Compare
Not sure what to do here, failed builds are the result of one I added two |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash the commits https://docs.godotengine.org/en/stable/contributing/workflow/pr_workflow.html but I am generally ok with library upgrades.
Probably want to test a basisu ktx from gltf from https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/StainedGlassLamp
This compiles on my end, both editor and template build; I'm gonna hold on before squishing commits for someone to approve the PR, if everything is safe and sound I'll push a rebase. |
Changes look good overall! The miniz situation can be solved in a better way with this extra diff: diff --git a/modules/ktx/SCsub b/modules/ktx/SCsub
index 3a37ef93ee..887ffa5d14 100644
--- a/modules/ktx/SCsub
+++ b/modules/ktx/SCsub
@@ -12,11 +12,11 @@ thirdparty_obj = []
thirdparty_dir = "#thirdparty/libktx/"
thirdparty_sources = [
"lib/basis_transcode.cpp",
- "lib/miniz_wrapper.cpp",
"lib/checkheader.c",
"lib/filestream.c",
"lib/hashlist.c",
"lib/memstream.c",
+ "lib/miniz_wrapper.cpp",
"lib/swap.c",
"lib/texture.c",
"lib/texture1.c",
@@ -35,7 +35,10 @@ env_ktx.Prepend(CPPPATH=[thirdparty_dir + "include"])
env_ktx.Prepend(CPPPATH=[thirdparty_dir + "utils"])
env_ktx.Prepend(CPPPATH=[thirdparty_dir + "lib"])
env_ktx.Prepend(CPPPATH=[thirdparty_dir + "other_include"])
+
env_ktx.Prepend(CPPPATH=["#thirdparty/basis_universal"])
+# We already build the miniz implementation in the basis_universal module.
+env_ktx.Append(CPPDEFINES=["MINIZ_HEADER_FILE_ONLY"])
if env["vulkan"]:
env_ktx.Prepend(CPPPATH=["#thirdparty/vulkan/include"])
diff --git a/thirdparty/libktx/lib/miniz_wrapper.cpp b/thirdparty/libktx/lib/miniz_wrapper.cpp
index 3707c1a806..cbd7da540a 100644
--- a/thirdparty/libktx/lib/miniz_wrapper.cpp
+++ b/thirdparty/libktx/lib/miniz_wrapper.cpp
@@ -22,7 +22,7 @@
#include <assert.h>
-#ifndef TOOLS_ENABLED
+#if !KTX_FEATURE_WRITE
// The reader does not link with the basisu components that already include a
// definition of miniz so we include it here explicitly.
#ifdef __GNUC__
diff --git a/thirdparty/libktx/patches/godot.patch b/thirdparty/libktx/patches/godot.patch
index 61a7997b97..28db86cf9b 100644
--- a/thirdparty/libktx/patches/godot.patch
+++ b/thirdparty/libktx/patches/godot.patch
@@ -36,18 +36,9 @@ index 85d53202a5..25c7a2c238 100644
int channels[] = {0,1,2,3}; int bits[] = {5,5,5,1};
return createDFDPacked(0, 4, bits, channels, s_UNORM);
diff --git a/thirdparty/libktx/lib/miniz_wrapper.cpp b/thirdparty/libktx/lib/miniz_wrapper.cpp
-index 07920c4809..3707c1a806 100644
+index 07920c4809..cbd7da540a 100644
--- a/thirdparty/libktx/lib/miniz_wrapper.cpp
+++ b/thirdparty/libktx/lib/miniz_wrapper.cpp
-@@ -22,7 +22,7 @@
-
- #include <assert.h>
-
--#if !KTX_FEATURE_WRITE
-+#ifndef TOOLS_ENABLED
- // The reader does not link with the basisu components that already include a
- // definition of miniz so we include it here explicitly.
- #ifdef __GNUC__
@@ -30,7 +30,7 @@
#pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wmisleading-indentation" Basically passing |
Seems like we're back to square one:
The |
That's because we don't build the basis universal encoder in non-editor builds: godot/modules/basis_universal/SCsub Lines 52 to 54 in 16d6142
So miniz is not compiled. So we should pass |
af63ef4
to
613cf60
Compare
613cf60
to
1be2fe1
Compare
Thanks! |
https://github.com/KhronosGroup/KTX-Software/releases/tag/v4.3.1
Also updated
thirdparty/README.md
to be more precise and regeneratedthirdparty/libktx/godot.patch
.Edit: Bundledminiz
lib from upstream.