3111 Commits

Author SHA1 Message Date
Bill Hollings
75fb9493a6
Merge pull request #2222 from aitor-lunarg/main
Allow vertex buffer binding when they are used disregarding implicit buffer index
2024-05-04 15:55:33 -04:00
Bill Hollings
f6fc3030b0
Merge pull request #2224 from SRSaunders/report-idname
Return MoltenVK log level string in pMessageIdName field of debug utils callback data
2024-05-04 15:34:52 -04:00
Bill Hollings
2eea02df56
Update MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h
Renamed _maxVertexInputBindingBufferCount to kMVKMaxVertexInputBindingBufferCount.
2024-05-04 15:33:53 -04:00
Bill Hollings
5649fb3fd3
Update MoltenVK/MoltenVK/GPUObjects/MVKPipeline.h
Renamed _maxVertexInputBindingBufferCount to kMVKMaxVertexInputBindingBufferCount.
2024-05-04 15:33:44 -04:00
Bill Hollings
e0a77df422
Merge pull request #2225 from ulowen/main
Fix memory leak in vkQueueWaitIdle
2024-05-04 15:28:29 -04:00
Bill Hollings
a6a44a78c1
Update MoltenVK/MoltenVK/Utility/MVKBaseObject.h
Use constexpr instead of inline const.
2024-05-04 15:15:39 -04:00
Owen Morgan
9893b3ac25 Fix memory leak in vkQueueWaitIdle
There was a missing autorelease pool. Fixes #2223.
2024-05-03 09:52:53 +01:00
SRSaunders
ac6702a682 Return MoltenVK log level string in pMessageIdName field of debug utils callback data 2024-05-03 00:00:11 -04:00
Bill Hollings
e361c2ae67
Merge pull request #2221 from billhollings/refactor-device-public-content
Refactor public MVKDevice content into MVKDeviceTrackingMixin functions.
2024-05-02 15:14:24 -04:00
Bill Hollings
e1baea9a95 Refactor public MVKDevice content into MVKDeviceTrackingMixin functions.
This is a non-functional code-maintenance change.

Previously, MVKDevice contained a significant amount of publicly exposed
internal content. This patch adds functions to MVKDeviceTrackingMixin to
better encapsulate, consolidate & streamline access to this content.

- Make MVKDeviceTrackingMixin a friend of MVKDevice & MVKPhysicalDevice.
- Hide public MVKDevice content behind MVKDeviceTrackingMixin functions.
- Remove similar MVKDevice content pointers from MVKCommandEncoder.
- MVKDevice remove getPhysicalDevice(), getPixelFormats() & getMTLDevice(),
  to focus access through MVKDeviceTrackingMixin.
- Move performance tracking functions to MVKDeviceTrackingMixin to remove
  need to reference MVKDevice multiple times when marking performance values.
- Subclass MVKQueueSubmission, MVKMetalCompiler, MVKShaderLibrary, and
  MVKShaderLibraryCache from MVKBaseDeviceObject to make use of these changes.
2024-05-02 11:06:28 -04:00
Aitor Camacho
bd24db8553 Allow vertex buffer binding when they are used disregarding implicit index
Due to how MoltenVK decides when a buffer can be bound based on
its requirements for the implicit buffer, if the application uses
all bindings, implicit buffer index will be uint max. This lead
to used buffers not being bound.
2024-05-01 16:26:23 +02:00
Bill Hollings
0d62a427d4
Merge pull request #2217 from billhollings/avoid-managed-mem-on-apple-silicon
On macOS Apple Silicon, avoid managed-memory textures, and resource syncs.
2024-04-30 20:00:26 -04:00
Bill Hollings
607aaff4c1 On macOS Apple Silicon, avoid managed-memory textures, and resource syncs.
Like their iOS/tvOS counterparts, macOS Apple Silicon GPUs support
using Shared memory for textures, and do not require resource
synchronization, even with Managed memory. This change treats
macOS Apple Silicon the same as iOS & tvOS.

- MVKPhysicalDevice add _hasUnifiedMemory & _isAppleGPU flags.
- MVKDeviceTrackingMixin add isUnifiedMemoryGPU() & isAppleGPU().
- Do not advertise host-visible-but-not-host-coherent
  Vulkan memory type on macOS Apple Silicon.
- Replace mvkMTLStorageModeFromVkMemoryPropertyFlags() with
  MVKPhysicalDevice::getMTLStorageModeFromVkMemoryPropertyFlags(),
  and return Shared instead of Managed for Apple Silicon,
  even if coherency is not requested.
