From a28e17aa31e773a9d675a1a244da3a3c891bba7c Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 15:10:26 +0200 Subject: [PATCH 01/13] fixing CI not being trigger from automatic pull requests --- .github/workflows/fetch_dependencies.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fetch_dependencies.yml b/.github/workflows/fetch_dependencies.yml index dc102c2..2514f27 100644 --- a/.github/workflows/fetch_dependencies.yml +++ b/.github/workflows/fetch_dependencies.yml @@ -6,6 +6,7 @@ on: - cron: '0 0 * * 0' # Runs weekly jobs: + workflow_dispatch: update-dependencies: runs-on: ubuntu-latest From 15f2649562b723dae09225d4a153f0287de6e56f Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 15:11:24 +0200 Subject: [PATCH 02/13] fixing deps fetching CI --- .github/workflows/fetch_dependencies.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/fetch_dependencies.yml b/.github/workflows/fetch_dependencies.yml index 2514f27..dc102c2 100644 --- a/.github/workflows/fetch_dependencies.yml +++ b/.github/workflows/fetch_dependencies.yml @@ -6,7 +6,6 @@ on: - cron: '0 0 * * 0' # Runs weekly jobs: - workflow_dispatch: update-dependencies: runs-on: ubuntu-latest From e5b555dbc3e6da82b6a1c79f3d28a79645d6783c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 13:21:43 +0000 Subject: [PATCH 03/13] Bump NcStudios/VulkanCI from 1.0 to 1.2 Bumps [NcStudios/VulkanCI](https://github.com/ncstudios/vulkanci) from 1.0 to 1.2. - [Release notes](https://github.com/ncstudios/vulkanci/releases) - [Commits](https://github.com/ncstudios/vulkanci/compare/v1.0...v1.2) --- updated-dependencies: - dependency-name: NcStudios/VulkanCI dependency-version: '1.2' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ee360f2..76cc7c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - uses: NcStudios/VulkanCI@v1.0 + - uses: NcStudios/VulkanCI@v1.2 - name: Install system dependencies run: | From cbf185e6c5d3d24af066aaf1309cb02fc07eb1be Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 15:32:55 +0200 Subject: [PATCH 04/13] fixing fetching deps CI --- .github/workflows/fetch_dependencies.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/fetch_dependencies.yml b/.github/workflows/fetch_dependencies.yml index dc102c2..2687b7d 100644 --- a/.github/workflows/fetch_dependencies.yml +++ b/.github/workflows/fetch_dependencies.yml @@ -18,6 +18,8 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v6 + env: + GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }} with: title: update dependencies commit-message: "[BOT] update dependencies" From 31cbdec371e96de5f8299b62d0b7c5dc80d01474 Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 15:38:12 +0200 Subject: [PATCH 05/13] fixing fetching deps CI --- .github/workflows/fetch_dependencies.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fetch_dependencies.yml b/.github/workflows/fetch_dependencies.yml index 2687b7d..5855c4a 100644 --- a/.github/workflows/fetch_dependencies.yml +++ b/.github/workflows/fetch_dependencies.yml @@ -18,15 +18,17 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v6 - env: - GITHUB_TOKEN: ${{ secrets.REPO_SCOPED_TOKEN }} with: + token: ${{ secrets.REPO_SCOPED_TOKEN }} + delete-branch: true title: update dependencies commit-message: "[BOT] update dependencies" committer: GitHub author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> signoff: false base: indev + assignees: Kbz-8 + reviewers: Kbz-8 branch: auto_deps_updates labels: | automated From c62168b0e2e3a0aa638c1c9135e6e28e2101c6ea Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 15:58:19 +0200 Subject: [PATCH 06/13] fixing fetching deps CI --- .github/workflows/fetch_dependencies.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/fetch_dependencies.yml b/.github/workflows/fetch_dependencies.yml index 5855c4a..40f7507 100644 --- a/.github/workflows/fetch_dependencies.yml +++ b/.github/workflows/fetch_dependencies.yml @@ -28,7 +28,6 @@ jobs: signoff: false base: indev assignees: Kbz-8 - reviewers: Kbz-8 branch: auto_deps_updates labels: | automated From 22fb83fee1aa2e374e54bb5e08ff0922ecce2bd3 Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 16:12:14 +0200 Subject: [PATCH 07/13] fixing fetching deps CI --- .github/workflows/fetch_dependencies.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/fetch_dependencies.yml b/.github/workflows/fetch_dependencies.yml index 40f7507..5855c4a 100644 --- a/.github/workflows/fetch_dependencies.yml +++ b/.github/workflows/fetch_dependencies.yml @@ -28,6 +28,7 @@ jobs: signoff: false base: indev assignees: Kbz-8 + reviewers: Kbz-8 branch: auto_deps_updates labels: | automated From c5026d93dce04f9110d215ce01d343da5cacf972 Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 16:15:12 +0200 Subject: [PATCH 08/13] fixing fetching deps CI --- .github/workflows/fetch_dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fetch_dependencies.yml b/.github/workflows/fetch_dependencies.yml index 5855c4a..6514d3e 100644 --- a/.github/workflows/fetch_dependencies.yml +++ b/.github/workflows/fetch_dependencies.yml @@ -23,7 +23,7 @@ jobs: delete-branch: true title: update dependencies commit-message: "[BOT] update dependencies" - committer: GitHub + committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> signoff: false base: indev From c99cf6319489247970388dcebb298fd256d354c3 Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 16:18:56 +0200 Subject: [PATCH 09/13] fixing fetching deps CI --- .github/workflows/fetch_dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fetch_dependencies.yml b/.github/workflows/fetch_dependencies.yml index 6514d3e..84662e0 100644 --- a/.github/workflows/fetch_dependencies.yml +++ b/.github/workflows/fetch_dependencies.yml @@ -24,7 +24,7 @@ jobs: title: update dependencies commit-message: "[BOT] update dependencies" committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> - author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> signoff: false base: indev assignees: Kbz-8 From 7c35354c445f2d3c41f51dbee99907e2f12bd729 Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 16:19:36 +0200 Subject: [PATCH 10/13] fixing fetching deps CI --- .github/workflows/fetch_dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fetch_dependencies.yml b/.github/workflows/fetch_dependencies.yml index 84662e0..9b6101e 100644 --- a/.github/workflows/fetch_dependencies.yml +++ b/.github/workflows/fetch_dependencies.yml @@ -17,7 +17,7 @@ jobs: run: cd scripts && bash ./fetch_dependencies.sh - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.REPO_SCOPED_TOKEN }} delete-branch: true From 1835db094389b499e3cd61884102d2247d52f55f Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 16:23:40 +0200 Subject: [PATCH 11/13] fixing fetching deps CI --- .github/workflows/fetch_dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fetch_dependencies.yml b/.github/workflows/fetch_dependencies.yml index 9b6101e..d9efdb1 100644 --- a/.github/workflows/fetch_dependencies.yml +++ b/.github/workflows/fetch_dependencies.yml @@ -24,7 +24,7 @@ jobs: title: update dependencies commit-message: "[BOT] update dependencies" committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> - author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> + author: kbJeff-8 signoff: false base: indev assignees: Kbz-8 From 9c4aaea79ffeffdd84b0ab7d4c32b87bc192436b Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 17:02:33 +0200 Subject: [PATCH 12/13] removing now useless image optimisation flag --- Makefile | 5 ----- README.md | 3 --- XMAKE_BUILD.md | 3 --- compile_flags.txt | 1 - includes/mlx.h | 18 +----------------- includes/mlx_extended.h | 18 +----------------- runtime/Sources/Renderer/Image.cpp | 8 +------- xmake.lua | 7 ------- 8 files changed, 3 insertions(+), 60 deletions(-) diff --git a/Makefile b/Makefile index 4d974cc..1770e0b 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ MAKE = make --no-print-directory OS ?= $(shell uname -s) DEBUG ?= false TOOLCHAIN ?= clang -IMAGES_OPTIMIZED ?= true FORCE_INTEGRATED_GPU ?= false GRAPHICS_MEMORY_DUMP ?= false PROFILER ?= false @@ -69,10 +68,6 @@ ifeq ($(FORCE_INTEGRATED_GPU), true) _ENABLEDFLAGS += FORCE_INTEGRATED_GPU endif -ifeq ($(IMAGES_OPTIMIZED), true) - _ENABLEDFLAGS += IMAGE_OPTIMIZED -endif - ifeq ($(GRAPHICS_MEMORY_DUMP), true) _ENABLEDFLAGS += GRAPHICS_MEMORY_DUMP endif diff --git a/README.md b/README.md index 63f0097..ce236ec 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,6 @@ MacroLibX has a strong safety support, mainly by checking every pointer that you ### 🛠️ Set the toolchain If you want to use `GCC` to build the mlx you can use `make TOOLCHAIN=gcc` -### ⚠️⚠️⚠️ 🖼️ Image optimisations ⚠️⚠️⚠️ -If you run into glitches when writing or reading pixels from images you can turn off images optimisations by using `make IMAGES_OPTIMIZED=false`. - ### 🖥️ Force the integrated GPU (not recommended) You can force the mlx to use your integrated GPU by using `make FORCE_INTEGRATED_GPU=true`. Note that there are a lot of chances that your application crashes by using that. diff --git a/XMAKE_BUILD.md b/XMAKE_BUILD.md index 4f3c0e8..9ff249b 100644 --- a/XMAKE_BUILD.md +++ b/XMAKE_BUILD.md @@ -16,9 +16,6 @@ MacroLibX has a strong safety support, mainly by checking every pointer that you ### 🛠️ Set the toolchain To change the compilation toolchain you can use `xmake config --toolchain=[gcc|clang|...]` -### ⚠️⚠️⚠️ 🖼️ Image optimisations ⚠️⚠️⚠️ -If you run into glitches when writing or reading pixels from images you can turn off images optimisations by using `xmake config --images_optimized=n`. - ### 🖥️ Force the integrated GPU (not recommended) You can force the mlx to use your integrated GPU using `xmake config --force_integrated_gpu=y`. Note that there are a lot of chances that your application crashes by using that. diff --git a/compile_flags.txt b/compile_flags.txt index 00cbbea..4bb4be0 100644 --- a/compile_flags.txt +++ b/compile_flags.txt @@ -7,6 +7,5 @@ -DMLX_BUILD -DSDL_MAIN_HANDLED -DDEBUG --DIMAGE_OPTIMIZED -D_REENTRANT -isystem/usr/include/SDL2 diff --git a/includes/mlx.h b/includes/mlx.h index abc9adb..a64f0d4 100644 --- a/includes/mlx.h +++ b/includes/mlx.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */ -/* Updated: 2025/03/12 22:26:32 by maldavid ### ########.fr */ +/* Updated: 2025/10/22 16:59:21 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -361,14 +361,6 @@ MLX_API void mlx_destroy_image(mlx_context mlx, mlx_image image); * @param y Y coordinate in the image * * @return (int) Return the pixel data - * - * /!\ If you run into glitches when writing or reading pixels from images /!\ - * You need to add IMAGES_OPTIMIZED=false to your make mlx command - * ``` - * ~ git clone https://github.com/seekrs/MacroLibX.git - * ~ cd MacroLibX - * ~ make IMAGES_OPTIMIZED=false - * ``` */ MLX_API mlx_color mlx_get_image_pixel(mlx_context mlx, mlx_image image, int x, int y); @@ -380,14 +372,6 @@ MLX_API mlx_color mlx_get_image_pixel(mlx_context mlx, mlx_image image, int x, i * @param x X coordinate in the image * @param y Y coordinate in the image * @param color Color of the pixel to set - * - * /!\ If you run into glitches when writing or reading pixels from images /!\ - * You need to add IMAGES_OPTIMIZED=false to your make mlx command - * ``` - * ~ git clone https://github.com/seekrs/MacroLibX.git - * ~ cd MacroLibX - * ~ make IMAGES_OPTIMIZED=false - * ``` */ MLX_API void mlx_set_image_pixel(mlx_context mlx, mlx_image image, int x, int y, mlx_color color); diff --git a/includes/mlx_extended.h b/includes/mlx_extended.h index 5041d29..d668104 100644 --- a/includes/mlx_extended.h +++ b/includes/mlx_extended.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/12/14 16:17:10 by maldavid #+# #+# */ -/* Updated: 2025/03/12 22:03:45 by maldavid ### ########.fr */ +/* Updated: 2025/10/22 16:59:38 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -122,14 +122,6 @@ MLX_API void mlx_pixel_put_region(mlx_context mlx, mlx_window win, int x, int y, * * Note: it is responsability of the user to make sure the size of `dst` is * big enough for the given region. - * - * /!\ If you run into glitches when writing or reading pixels from images /!\ - * You need to add IMAGES_OPTIMIZED=false to your make mlx command - * ``` - * ~ git clone https://github.com/seekrs/MacroLibX.git - * ~ cd MacroLibX - * ~ make IMAGES_OPTIMIZED=false - * ``` */ MLX_API void mlx_get_image_region(mlx_context mlx, mlx_image image, int x, int y, int w, int h, mlx_color* dst); @@ -146,14 +138,6 @@ MLX_API void mlx_get_image_region(mlx_context mlx, mlx_image image, int x, int y * * Note: it is responsability of the user to make sure the size of `pixels` is * big enough for the given region. - * - * /!\ If you run into glitches when writing or reading pixels from images /!\ - * You need to add IMAGES_OPTIMIZED=false to your make mlx command - * ``` - * ~ git clone https://github.com/seekrs/MacroLibX.git - * ~ cd MacroLibX - * ~ make IMAGES_OPTIMIZED=false - * ``` */ MLX_API void mlx_set_image_region(mlx_context mlx, mlx_image image, int x, int y, int w, int h, mlx_color* pixels); diff --git a/runtime/Sources/Renderer/Image.cpp b/runtime/Sources/Renderer/Image.cpp index 0aa37b2..10859f7 100644 --- a/runtime/Sources/Renderer/Image.cpp +++ b/runtime/Sources/Renderer/Image.cpp @@ -22,12 +22,6 @@ #include #endif -#ifdef IMAGE_OPTIMIZED - #define TILING VK_IMAGE_TILING_OPTIMAL -#else - #define TILING VK_IMAGE_TILING_LINEAR -#endif - namespace mlx { mlx_color ReverseColor(mlx_color color) @@ -186,7 +180,7 @@ namespace mlx void Texture::Init(CPUBuffer pixels, std::uint32_t width, std::uint32_t height, VkFormat format, bool is_multisampled, [[maybe_unused]] std::string_view debug_name) { MLX_PROFILE_FUNCTION(); - Image::Init(ImageType::Color, width, height, format, TILING, VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, is_multisampled, std::move(debug_name)); + Image::Init(ImageType::Color, width, height, format, VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, is_multisampled, std::move(debug_name)); Image::CreateImageView(VK_IMAGE_VIEW_TYPE_2D, VK_IMAGE_ASPECT_COLOR_BIT); Image::CreateSampler(); if(pixels) diff --git a/xmake.lua b/xmake.lua index f7445a4..b56789e 100644 --- a/xmake.lua +++ b/xmake.lua @@ -11,12 +11,6 @@ set_targetdir("./") set_optimize("fastest") -- Options - -option("images_optimized") - set_default(true) - add_defines("IMAGE_OPTIMIZED") -option_end() - option("force_integrated_gpu") set_default(false) add_defines("FORCE_INTEGRATED_GPU") @@ -48,7 +42,6 @@ target("mlx") set_default(true) set_license("MIT") set_kind("shared") - add_options("images_optimized") add_options("force_integrated_gpu") add_options("graphics_memory_dump") add_options("profiler") From 493696482cc17b47aa9bbe9543e96f9b6c995b74 Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 22 Oct 2025 17:07:33 +0200 Subject: [PATCH 13/13] fixing small mistakes --- XMAKE_BUILD.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMAKE_BUILD.md b/XMAKE_BUILD.md index 9ff249b..0bfd5a6 100644 --- a/XMAKE_BUILD.md +++ b/XMAKE_BUILD.md @@ -23,7 +23,7 @@ You can force the mlx to use your integrated GPU using `xmake config --force_int The mlx can dump it's graphics memory use to json files every two seconds by enabling this option `xmake config --graphics_memory_dump=y`. ### 🪛 A possible build configuration -As a configuration example here's how the command can look like `xmake config --mode=debug --toolchain=clang --graphics_memory_dump=y --images_optimized=n` +As a configuration example here's how the command can look like `xmake config --mode=debug --toolchain=clang --graphics_memory_dump=y` ## 🚧 Build the lib