3674 Commits

Author SHA1 Message Date
Bill Hollings
f79c6c5690 Merge pull request #2681 from squidbus/fix-prim-res
Fix desync in primitive restart enable state tracking.
2026-01-07 14:48:55 -05:00
squidbus
256fb280b5 Fix desync in primitive restart enable state tracking. 2025-12-30 15:47:14 -08:00
Bill Hollings
bf60f60d08 Merge pull request #2673 from billhollings/update-version
Update version to 1.4.2.
2025-12-13 12:31:30 -05:00
Bill Hollings
9b11b2aad4 Update version to 1.4.2.
- Update to latest SPIRV-Cross.
- Add top CMake file to Xcode projects to support editing versions in future.
- Update documentation.
2025-12-13 08:11:24 -05:00
Bill Hollings
d6d49e0311 Merge pull request #2667 from osy/main
Fix buffer and heap out-of-sync in initExternalMemory()
2025-12-12 17:14:32 -05:00
Bill Hollings
2c3f25db9b Merge pull request #2670 from osy/submit/semaphore-fd
Introduce KHR_external_semaphore_fd only for FD==-1
2025-12-12 16:59:27 -05:00
Bill Hollings
4055c6059e Merge pull request #2669 from osy/submit/fix-getmtltexture
Fix incorrect variable usage in `MVKImagePlane::getMTLTexture()`
2025-12-12 16:50:17 -05:00
osy
2f1358e291 Introduce KHR_external_semaphore_fd only for FD==-1
There is a special use case for when importing/exporting a semaphore of
handle type `VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT` and FD == -1.
According to the Vulkan specs, calling `vkImportSemaphoreFdKHR` has the
effect of signaling the binary semaphore and calling `vkGetSemaphoreFdKHR`
has the effect of waiting on the binary semaphore.

Outside of KHR_external_semaphore_fd extension, there is no other way to
achieve this behaviour. For example, `vkWaitSemaphores` does not operate
on a binary semaphore and there is no other defined way for a CPU to send
a signal operation.

In theory, we can use EXT_metal_objects and export the VkSemaphore to a
`MTLSharedEvent` but we do not have access to the `MVKSemaphoreMTLEvent` in
order to determine the `_mtlEventValue` (last encoded wait value).