- On unified memory devices, avoid needless calls to didModifyRange:,
  synchronizeResource:, and synchronizeTexture:slice:level:.
2024-04-29 17:13:17 -04:00
Bill Hollings
6c68ba1e0c
Merge pull request #2208 from billhollings/VK_EXT_host_image_copy
Add support for VK_EXT_host_image_copy extension.
2024-04-23 20:30:00 -04:00
Bill Hollings
19ad6b6cbd
Merge pull request #2214 from RandomShaper/avoid_deadlock
Prevent deadlock if working on non-main thread
2024-04-23 17:17:18 -04:00
Bill Hollings
dae20de48a
Update MoltenVK/MoltenVK/GPUObjects/MVKSwapchain.mm
Make fallback screen names consistent.
2024-04-23 16:42:34 -04:00
Bill Hollings
b6735878f3 VK_EXT_host_image_copy: On discrete GPUs, sync managed-memory textures before copying.
Discrete GPUs use managed-memory textures, and these need to be synchronized
from GPU memory before being available for host-copying to memory using the CPU.
Metal automatically handles the reverse sync when copying from memory to a texture.
2024-04-23 14:51:31 -04:00
Pedro J. Estébanez
a97ba52dbf Prevent deadlock if working on non-main thread 2024-04-23 19:35:35 +02:00
Bill Hollings
756f00ae8f
Merge pull request #2210 from etang-cw/ShaderDump
Add option to dump shaders
2024-04-19 11:16:08 -04:00
Bill Hollings
6a6fa2cb7b
Update MoltenVK/MoltenVK/Utility/MVKEnvironment.h
Removing as obsolete.
2024-04-19 11:15:57 -04:00
Bill Hollings
3dac6ec8ca
Update MoltenVK/MoltenVK/Utility/MVKEnvironment.h
Aligning with syntax of other comments in this file.
2024-04-19 11:15:32 -04:00
Evan Tang
b420d58b59 Add option to dump shaders 2024-04-17 13:38:02 -05:00
Bill Hollings
d0f066a8fb
Merge pull request #2211 from billhollings/cfg-mtce-assert
Simplify maintenance of build-time checking of MVKConfiguration members.
2024-04-16 18:23:05 -04:00
Bill Hollings
8b46bd2e7a Simplify maintenance of build-time checking of MVKConfiguration members.
- Remove _unused_struct_padding from MVKConfiguration and MVKConfigMembers.def.
- Add kMVKConfigurationInternalPaddingByteCount to specify MVKConfiguration
  internal padding byte count, for use in build time assertion check.
2024-04-16 18:05:10 -04:00
Bill Hollings
2290e86cd9 Add support for VK_EXT_host_image_copy extension.
- MVKResource::getHostMemoryAddress() return nullptr if
  MVKDeviceMemory::getHostMemoryAddress() returns null pointer,
  regardless of local offset.
- Remove unnecessary  enum value kMVKVkFormatFeatureFlagsTexTransfer
  to reduce redundancy between read and transfer feature flag options.
- Fix spelling of mvkVkOffset3DFromMTLOrigin() (unrelated).
- MVKResource remove unnecessary inline qualifiers (unrelated).
- MVKDevice remove some obsolete commentary (unrelated).
2024-04-16 12:18:40 -04:00
Bill Hollings
3f6a3c28f7
Merge pull request #2200 from billhollings/VK_EXT_metal_objects-ARC
Fix crash when using VK_EXT_metal_objects under ARC.
2024-04-06 13:35:01 -04:00
Bill Hollings
11a3adcd26 Fix crash when using VK_EXT_metal_objects under ARC.
Apple's Automatic Reference Counting automatically releases
the Metal objects returned by VK_EXT_metal_objects.

The fetchDependencies script now applies
Templates/Vulkan-Headers/VK_EXT_metal_objects-unret.gitdiff
to add an __unsafe_unretained ownership qualifier to the
Metal object declarations in vulkan_metal.h.

This should be a temporary patch until the VK_EXT_metal_objects
extension can be properly modified.
2024-04-04 00:09:29 -04:00
Bill Hollings
c0dce05bf6
Merge pull request #2198 from nihui/patch-1
doc moltenvk link CoreGraphics and AppKit framework
2024-04-03 10:34:26 -04:00
nihui
0ddf0fe6fe doc moltenvk link CoreGraphics and AppKit framework 2024-04-03 16:36:01 +08:00
Bill Hollings
adcd448f04
Merge pull request #2196 from billhollings/incr-dyn-link-fix
Fix issue where incremental dynamic builds do not link to static dependencies.
2024-04-02 15:17:56 -04:00
Bill Hollings
7533974fda Fix issue where incremental dynamic builds do not link to static dependencies.
After the recent change to building dynamic frameworks and dylibs as targets
built by linking to a static library dependency, incremental builds do not
correctly link the dynamic frameworks and dylibs to the rebuilt static library.

