2467 Commits

Author SHA1 Message Date
Bill Hollings
6327b767e0 Reinstate memory barriers on non-Apple GPUs.
Ensure non-Apple GPU's enable memory barriers.
A previous commit inadvertently disabled GPU memory barriers.

Change tests for memory barriers to runtime test for Apple GPU, instead of
build-time test for Apple Silicon, to accommodate running on Rosetta2, and
refactor tests for Apple Silicon and OS version on some macOS GPU feature settings.
2022-03-08 17:01:50 -05:00
Bill Hollings
c09bcd0972
Merge pull request #1531 from billhollings/stencil-only-depth-store-action
Don't attempt to store the depth component of a stencil-only renderpass attachment.
2022-02-24 14:37:08 -05:00
Bill Hollings
e42b33e593 Don't attempt to store the depth component of a stencil-only renderpass attachment.
For a combined depth-stencil format in a MVKImageView attachment with
VK_IMAGE_ASPECT_STENCIL_BIT, the attachment format may have been swizzled
to a stencil-only format. In this case, we want to guard against an attempt
to store the non-existent depth component.

Pass MVKImageView attachment to MVKRenderPassAttachment::encodeStoreAction()
and MVKRenderPassAttachment::populateMTLRenderPassAttachmentDescriptor() to
check attachment depth format component.

Consolidate calls to MVKImageView::populateMTLRenderPassAttachmentDescriptor() by calling
it from within MVKRenderPassAttachment::populateMTLRenderPassAttachmentDescriptor().
2022-02-24 11:42:12 -05:00
Bill Hollings
a6f5841b91
Merge pull request #1530 from billhollings/align-shader-io-nested-structs
Align flattened shader inputs to previous stage output structs.
2022-02-22 17:29:41 -05:00
Bill Hollings
e28a16d76b Update MoltenVK version number to 1.1.9.
Adjust Whats_New.md to accommodate earlier
trivial 1.1.8 patch release for SDK 1.3.204.1.
2022-02-22 14:18:55 -05:00
Bill Hollings
afd997ab31 Align flattened shader inputs to previous stage output structs.
When flattening shader inputs for stage_in, which are to be read from a buffer
that was populated as nested structs during an earlier stage, the structs will
be aligned according to C++ rules, which can affect the alignment of the first
member of the flattened input struct.

Add SPIRVShaderOutput::firstStructMemberAlignment to track the alignment
requirements of the first member of a nested structure, and recursively
determine the alignment of the first member of each nested output structure.

Move sizeOfOutput() from MVKPipeline.mm to SPIRVReflection.h,
rename to getShaderOutputSize(), and add getShaderOutputAlignment()
to extract member alignment.
2022-02-22 12:17:15 -05:00
Bill Hollings
24f802a5dd
Merge pull request #1527 from billhollings/update-glslang
Update glslang version, to use python3 in glslang scripts, to replace missing python on macOS 12.3.
2022-02-16 14:48:24 -05:00
Bill Hollings
f7ca132844 Update glslang version, to use python3 in glslang scripts,
to replace missing python on macOS 12.3.
2022-02-16 14:02:01 -05:00
Bill Hollings
2fa625f962
Merge pull request #1523 from billhollings/rmv-api-warn
Remove logged warning if MoltenVK does not support VkApplicationInfo::apiVersion value.
2022-02-09 13:53:44 -05:00
Bill Hollings
16408fd6ae Remove logged warning if MoltenVK does not support VkApplicationInfo::apiVersion value.
Update MoltenVK version to 1.1.8.
Minor spelling fixes in comments.
2022-02-09 13:36:08 -05:00
Bill Hollings
8218606f44
Merge pull request #1522 from billhollings/sdk-1.3.204
Update dependency libraries to match Vulkan SDK 1.3.204.
2022-02-06 20:46:12 -05:00
Bill Hollings
24ff2106d9 Update dependency libraries to match Vulkan SDK 1.3.204.
Update What's New document.
2022-02-06 19:55:44 -05:00
Bill Hollings
24c2315072
Merge pull request #1520 from billhollings/simulator-gpu-counter-sets
Fix use of GPU counter sets on older versions of iOS running on the simulator.
2022-02-05 13:23:26 -05:00
Bill Hollings
13a0f6abee Fix use of GPU counter sets on older versions of iOS running on the simulator.
Replace test for MVK_APPLE_SILICON with test for MVK_MACOS plus Apple1 GPU.
2022-02-05 12:23:05 -05:00
Bill Hollings
101ea9eec1
Merge pull request #1519 from cfnptr/master
Update license year
2022-02-04 11:27:57 -05:00
Nikita Fediuchin
be51560ba9 Update license year 2 2022-02-04 17:36:53 +02:00
Nikita Fediuchin
4efb90b3c1 Update license year 2022-02-04 13:33:27 +02:00
Bill Hollings
9366457b86
Merge pull request #1509 from billhollings/shaderconverter-updates
MoltenVKShaderConverter updates
2022-01-19 17:06:15 -05:00
Bill Hollings
d4daba6687 MoltenVKShaderConverter updates.
mvk::getShaderOutputs() in SPRIVReflection.h support flattening nested structures.
MoltenVKShaderConverter tool support loading tessellation shader files.
MoltenVKShaderConverter tool update to MSL 2.4 by default.
Remove use of deprecated MTLCreateSystemDefaultDevice().
Update to latest version of SPIRV-Cross.
2022-01-19 15:55:44 -05:00
Bill Hollings
a8149aa45e
Merge pull request #1502 from mbechard/master
fix for #1501
2022-01-05 20:53:34 -05:00
Malcolm Bechard
f3f02c327c fix for #1501
Maintain the incrementing location throughout the structure traversal.
2022-01-05 15:25:16 -05:00
Bill Hollings
9986e92f35
Merge pull request #1497 from billhollings/apple-silicon-deviceID
On Apple Silicon, set VkPhysicalDeviceProperties::deviceID from GPU capabilities.
2021-12-28 22:08:44 -05:00
Bill Hollings
54cdb4706e
Merge pull request #1500 from billhollings/normalize-gpu-counters
Improve accuracy of VkPhysicalDeviceLimits::timestampPeriod.
2021-12-28 22:08:25 -05:00
Bill Hollings
7740d4f43a
Change scale of OSMin value in deviceID to 100.
Co-authored-by: Chip Davis <cdavis@codeweavers.com>
2021-12-28 19:58:10 -05:00
Bill Hollings
cd7c7fdfae Support MTLTimestamp on Xcode 11.7. 2021-12-28 18:12:25 -05:00
Bill Hollings
9633f4843d Improve accuracy of VkPhysicalDeviceLimits::timestampPeriod.
If using GPU counters, on all Apple GPUs lock timestampPeriod to 1.0,
since Apple GPUs use nanoseconds, and on non-Apple GPUs, dynamically
adapt value of timestampPeriod by correlating GPU ticks with GPU ticks.