This functionality is required to implement Venus on macOS which uses these
functions to synchronize the guest semaphore state to the host.
2025-12-01 08:36:43 -08:00
osy
d748ad77cc Fix incorrect varable usage in MVKImagePlane::getMTLTexture()
`_mtlTexture` can still be nil at this point which means that we may
have a memoryless texture attempt to get added to the residency set.
2025-12-01 00:53:49 -08:00
osy
8961682137 Fix buffer and heap out-of-sync in initExternalMemory()
If a buffer is created before a heap in MVKDeviceMemory, the buffer would
be used in some places (for example `MVKDeviceMemory::map` and the heap
would be used in other places (for example `MVKBuffer::getMTLBuffer()`).
This leads to inconsistent memory mappings.

Specifically, there are two cases when this happens:
1. When `vkAllocateMemory` is called with an imported buffer.
2. When `vkAllocateMemory` expects `HANDLE_TYPE_MTLBUFFER` to be exported.

In either case, `ensureMTLBuffer()` gets called before `ensureMTLHeap()`
which sets `_mtlBuffer` to a buffer not allocated from the placement heap.

This change fixes this by making sure that if a placement heap is needed,
we will always create it prior to allocating the buffer. In cases where
the heap is not used at all (imported buffer), we will return error if the
user tries to specify a `HANDLE_TYPE_MTLHEAP` for export.
2025-11-26 14:56:10 -08:00
Bill Hollings
db445ff204 Merge pull request #2666 from billhollings/rel-1.4.1
Update for release 1.4.1.
v1.4.1-rc1 v1.4.1
2025-11-25 21:37:32 +08:00
Bill Hollings
7d19906778 Update for release 1.4.1.
- Update to latest dependencies.
- Update VkConformanceVersion to 1.4.4.0.
- Update Whats_New.md.
2025-11-25 10:00:10 +08:00
Bill Hollings
5829bd5921 Merge pull request #2662 from squidbus/fix-cmake
Fix CMake failing to fetch dependencies that have changed.
2025-11-22 09:40:15 -05:00
squidbus
f168dec059 Fix CMake failing to fetch dependencies that have changed. 2025-11-08 11:14:49 -08:00
Bill Hollings
19643ad126 Merge pull request #2661 from squidbus/fix-align
Fix vertexStrideAlignment value without Apple5
2025-10-30 20:47:26 -04:00
squidbus
27d6ddc072 Fix vertexStrideAlignment value without Apple5 2025-10-30 17:05:33 -07:00
Bill Hollings
df8454215c Merge pull request #2659 from etang-cw/PipelineBoundsCheck
Bounds check pipeline bind ops
2025-10-30 20:00:19 -04:00
Evan Tang
39f1f639fe Add debug asserts on resource bind functions 2025-10-30 12:00:29 -05:00
Evan Tang
2b52573393 Bounds check pipeline bind ops
Not correct but at least won't crash
2025-10-30 11:46:43 -05:00
Bill Hollings
c2e5c5ecea Merge pull request #2657 from squidbus/maintenance9
Add support for VK_KHR_maintenance9.
2025-10-23 22:12:56 -04:00
Bill Hollings
66c01f69e9 Merge pull request #2656 from squidbus/promotions
Promote VK_EXT_swapchain_maintenance1 and VK_EXT_surface_maintenace1 to KHR.
2025-10-23 16:42:08 -04:00
squidbus
55ba58d79a Add support for VK_KHR_maintenance9. 2025-10-22 23:23:11 -07:00
squidbus
36f9320c4c Promote VK_EXT_swapchain_maintenance1 and VK_EXT_surface_maintenace1 to KHR. 2025-10-22 19:39:14 -07:00
Bill Hollings
b23d425346 Merge pull request #2653 from squidbus/depex
Add CMake options for dependency exclusions.
2025-10-22 21:55:19 -04:00
squidbus
8f1fabee51 Add CMake options for dependency exclusions. 2025-10-22 17:18:07 -07:00
Bill Hollings
1ae2e891e6 Merge pull request #2654 from squidbus/fmakhr
Add support for VK_KHR_shader_fma
2025-10-22 19:59:00 -04:00
Bill Hollings
84f53f1fea Merge pull request #2651 from m154k1/cmake
Misc CMake improvements
2025-10-22 19:39:28 -04:00
squidbus
89b33b3196 Advertise support for VK_KHR_shader_fma 2025-10-22 02:28:41 -07:00
squidbus
be6686858e Update dependencies to latest 2025-10-22 02:28:39 -07:00
m154k1
8f0bb071f6 CMake: Add MVK_BUILD_SHADER_CONVERTER_TOOL option 2025-10-21 11:34:36 +03:00
Bill Hollings
199793e0b4 Merge pull request #2652 from billhollings/update-texture-dims-A10gpu
Update max texture dimensions for Apple10 GPU.
2025-10-20 17:27:49 -04:00
Bill Hollings
15e98177a1 Update max texture dimensions for Apple10 GPU. 2025-10-20 17:04:29 -04:00
m154k1
0e3fdf09e4 CMake: Change pkgconfig install path 2025-10-19 17:03:53 +03:00
m154k1
ed15e45d5e CMake: Install MoltenVK_icd.json 2025-10-19 16:56:04 +03:00
m154k1
69fd695660 CMake: Add MVK_USE_METAL_PRIVATE_API option 2025-10-19 16:27:57 +03:00
Bill Hollings
1ab13c0656 Merge pull request #2513 from zfergus/cmake-build
Download External Dependencies and Build using CMake
2025-10-18 11:35:03 -04:00
Bill Hollings
67aa5c0ab8 Merge pull request #2649 from squidbus/ci-bump
Update minimum CI to macOS 14 and minimum build to Xcode 15.
2025-10-18 11:21:19 -04:00
Bill Hollings
3f82b75438 Merge pull request #2646 from squidbus/nativeswizzle
Remove native swizzle and depth clamp simulator limitations.
2025-10-18 11:14:02 -04:00
squidbus
64580efe74 Remove native swizzle and depth clamp simulator limitations. 2025-10-17 18:41:28 -07:00
squidbus
354a880552 Update minimum CI to macOS 14 and minimum build to Xcode 15. 2025-10-16 17:54:18 -07:00
Bill Hollings
3e1fd32f5f Merge pull request #2643 from squidbus/clean3
Clean up platform preprocessor guards.
2025-10-15 00:06:55 -04:00
Zachary Ferguson
7e1e27297a Bump version to 1.4.1 in CMakeLists.txt 2025-10-14 22:11:33 -04:00
Zachary Ferguson
5bfe3c0352 Add trailing \n to .gitignore 2025-10-14 21:56:56 -04:00
Zachary Ferguson
ac7abedb5e Update CMakeLists.txt
Co-authored-by: Chip Davis <cdavis5x@gmail.com>
2025-10-14 21:49:53 -04:00
Zachary Ferguson
20c22a3146 Update Templates/cmake/MoltenVKOptions.cmake.sample
Co-authored-by: Chip Davis <cdavis5x@gmail.com>
2025-10-14 21:49:19 -04:00
Zachary Ferguson
dbd78119c0 Merge branch 'main' into cmake-build 2025-10-14 21:47:51 -04:00
squidbus
471442ccf5 Add Metal4 and Apple10 GPU family logs. 2025-10-14 04:41:27 -07:00
squidbus
00d26b47a3 Remove obsolete __METAL_VERSION__ guards from utility shader source. 2025-10-14 02:26:15 -07:00
squidbus
987ac1775e Clean up platform preprocessor guards. 2025-10-13 18:01:38 -07:00
Bill Hollings
1aa57dd31e Merge pull request #2644 from squidbus/spirv
Update SPIRV-Cross to latest.
2025-10-13 19:25:54 -04:00