- Delete dynamic target outputs during static target builds.
- Run platform schemes sequentially in manual order.
- Build the dynamic framework before the dylib.
- Clean up Xcode Scheme organization.

It is not entirely obvious what the dependency problem is, and why
these particular changes work. A lot of trial-and-error was required.
It's possible that Xcode dependency analysis does not correctly analyze
the flow used in MoltenVK builds.
2024-03-30 17:47:36 -04:00
Bill Hollings
e97ec49663
Merge pull request #2195 from billhollings/restore-dylib-directory
To support legacy apps, restore MoltenVK/dylib directory.
2024-03-26 17:14:30 -04:00
Bill Hollings
363d4867a6 To support legacy apps, restore MoltenVK/dylib directory.
- Create symlink from MoltenVK/dylib to MoltenVK/dynamic/dylib.
2024-03-26 16:09:10 -04:00
Bill Hollings
73f2b8c280
Merge pull request #2183 from SRSaunders/perf-tracker
Add "previous" member to MVKPerformanceTracker structure
2024-03-20 11:24:22 -04:00
SRSaunders
0cf9f7f24b Capture perf start times in MVKQueueSubmission constructors vs. arguments of execute() function 2024-03-20 00:03:35 -04:00
SRSaunders
1d3fe52db9 Update documentation for the new waitSubmitCommandBuffers and waitPresentSwapchains perf counters 2024-03-19 23:19:01 -04:00
Bill Hollings
fce66e1443
Merge pull request #2189 from billhollings/update-gitignore
Update .gitignore.
2024-03-19 12:18:16 -04:00
Bill Hollings
8e6b80b598 Update .gitignore.
- .gitignore exclude all directories under External, to allow
  temp directories to be created during dependency developments.
- .gitignore specify MoltenVK exclusions are relative to root directory.
2024-03-19 12:01:37 -04:00
SRSaunders
10810f41d0 Add two new counters in MVKQueuePerformance for async queue submit wait times 2024-03-19 00:09:11 -04:00
SRSaunders
08c1ad705a Increment MVK_PRIVATE_API_VERSION to 41 2024-03-17 11:35:08 -04:00
SRSaunders
3ec155a3b6 Fix mvkCopyGrowingStruct() to return success only if struct and buffer sizes match 2024-03-17 11:34:14 -04:00
Bill Hollings
5c51d2a265
Merge pull request #2185 from jeroenbakker-atmind/fix/incorrect-project-version
Fix compilation issue due to new project version
2024-03-14 15:15:43 -04:00
Jeroen Bakker
f7ffecd9a7 Fix compilation issue due to new version 2024-03-14 11:19:15 +01:00
Bill Hollings
baad62b63e
Merge pull request #2184 from billhollings/update-to-v1.2.9
Update MoltenVK version to 1.2.9.
2024-03-13 13:10:53 -04:00
Bill Hollings
a9ebfc2c76 Update MoltenVK version to 1.2.9. 2024-03-13 13:10:03 -04:00
SRSaunders
11bd581c8d Add "previous" to MVKPerformanceTracker and save value before capturing "latest" 2024-03-13 09:55:08 -04:00
Bill Hollings
1d98babb72
Merge pull request #2181 from billhollings/vulkan-sdk-1.3.280
Update dependency libraries to match Vulkan SDK 1.3.280.
2024-03-12 13:10:50 -04:00
Bill Hollings
d61cefb530 Update dependency libraries to match Vulkan SDK 1.3.280.
- Remove support for deprecated -[MTLRenderCommandEncoder textureBarrier]
  and deprecate MVKPhysicalDeviceMetalFeatures::textureBarriers.
- Update minimum macOS deployment target to 10.15.
- Update minimum iOS/tvOS deployment target to 13.0.
- Update Whats_New.md document.
2024-03-12 11:49:11 -04:00
Bill Hollings
10400cdaf0
Merge pull request #2178 from billhollings/doc-gpu-capture
Document GPU capture.
2024-03-08 11:55:01 -05:00
Bill Hollings
ee02401497 Document GPU capture. 2024-03-08 11:53:33 -05:00