8 Commits

Author SHA1 Message Date
kbJeff-8
55eb31551a [BOT] update dependencies 2026-01-28 09:41:08 +01:00
dependabot[bot]
7741ed2dd4 Bump actions/setup-python from 5 to 6
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-28 09:41:08 +01:00
b09f5c39f7 fixes: windows x86 compilation error missing VKAPI_PTR (#197)
This pr fixes windows x86 compilation error (xmake and meson.build).

In runtime/Sources/Renderer/RenderCore.cpp 
```cpp
void* VKAPI_PTR VulkanAllocationFunction(void*, std::size_t size, std::size_t alignment, VkSystemAllocationScope)
	{
		return MemManager::AlignedMalloc(alignment, size);
	}

	void* VKAPI_PTR VulkanReallocationFunction(void*, void* ptr, std::size_t size, std::size_t alignment, VkSystemAllocationScope)
	{
		return MemManager::AlignedRealloc(ptr, alignment, size);
	}

	void VKAPI_PTR VulkanFreeFunction(void*, void* ptr)
	{
		MemManager::Free(ptr);
	}
```
The log of the compilation error:  
- [meson failure
log](https://github.com/0verLighT/MacroLibX/actions/runs/21409805574/job/61643508435)
- [xmake failure
log](https://github.com/0verLighT/MacroLibX/actions/runs/21412208397/job/61651747515)

In the macrolibx VKAPI_PTR was missing, On windows x86, this caused a
compilation error.


This add some features:
- New CICD for windows meson (x64, x86, MYSYS2, clang-cl) and windows
xmake x86
- Fallback for meson.build dependency SDL2 in `subprojects/SDL2.wrap`
2026-01-28 07:17:01 +01:00
0verLighT
91b93a6f10 ci(xmake): add test on x86 architecture due to a Vulkan issue (VKAPI_PTR)
Signed-off-by: 0verLighT <alexandre@0verlight.com>
2026-01-27 21:07:41 +01:00
0verLighT
26c47c3a95 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 <alexandre@0verlight.com>
2026-01-27 20:47:11 +01:00
0verLighT
28142f764f 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 <alexandre@0verlight.com>
2026-01-27 19:47:30 +01:00
26ccd5eeee Few doc fixes (#194)
Also, the doc says `@param img` but declaration has `mlx_image image`
which is a mismatch, I’m not sure what to do here, so I’m leaving it
untouched.

[This page](https://macrolibx.kbz8.me/guides/text/) of the docs should
be updated too as `mlx_set_font` and `mlx_set_font_scale` don't take a
`mlx_window` anymore.
2026-01-20 19:48:15 +01:00
Luna Mira Lage
849ecbaf1f Few doc fixes 2026-01-20 18:50:29 +01:00
14 changed files with 159 additions and 31 deletions

View File

@@ -30,7 +30,7 @@ jobs:
sudo apt-get -y install mesa-common-dev clang libsdl2-2.0-0 libsdl2-dev build-essential libvulkan-dev
- name: Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

View File

@@ -29,7 +29,7 @@ jobs:
brew install SDL2
- name: Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'

View File

@@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
arch: [x64]
arch: [x64, x86]
mode: [release]
runs-on: ${{ matrix.os }}

109
.github/workflows/windows_meson.yml vendored git.filemode.normal_file
View File

@@ -0,0 +1,109 @@
name : Windows (Meson)
on:
repository_dispatch:
types: [create-pull-request]
pull_request:
push:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README.md'
jobs:
VisualStudio:
if: "!contains(github.event.head_commit.message, 'ci skip')"
runs-on: windows-latest
strategy:
fail-fast: false
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
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

2
.gitignore vendored
View File

@@ -23,3 +23,5 @@
objs/
build/
example/Test
subprojects/*/
subprojects/.wraplock

View File

@@ -338,7 +338,7 @@ MLX_API mlx_image mlx_new_image(mlx_context mlx, int width, int height);
* @param mlx Internal MLX application
* @param filename Path to the png file
* @param width Get the width of the image
* @param heigth Get the height of the image
* @param height Get the height of the image
*
* @return (mlx_image) An opaque handler to the internal image or MLX_NULL_HANDLE (0x0) in case of error
*/
@@ -407,7 +407,6 @@ MLX_API void mlx_string_put(mlx_context mlx, mlx_window win, int x, int y, mlx_c
* @brief Loads a font to be used by `mlx_string_put`
*
* @param mlx Internal MLX application
* @param win Internal window
* @param filepath Filepath to the font or "default" to reset to the embedded font
*/
MLX_API void mlx_set_font(mlx_context mlx, char* filepath);
@@ -416,7 +415,6 @@ MLX_API void mlx_set_font(mlx_context mlx, char* filepath);
* @brief Loads a font to be used by `mlx_string_put` and scales it
*
* @param mlx Internal MLX application
* @param win Internal window
* @param filepath Filepath to the font or "default" to reset to the embedded font
* @param scale Scale to apply to the font
*/

View File

@@ -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);
}

15
subprojects/sdl2.wrap git.filemode.normal_file
View File

@@ -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

View File

@@ -57,7 +57,7 @@ extern "C" __declspec( dllimport ) FARPROC __stdcall GetProcAddress( HINSTANCE h
# endif
#endif
VULKAN_HPP_STATIC_ASSERT( VK_HEADER_VERSION == 338, "Wrong VK_HEADER_VERSION!" );
VULKAN_HPP_STATIC_ASSERT( VK_HEADER_VERSION == 339, "Wrong VK_HEADER_VERSION!" );
// <tuple> includes <sys/sysmacros.h> through some other header
// this results in major(x) being resolved to gnu_dev_major(x)

View File

@@ -66,7 +66,7 @@ extern "C" {
//#define VK_API_VERSION VK_MAKE_API_VERSION(0, 1, 0, 0) // Patch version should always be set to 0
// Version of this file
#define VK_HEADER_VERSION 338
#define VK_HEADER_VERSION 339
// Complete version of this file
#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 4, VK_HEADER_VERSION)
@@ -15367,10 +15367,10 @@ typedef struct VkDebugUtilsMessengerCallbackDataEXT {
} VkDebugUtilsMessengerCallbackDataEXT;
typedef VkBool32 (VKAPI_PTR *PFN_vkDebugUtilsMessengerCallbackEXT)(
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageTypes,
const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
void* pUserData);
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageTypes,
const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
void* pUserData);
typedef struct VkDebugUtilsMessengerCreateInfoEXT {
VkStructureType sType;
@@ -19758,11 +19758,11 @@ typedef struct VkPipelineColorWriteCreateInfoEXT {
const VkBool32* pColorWriteEnables;
} VkPipelineColorWriteCreateInfoEXT;
typedef void (VKAPI_PTR *PFN_vkCmdSetColorWriteEnableEXT)(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkBool32* pColorWriteEnables);
typedef void (VKAPI_PTR *PFN_vkCmdSetColorWriteEnableEXT)(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkBool32* pColorWriteEnables);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdSetColorWriteEnableEXT(
VKAPI_ATTR void VKAPI_CALL vkCmdSetColorWriteEnableEXT(
VkCommandBuffer commandBuffer,
uint32_t attachmentCount,
const VkBool32* pColorWriteEnables);
@@ -21230,7 +21230,8 @@ typedef enum VkDirectDriverLoadingModeLUNARG {
} VkDirectDriverLoadingModeLUNARG;
typedef VkFlags VkDirectDriverLoadingFlagsLUNARG;
typedef PFN_vkVoidFunction (VKAPI_PTR *PFN_vkGetInstanceProcAddrLUNARG)(
VkInstance instance, const char* pName);
VkInstance instance,
const char* pName);
typedef struct VkDirectDriverLoadingInfoLUNARG {
VkStructureType sType;

View File

@@ -1772,7 +1772,10 @@ namespace VULKAN_HPP_NAMESPACE
"VK_KHR_get_physical_device_properties2",
"VK_KHR_swapchain",
} } },
{ "VK_VERSION_1_1", { {} } } } },
{ "VK_VERSION_1_1",
{ {
"VK_KHR_swapchain",
} } } } },
{ "VK_EXT_private_data",
{ { "VK_VERSION_1_0",
{ {

View File

@@ -2568,7 +2568,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( d.vkAllocateCommandBuffers && "Function <vkAllocateCommandBuffers> requires <VK_VERSION_1_0>" );
# endif
std::vector<CommandBuffer, CommandBufferAllocator> commandBuffers( allocateInfo.commandBufferCount, commandBufferAllocator );
std::vector<CommandBuffer, CommandBufferAllocator> commandBuffers( allocateInfo.commandBufferCount, {}, commandBufferAllocator );
Result result = static_cast<Result>( d.vkAllocateCommandBuffers(
m_device, reinterpret_cast<const VkCommandBufferAllocateInfo *>( &allocateInfo ), reinterpret_cast<VkCommandBuffer *>( commandBuffers.data() ) ) );
detail::resultCheck( result, VULKAN_HPP_NAMESPACE_STRING "::Device::allocateCommandBuffers" );
@@ -3796,7 +3796,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( d.vkCreateComputePipelines && "Function <vkCreateComputePipelines> requires <VK_VERSION_1_0>" );
# endif
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), pipelineAllocator );
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), {}, pipelineAllocator );
Result result = static_cast<Result>( d.vkCreateComputePipelines( m_device,
static_cast<VkPipelineCache>( pipelineCache ),
createInfos.size(),
@@ -4503,7 +4503,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( d.vkAllocateDescriptorSets && "Function <vkAllocateDescriptorSets> requires <VK_VERSION_1_0>" );
# endif
std::vector<DescriptorSet, DescriptorSetAllocator> descriptorSets( allocateInfo.descriptorSetCount, descriptorSetAllocator );
std::vector<DescriptorSet, DescriptorSetAllocator> descriptorSets( allocateInfo.descriptorSetCount, {}, descriptorSetAllocator );
Result result = static_cast<Result>( d.vkAllocateDescriptorSets(
m_device, reinterpret_cast<const VkDescriptorSetAllocateInfo *>( &allocateInfo ), reinterpret_cast<VkDescriptorSet *>( descriptorSets.data() ) ) );
detail::resultCheck( result, VULKAN_HPP_NAMESPACE_STRING "::Device::allocateDescriptorSets" );
@@ -4970,7 +4970,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( d.vkCreateGraphicsPipelines && "Function <vkCreateGraphicsPipelines> requires <VK_VERSION_1_0>" );
# endif
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), pipelineAllocator );
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), {}, pipelineAllocator );
Result result = static_cast<Result>( d.vkCreateGraphicsPipelines( m_device,
static_cast<VkPipelineCache>( pipelineCache ),
createInfos.size(),
@@ -10401,7 +10401,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( d.vkCreateSharedSwapchainsKHR && "Function <vkCreateSharedSwapchainsKHR> requires <VK_KHR_display_swapchain>" );
# endif
std::vector<SwapchainKHR, SwapchainKHRAllocator> swapchains( createInfos.size(), swapchainKHRAllocator );
std::vector<SwapchainKHR, SwapchainKHRAllocator> swapchains( createInfos.size(), {}, swapchainKHRAllocator );
Result result = static_cast<Result>( d.vkCreateSharedSwapchainsKHR( m_device,
createInfos.size(),
reinterpret_cast<const VkSwapchainCreateInfoKHR *>( createInfos.data() ),
@@ -16677,7 +16677,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( d.vkCreateExecutionGraphPipelinesAMDX && "Function <vkCreateExecutionGraphPipelinesAMDX> requires <VK_AMDX_shader_enqueue>" );
# endif
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), pipelineAllocator );
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), {}, pipelineAllocator );
Result result =
static_cast<Result>( d.vkCreateExecutionGraphPipelinesAMDX( m_device,
static_cast<VkPipelineCache>( pipelineCache ),
@@ -18123,7 +18123,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( d.vkCreateRayTracingPipelinesKHR && "Function <vkCreateRayTracingPipelinesKHR> requires <VK_KHR_ray_tracing_pipeline>" );
# endif
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), pipelineAllocator );
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), {}, pipelineAllocator );
Result result = static_cast<Result>( d.vkCreateRayTracingPipelinesKHR( m_device,
static_cast<VkDeferredOperationKHR>( deferredOperation ),
static_cast<VkPipelineCache>( pipelineCache ),
@@ -19376,7 +19376,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( d.vkCreateRayTracingPipelinesNV && "Function <vkCreateRayTracingPipelinesNV> requires <VK_NV_ray_tracing>" );
# endif
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), pipelineAllocator );
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), {}, pipelineAllocator );
Result result = static_cast<Result>( d.vkCreateRayTracingPipelinesNV( m_device,
static_cast<VkPipelineCache>( pipelineCache ),
createInfos.size(),
@@ -28408,7 +28408,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( d.vkCreateShadersEXT && "Function <vkCreateShadersEXT> requires <VK_EXT_shader_object>" );
# endif
std::vector<ShaderEXT, ShaderEXTAllocator> shaders( createInfos.size(), shaderEXTAllocator );
std::vector<ShaderEXT, ShaderEXTAllocator> shaders( createInfos.size(), {}, shaderEXTAllocator );
Result result = static_cast<Result>( d.vkCreateShadersEXT( m_device,
createInfos.size(),
reinterpret_cast<const VkShaderCreateInfoEXT *>( createInfos.data() ),
@@ -29832,7 +29832,7 @@ namespace VULKAN_HPP_NAMESPACE
VULKAN_HPP_ASSERT( d.vkCreateDataGraphPipelinesARM && "Function <vkCreateDataGraphPipelinesARM> requires <VK_ARM_data_graph>" );
# endif
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), pipelineAllocator );
std::vector<Pipeline, PipelineAllocator> pipelines( createInfos.size(), {}, pipelineAllocator );
Result result = static_cast<Result>( d.vkCreateDataGraphPipelinesARM( m_device,
static_cast<VkDeferredOperationKHR>( deferredOperation ),
static_cast<VkPipelineCache>( pipelineCache ),

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2025 The Khronos Group Inc.
// Copyright 2021-2026 The Khronos Group Inc.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//

View File

@@ -1,4 +1,4 @@
// Copyright 2021-2025 The Khronos Group Inc.
// Copyright 2021-2026 The Khronos Group Inc.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//