From 34cd2049929939289d2783299d33c48e8041ff38 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Thu, 8 Jun 2023 15:35:50 +0200 Subject: [PATCH 01/16] for debugging: run everything sequential except the linker, parallel means something else here (all files at once) --- build.xml | 20 ++++++++++---------- config/openbsd/build.xml | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build.xml b/build.xml index 85fdd42f1a..760c5e1b64 100644 --- a/build.xml +++ b/build.xml @@ -489,7 +489,7 @@ if:set="jdk10" /> - + @@ -525,9 +525,9 @@ - + - + @@ -537,7 +537,7 @@ - + @@ -1148,7 +1148,7 @@ - + @@ -1174,7 +1174,7 @@ - + @@ -1213,7 +1213,7 @@ - + @@ -1244,7 +1244,7 @@ - + @@ -1454,7 +1454,7 @@ - + @@ -1764,6 +1764,6 @@ - + diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index 6f92f9e4c3..771e8280cd 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -23,7 +23,7 @@ - + @@ -151,7 +151,7 @@ - + @@ -553,7 +553,7 @@ - + From 1683a5b55fde4511b49136ffc4af7f8d33f3e159 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Thu, 8 Jun 2023 15:39:16 +0200 Subject: [PATCH 02/16] Errors out and serves no purpose cc: error: no input files --- config/openbsd/build.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index 771e8280cd..431fda82ed 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -145,11 +145,7 @@ - - - - - + From f4a266f82e9188fb87ff960645e5f1bd9741ef64 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Thu, 8 Jun 2023 15:43:04 +0200 Subject: [PATCH 03/16] Serves no purpose b.c. its already defined in macrodef name="compile" --- config/openbsd/build.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index 431fda82ed..500d363785 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -81,11 +81,7 @@ - - - - - + From c795c6f3ad3456d1b9656df030ae92c35591739e Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Thu, 8 Jun 2023 17:05:58 +0200 Subject: [PATCH 04/16] Add so we can disable standard includes, so we can get our include search order correct. For custom ffi.h so we don't pick up the system ffi.h --- config/openbsd/build.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index 500d363785..af16cdf91d 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -16,6 +16,7 @@ + @@ -31,9 +32,9 @@ - - - + + + @@ -59,6 +60,7 @@ + @@ -80,7 +82,7 @@ - + @@ -146,7 +148,7 @@ - + From 96b09db2e9ce5447b9a728b9275569fab1662698 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Thu, 8 Jun 2023 17:27:57 +0200 Subject: [PATCH 05/16] libdivide really wants to know where the generated file is --- config/openbsd/build.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index af16cdf91d..27815f5f50 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -193,6 +193,12 @@ + + + + + + From 8eff9d639d9ddc46411ee051e423c7328ddc65dd Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Thu, 8 Jun 2023 17:36:25 +0200 Subject: [PATCH 06/16] link with lmdb --- config/openbsd/build.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index 27815f5f50..b37cb4a8f5 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -228,7 +228,9 @@ + + From d9dfb64ff8f6d36a51d31dd358243ed243752192 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Thu, 8 Jun 2023 17:55:31 +0200 Subject: [PATCH 07/16] libz4 needs to be statically linked (experimental LZ4_attach_dictionary) --- config/openbsd/build.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index b37cb4a8f5..a6fe88fcfd 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -249,7 +249,8 @@ - + + From 8264a6bd4eaefa69f387c93add9059a0f5ad3424 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Thu, 8 Jun 2023 20:48:43 +0200 Subject: [PATCH 08/16] fileset dont work? within link --- config/openbsd/build.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index a6fe88fcfd..0b374e14c3 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -167,11 +167,8 @@ - - - - + From dcc8ffc51880c5c62f6a4e24824d3f87cea02c46 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Fri, 9 Jun 2023 12:38:36 +0200 Subject: [PATCH 09/16] split tinyexr build into c and c++ parts don't link the c precompile stage by introducing a new dolink attribute link the c++ stage with libc++ and libc++abi --- config/openbsd/build.xml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index 0b374e14c3..875a9eead8 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -61,6 +61,7 @@ + @@ -112,7 +113,7 @@ - + @@ -390,7 +391,24 @@ - + + + + + + + + + + + + + + + + + @@ -404,9 +422,10 @@ + + - --> From 5bbcd8db66275d5589cfdec5de8fd31780e17763 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Fri, 9 Jun 2023 12:50:19 +0200 Subject: [PATCH 10/16] yoga needs libc++ libc++abi --- config/openbsd/build.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index 875a9eead8..9a12ab1073 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -531,6 +531,8 @@ + + From f096d30e0b9968f07dcbe3c24eb3d733d5879293 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Fri, 9 Jun 2023 13:28:07 +0200 Subject: [PATCH 11/16] vma: more includes, more c++ libraries although aligned_alloc should be available with #include i cant make it work, so switch to posix_memalign implementation in modules/lwjgl/vma/src/main/c/vk_mem_alloc.h --- config/openbsd/build.xml | 6 ++++-- modules/lwjgl/vma/src/main/c/vk_mem_alloc.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index 9a12ab1073..24d9686229 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -489,7 +489,6 @@ --> - - + From a7c696a3dd0da895fd100d8da23f785dd4759765 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Fri, 9 Jun 2023 21:08:06 +0200 Subject: [PATCH 13/16] glfwInitAllocator was only available for a short time in 3.3.0 nothing uses it, it's not implemented, so dont try to resolve it. --- .../src/templates/kotlin/glfw/GLFWTypes.kt | 10 --------- .../templates/kotlin/glfw/templates/GLFW.kt | 21 ------------------- .../test/java/org/lwjgl/demo/glfw/Gears.java | 13 ------------ 3 files changed, 44 deletions(-) diff --git a/modules/lwjgl/glfw/src/templates/kotlin/glfw/GLFWTypes.kt b/modules/lwjgl/glfw/src/templates/kotlin/glfw/GLFWTypes.kt index c5f98e271e..38b6e13106 100644 --- a/modules/lwjgl/glfw/src/templates/kotlin/glfw/GLFWTypes.kt +++ b/modules/lwjgl/glfw/src/templates/kotlin/glfw/GLFWTypes.kt @@ -269,16 +269,6 @@ val GLFWerrorfun = Module.GLFW.callback { } } -val GLFWallocator = struct(Module.GLFW, "GLFWAllocator", nativeName = "GLFWallocator") { - documentation = "A custom memory allocator that can be set with #InitAllocator()." - since = "version 3.4" - - GLFWallocatefun("allocate", "the memory allocation callback") - GLFWreallocatefun("reallocate", "the memory reallocation callback") - GLFWdeallocatefun("deallocate", "the memory deallocation callback") - nullable..opaque_p("user", "a user-defined pointer that will be passed to the callbacks") -} - val GLFWmonitorfun = Module.GLFW.callback { void( "GLFWMonitorCallback", diff --git a/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt b/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt index 5a7a56b741..4c01fa835d 100644 --- a/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt +++ b/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt @@ -1084,27 +1084,6 @@ val GLFW = "GLFW".nativeClass(Module.GLFW, prefix = "GLFW", binding = GLFW_BINDI since = "version 3.3" ) - void( - "InitAllocator", - """ - Sets the init allocator to the desired value. - - To use the default allocator, call this function with a #NULL argument. - - If you specify an allocator struct, every member must be a valid function pointer. If any member is #NULL, this function emits #INVALID_VALUE and the - init allocator is unchanged. - - ${note(ul( - "Possible errors include #INVALID_VALUE.", - "The specified allocator is copied before this function returns.", - "This function must only be called from the main thread." - ))} - """, - - nullable..GLFWallocator.const.p("allocator", "the allocator to use at the next initialization, or #NULL to use the default one"), - since = "version 3.4" - ) - void( "GetVersion", """ diff --git a/modules/samples/src/test/java/org/lwjgl/demo/glfw/Gears.java b/modules/samples/src/test/java/org/lwjgl/demo/glfw/Gears.java index 4ff2de663b..fa39ace424 100644 --- a/modules/samples/src/test/java/org/lwjgl/demo/glfw/Gears.java +++ b/modules/samples/src/test/java/org/lwjgl/demo/glfw/Gears.java @@ -21,7 +21,6 @@ /** The Gears demo implemented using GLFW. */ public class Gears { - private GLFWAllocator allocator; private Callback debugProc; private long window; @@ -60,13 +59,6 @@ private void framebufferSizeChanged(long window, int width, int height) { } private void init() { - allocator = GLFWAllocator.calloc() - .allocate((size, user) -> nmemAllocChecked(size)) - .reallocate((block, size, user) -> nmemReallocChecked(block, size)) - .deallocate((block, user) -> nmemFree(block)); - - glfwInitAllocator(allocator); - GLFWErrorCallback.createPrint().set(); if (!glfwInit()) { throw new IllegalStateException("Unable to initialize glfw"); @@ -233,11 +225,6 @@ private void destroy() { glfwTerminate(); Objects.requireNonNull(glfwSetErrorCallback(null)).free(); - - allocator.deallocate().free(); - allocator.reallocate().free(); - allocator.allocate().free(); - allocator.free(); } } \ No newline at end of file From 78b4a60d1ef2a82be80616f66be58f4b244c5d60 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Sat, 10 Jun 2023 10:29:07 +0200 Subject: [PATCH 14/16] Revert "for debugging: run everything sequential" This reverts commit 34cd2049929939289d2783299d33c48e8041ff38. --- build.xml | 20 ++++++++++---------- config/openbsd/build.xml | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build.xml b/build.xml index 760c5e1b64..85fdd42f1a 100644 --- a/build.xml +++ b/build.xml @@ -489,7 +489,7 @@ if:set="jdk10" /> - + @@ -525,9 +525,9 @@ - + - + @@ -537,7 +537,7 @@ - + @@ -1148,7 +1148,7 @@ - + @@ -1174,7 +1174,7 @@ - + @@ -1213,7 +1213,7 @@ - + @@ -1244,7 +1244,7 @@ - + @@ -1454,7 +1454,7 @@ - + @@ -1764,6 +1764,6 @@ - + diff --git a/config/openbsd/build.xml b/config/openbsd/build.xml index 918f4a3de8..84b7e44cbc 100644 --- a/config/openbsd/build.xml +++ b/config/openbsd/build.xml @@ -24,7 +24,7 @@ - + @@ -146,7 +146,7 @@ - + @@ -588,7 +588,7 @@ - + From f2590b4012c6b4db29ea46d1eb9a0c127ce33249 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Sat, 10 Jun 2023 11:02:21 +0200 Subject: [PATCH 15/16] glfwGetPlatform also no longer available --- .../templates/kotlin/glfw/templates/GLFW.kt | 22 ------------------- .../java/org/lwjgl/demo/openxr/XRHelper.java | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt b/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt index 4c01fa835d..1a438541ad 100644 --- a/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt +++ b/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt @@ -1178,28 +1178,6 @@ val GLFW = "GLFW".nativeClass(Module.GLFW, prefix = "GLFW", binding = GLFW_BINDI since = "version 3.0" ) - int( - "GetPlatform", - """ - Returns the currently selected platform. - - This function returns the platform that was selected during initialization. The returned value will be one of #PLATFORM_WIN32, #PLATFORM_COCOA, - #PLATFORM_WAYLAND, #PLATFORM_X11 or #PLATFORM_NULL. - - This function may be called from any thread. - """, - - void(), - - returnDoc = - """ - the currently selected platform, or zero if an error occurred. - - Possible errors include #NOT_INITIALIZED. - """, - since = "version 3.4" - ) - intb( "PlatformSupported", """ diff --git a/modules/samples/src/test/java/org/lwjgl/demo/openxr/XRHelper.java b/modules/samples/src/test/java/org/lwjgl/demo/openxr/XRHelper.java index 4895aaf12a..9d2b53e325 100644 --- a/modules/samples/src/test/java/org/lwjgl/demo/openxr/XRHelper.java +++ b/modules/samples/src/test/java/org/lwjgl/demo/openxr/XRHelper.java @@ -161,7 +161,7 @@ static XrSessionCreateInfo createGraphicsBindingOpenGL( } switch (Platform.get()) { case LINUX: - int platform = glfwGetPlatform(); + int platform = GLFW_PLATFORM_X11; if (platform == GLFW_PLATFORM_X11) { long display = glfwGetX11Display(); long glxConfig = glfwGetGLXFBConfig(window); From 4f76b8587ae76428950afda82cc7b300f51d59e3 Mon Sep 17 00:00:00 2001 From: Benjamin Baier Date: Sat, 10 Jun 2023 13:57:28 +0200 Subject: [PATCH 16/16] glfwPlatformSupported is not supported --- .../templates/kotlin/glfw/templates/GLFW.kt | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt b/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt index 1a438541ad..df9caaefa1 100644 --- a/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt +++ b/modules/lwjgl/glfw/src/templates/kotlin/glfw/templates/GLFW.kt @@ -455,8 +455,6 @@ val GLFW = "GLFW".nativeClass(Module.GLFW, prefix = "GLFW", binding = GLFW_BINDI a terminal that does not have the necessary environment variables. Fall back to a different platform if possible or notify the user that no usable platform was detected. - Failure to detect a specific platform may have the same cause as above or because support for that platform was not compiled in. Call - #PlatformSupported() to check whether a specific platform is supported by a library binary. """, 0x0001000E ) @@ -1114,8 +1112,6 @@ val GLFW = "GLFW".nativeClass(Module.GLFW, prefix = "GLFW", binding = GLFW_BINDI Do not use the version string to parse the GLFW library version. The #GetVersion() function already provides the version of the library binary in numerical format. - Do not use the version string to parse what platforms are supported. The #PlatformSupported() function lets you query platform support. - ${note(ul( "This function always succeeds.", "This function may be called before #Init().", @@ -1178,29 +1174,6 @@ val GLFW = "GLFW".nativeClass(Module.GLFW, prefix = "GLFW", binding = GLFW_BINDI since = "version 3.0" ) - intb( - "PlatformSupported", - """ - Returns whether the library includes support for the specified platform. - - This function returns whether the library was compiled with support for the specified platform. - - This function may be called before #Init(). - - This function may be called from any thread. - """, - - int("platform", "the platform to query", "#PLATFORM_WIN32 #PLATFORM_COCOA #PLATFORM_WAYLAND #PLATFORM_X11 #PLATFORM_NULL"), - - returnDoc = - """ - #TRUE if the platform is supported, or #FALSE otherwise. - - Possible errors include #INVALID_ENUM. - """, - since = "version 3.4" - ) - GLFWmonitor.p.p( "GetMonitors", """