From 28142f764f5ebfdd5dd0c968faeef5a887a6e8ac Mon Sep 17 00:00:00 2001 From: 0verLighT Date: Tue, 27 Jan 2026 19:47:30 +0100 Subject: [PATCH 1/3] ci(windows_meson): test ci setup meson for windows chore: add folder subprojects for download sdl2 if it's not present in pkgconfig Signed-off-by: 0verLighT --- .github/workflows/windows_meson.yml | 41 +++++++++++++++++++++++++++++ .gitignore | 2 ++ subprojects/sdl2.wrap | 15 +++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .github/workflows/windows_meson.yml create mode 100644 subprojects/sdl2.wrap diff --git a/.github/workflows/windows_meson.yml b/.github/workflows/windows_meson.yml new file mode 100644 index 0000000..52e56ba --- /dev/null +++ b/.github/workflows/windows_meson.yml @@ -0,0 +1,41 @@ +name : Windows (Meson) + +on: + repository_dispatch: + types: [create-pull-request] + pull_request: + push: + paths-ignore: + - '.gitignore' + - 'LICENSE' + - 'README.md' + +jobs: + build: + if: "!contains(github.event.head_commit.message, 'ci skip')" + runs-on: windows-latest + strategy: + matrix: + platform: ['x64', 'x86'] + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + # Install a 32-bit Python so building related stuff work. + - name: Setup x86 Python + if: matrix.platform == 'x86' + uses: actions/setup-python@v6 + with: + architecture: 'x86' + python-version: '3.12' + - name: Install Meson & Ninja + run: | + python -m pip install meson ninja + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{matrix.platform}} + - name: Compile mlx + run: | + meson setup builddir + meson compile -C builddir \ No newline at end of file diff --git a/.gitignore b/.gitignore index a55bcdc..ae7bcc3 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ objs/ build/ example/Test +subprojects/*/ +subprojects/.wraplock \ No newline at end of file diff --git a/subprojects/sdl2.wrap b/subprojects/sdl2.wrap new file mode 100644 index 0000000..39031b2 --- /dev/null +++ b/subprojects/sdl2.wrap @@ -0,0 +1,15 @@ +[wrap-file] +directory = SDL2-2.32.8 +source_url = https://github.com/libsdl-org/SDL/releases/download/release-2.32.8/SDL2-2.32.8.tar.gz +source_filename = SDL2-2.32.8.tar.gz +source_hash = 0ca83e9c9b31e18288c7ec811108e58bac1f1bb5ec6577ad386830eac51c787e +patch_filename = sdl2_2.32.8-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/sdl2_2.32.8-1/get_patch +patch_hash = 5df17ea39ca418826db20e96bd821fa52b5718dac64b6225119fb6588c2744f0 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/sdl2_2.32.8-1/SDL2-2.32.8.tar.gz +wrapdb_version = 2.32.8-1 + +[provide] +sdl2 = sdl2_dep +sdl2main = sdl2main_dep +sdl2_test = sdl2_test_dep From 26c47c3a95db821a31b7c315d5f10dd71c70fd17 Mon Sep 17 00:00:00 2001 From: 0verLighT Date: Tue, 27 Jan 2026 20:47:11 +0100 Subject: [PATCH 2/3] fix && ci (meson): trying to fix Vulkan issue in renderCore.cpp and add some windows test based from meson wrapdb CI Signed-off-by: 0verLighT --- .github/workflows/windows_meson.yml | 70 ++++++++++++++++++++++++- runtime/Sources/Renderer/RenderCore.cpp | 6 +-- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows_meson.yml b/.github/workflows/windows_meson.yml index 52e56ba..45cd0c8 100644 --- a/.github/workflows/windows_meson.yml +++ b/.github/workflows/windows_meson.yml @@ -11,10 +11,11 @@ on: - 'README.md' jobs: - build: + VisualStudio: if: "!contains(github.event.head_commit.message, 'ci skip')" runs-on: windows-latest strategy: + fail-fast: false matrix: platform: ['x64', 'x86'] steps: @@ -29,13 +30,80 @@ jobs: with: architecture: 'x86' python-version: '3.12' + - name: Install Meson & Ninja run: | python -m pip install meson ninja - uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{matrix.platform}} + - name: Compile mlx + run: | + meson setup builddir + meson compile -C builddir + + VisualStudio-clang-cl: + if: "!contains(github.event.head_commit.message, 'ci skip')" + runs-on: windows-latest + strategy: + fail-fast: false + env: + CC: clang-cl + CXX: clang-cl + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Install Meson & Ninja + run: | + python -m pip install meson ninja + + - uses: ilammy/msvc-dev-cmd@v1 + + - name: Compile mlx + run: | + meson setup builddir + meson compile -C builddir + + MSYS2: + if: "!contains(github.event.head_commit.message, 'ci skip')" + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + platform: ['UCRT64', 'CLANG64'] + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{matrix.platform}} + install: >- + bison + dos2unix + flex + git + pacboy: >- + cc:p + cmake:p + ninja:p + pkgconf:p + python-certifi:p + python-pip:p + # Make sure Python is updated to >=3.11 (fix https://github.com/msys2/MINGW-packages/issues/17415). + update: true + + - name: Install Meson + shell: msys2 {0} + run: | + python -m pip install meson + + - name: Compile mlx + shell: msys2 {0} run: | meson setup builddir meson compile -C builddir \ No newline at end of file diff --git a/runtime/Sources/Renderer/RenderCore.cpp b/runtime/Sources/Renderer/RenderCore.cpp index 1bbe5f6..9e89fea 100644 --- a/runtime/Sources/Renderer/RenderCore.cpp +++ b/runtime/Sources/Renderer/RenderCore.cpp @@ -55,17 +55,17 @@ namespace mlx std::cout << std::endl; } - void* VulkanAllocationFunction(void*, std::size_t size, std::size_t alignment, VkSystemAllocationScope) + void* VKAPI_PTR VulkanAllocationFunction(void*, std::size_t size, std::size_t alignment, VkSystemAllocationScope) { return MemManager::AlignedMalloc(alignment, size); } - void* VulkanReallocationFunction(void*, void* ptr, std::size_t size, std::size_t alignment, VkSystemAllocationScope) + void* VKAPI_PTR VulkanReallocationFunction(void*, void* ptr, std::size_t size, std::size_t alignment, VkSystemAllocationScope) { return MemManager::AlignedRealloc(ptr, alignment, size); } - void VulkanFreeFunction(void*, void* ptr) + void VKAPI_PTR VulkanFreeFunction(void*, void* ptr) { MemManager::Free(ptr); } From 91b93a6f10360d9d051ca00b35b6ae4cd903f222 Mon Sep 17 00:00:00 2001 From: 0verLighT Date: Tue, 27 Jan 2026 21:07:41 +0100 Subject: [PATCH 3/3] ci(xmake): add test on x86 architecture due to a Vulkan issue (VKAPI_PTR) Signed-off-by: 0verLighT --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2b8ed7d..c8e1f0c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: os: [windows-latest] - arch: [x64] + arch: [x64, x86] mode: [release] runs-on: ${{ matrix.os }}