If using CPU sync, set timestampPeriod to OS CPU timestamp tick period.
2021-12-28 17:19:11 -05:00
Bill Hollings
a1e5ed97a1
Merge pull request #1498 from billhollings/xcode-13.2-build-settings
Support Xcode 13.2 build settings.
2021-12-27 21:16:02 -05:00
Bill Hollings
3a8975c21d Support Xcode 13.2 build settings. 2021-12-27 17:50:29 -05:00
Bill Hollings
df043487e4 On Apple Silicon, set VkPhysicalDeviceProperties::deviceID from GPU capabilities.
Previously, on Apple Silicon (iOS, tvOS & macOS M1), we tried to guess
deviceID from GPU parameters, but this is becoming harder as the types
of Apple Silicon is growing, and the actual device SoC itself is less
relevant that the GPU capabilities. So we now set deviceID from the
combination of OS version and GPU type.

Rename MVKDevice::getHighestMTLFeatureSet() to getHighestGPUCapability().
2021-12-27 16:45:12 -05:00
Bill Hollings
939d51da71
Merge pull request #1494 from billhollings/fix-subpass-mtltex-mem-leak
Fix memory leak of dummy MTLTexture in render subpasses that use no attachments.
2021-12-27 13:00:34 -05:00
Bill Hollings
5810772644 Fix merge conflicts and syntax build error in iOS build. 2021-12-26 18:30:31 -05:00
Bill Hollings
66a171a25d
Merge pull request #1490 from billhollings/strip-promoted-static-vulkan-symbols
Optionally hide additional static Vulkan linkage symbols.
2021-12-26 17:24:19 -05:00
Bill Hollings
b943446a78
Merge pull request #1493 from billhollings/fix-assgnmt-op-retain-release
Fix Metal object retain-release errors in assignment operators.
2021-12-26 17:19:58 -05:00
Bill Hollings
92712e240a Fix memory leak of dummy MTLTexture in render subpasses that use no attachments.
Older Metal does not support rendering without subpass attachments.
In this case, a dummy attachment with a dummy MTLTexture is created
whenever the subpass begins, but was not being correctly used.

Move the creation, retaining, and releasing of the dummy MTLTexture to
MVKFramebuffer, where the extent and layer count is known and can be reused.

Pass framebuffer to MVKCommandEncoder::beginRenderpass() and remember
current framebuffer in MVKCommandEncoder.
Add getFramebufferExtent() and getFramebufferLayerCount() to MVKCommandEncoder.
Pass framebuffer to MVKRenderSubpass:populateMTLRenderPassDescriptor() and
retrieve dummy MTLTexture from framebuffer.
2021-12-25 16:18:18 -05:00
Bill Hollings
355bfed457 Fix Metal object retain-release errors in assignment operators. 2021-12-25 12:58:55 -05:00
Bill Hollings
52568efb27 Optionally hide additional static Vulkan linkage symbols.
Move the aliasing of promoted function pointers to the function pointer
lookup collection, because non-global function alias symbols are not
available in separately compiled object file.

Add public aliased Vulkan extension functions that were promoted to 1.1 to
the public symbols that are hidden when MVK_HIDE_VULKAN_SYMBOLS is enabled.

Add functions from the private VK_MVK_moltenvk extension that depend on
Vulkan object handles to the public symbols that are hidden when
MVK_HIDE_VULKAN_SYMBOLS is enabled, to discourage their use by apps that
are using the Vulkan Loader and Layers, because they are not supported by
the Vulkan Loader and Layers.

Update VK_MVK_MOLTENVK_SPEC_VERSION to version 33.
2021-12-18 14:00:37 -05:00
Bill Hollings
bc4ce5799c
Merge pull request #1485 from billhollings/rosetta2-and-msl24
Updates to better support Rosetta2 runtimes, and MSL 2.4 and 2.3 versions.
2021-12-02 16:40:48 -05:00
Bill Hollings
e74cf2f094 Fix build macros for tvOS, plus support MTLGPUFamilyApple8.
Don't use tests for MTLGPUFamilyApple6 and MTLGPUFamilyApple7 in tvOS build.
Advertise MTLGPUFamilyApple8 GPU and A15 SoC device if present.
2021-12-02 09:47:56 -05:00
Bill Hollings
479d55f2aa Wrap MTLGPUFamilyApple6 and MTLGPUFamilyApple7 in build macros for Xcode 11.7. 2021-12-01 19:13:29 -05:00
Bill Hollings
18642002ce Updates to better support Rosetta2 runtimes, and MSL 2.4 and 2.3 versions.
Do not use MTLEvent for VkSemaphore under Rosetta2.
Remove compile test for MVK_MACOS_APPLE_SILICON and MVK_APPLE_SILICON when testing
for Apple GPU families, to allow x86 builds to test for Apple GPU under Rosetta2.
Simplify identifying M1 GPU. All M1 SoCs currently support the A14 (Apple7) GPU.
Support compiling MSL 2.4 in runtime pipelines and MoltenVKShaderConverterTool.
Fix issue where MSL 2.3 only available on Apple Silicon, even on macOS.
Update to latest SPIRV-Cross (unrelated to Rosetta2).
2021-12-01 18:14:07 -05:00
Bill Hollings
c376273b74
Merge pull request #1481 from cfnptr/master
Clean up MVKLogging
2021-11-26 04:38:15 -05:00
Nikita Fediuchin
0da221f48c Fix documentation and header 2021-11-26 10:11:16 +02:00
Nikita Fediuchin
6ac92fbacf Clean up MVKLogging
* Replaced ASL levels with MVKConfigLogLevel.
* Moved MVKLogging.h to Utility/ directory.
* Added MVKConfigLogLevel Warning and Debug levels.
2021-11-25 09:47:43 +02:00
Bill Hollings
80256771f7
Merge pull request #1478 from billhollings/strip-static-vulkan-symbols
Support building MoltenVK with static Vulkan linkage symbols hidden.
2021-11-17 20:15:57 -05:00
Bill Hollings
5de7f5551c Support building MoltenVK with static Vulkan linkage symbols hidden.
Add build environment variable MVK_HIDE_VULKAN_SYMBOLS. to allow MoltenVK
to be built with static Vulkan API symbols hidden, to avoid library linking
conflicts when bound to a Vulkan Loader that also exports identical symbols.

The default value of MVK_HIDE_VULKAN_SYMBOLS is 0,
meaning Vulkan static symbols are exposed by default.

Add MVK_PUBLIC_VULKAN_SYMBOL directive to mark each Vulkan call symbols
for exporting or hiding.

Update the MoltenVK Xcode project to add the MVK_HIDE_VULKAN_SYMBOLS build
setting, and set the ENABLE_TESTABILITY build setting to NO, because it
conflicts with stripping symbols.

Update MoltenVK version to 1.1.7.
2021-11-17 18:22:33 -05:00
Bill Hollings
b3ef160c54
Merge pull request #1470 from billhollings/sdk-1.2.198
Update library dependencies to match Vulkan SDK 1.2.198.
2021-11-15 12:03:37 -05:00
Bill Hollings
a0ed3345b6 Update library dependencies to match Vulkan SDK 1.2.198.
Update What's New.md document.
2021-11-13 19:57:41 -05:00
Bill Hollings
f99384da96
Merge pull request #1467 from billhollings/restore-bc1-rgb-support
Restore support for BC1_RGB compressed formats.
2021-11-10 14:43:49 -05:00
Bill Hollings
a5d0464a43 Update BC1_RGB swizzle to accommodate RGB values swizzled to or from alpha. 2021-11-10 13:41:07 -05:00
Bill Hollings
6e054ad5db Restore support for BC1_RGB compressed format.
For Vulkan BC1_RGB formats, swizzle alpha of substituted
Metal BC1_RGBA to 1.0, to return value expected by Vulkan.
2021-11-09 12:13:51 -05:00