2424 Commits

Author SHA1 Message Date
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
Bill Hollings
0516bb84e9
Merge pull request #1460 from billhollings/remove-bc1-rgb
Remove advertised support for BC1_RGB texel formats.
2021-11-01 11:58:15 -04:00
Bill Hollings
bab17a52b7 Remove advertised support for BC1_RGB texel formats.
Metal does not provide direct support for BC1_RGB formats
(VK_FORMAT_BC1_RGB_UNORM_BLOCK & VK_FORMAT_BC1_RGB_SRGB_BLOCK).
We have been faking it by mapping these Vulkan formats to Metal
formats containing alpha (MTLPixelFormatBC7_RGBAUnorm &
MTLPixelFormatBC7_RGBAUnorm_sRGB, respectively),
and advertising support for BC1_RGB formats.

However, this triggers CTS failures, because the BC1_RGBA formats can return
an alpha value of 0.0 when constructed that way, whereas the BC1_RGB formats
always expect 1.0 (opaque) to be returned.

This change moves to indirect support for BC1_RGB formats. They will still
be covered by MTLPixelFormatBC7_RGBAUnorm & MTLPixelFormatBC7_RGBAUnorm_sRGB,
and will effectively work (except transparency), but are no longer advertised
through physical device format and image format queries.
2021-10-31 19:00:25 -04:00
Bill Hollings
de201b4b9f
Merge pull request #1458 from js6i/master
MVKImage: Select proper base layer and mipmap for attachment if not using view because of swizzling.
2021-10-26 11:05:09 -04:00
Jan Sikorski
99dcaaa070 MVKImage: Select proper base layer and mipmap for attachment if not using view because of swizzling. 2021-10-26 10:19:12 +02:00
Bill Hollings
b9863dfd78
Merge pull request #1459 from EwoutH/patch-3
CI: Update builds to Xcode 13.1, add legacy 12.5.1 build
2021-10-25 14:56:33 -04:00
Ewout ter Hoeven
ce0ad1d3ac
CI: Make macOS version explicit
Xcode 11.7 uses macOS 10.5, Xcode 12.5.1 and 13.1 uses macOS 11.
2021-10-25 19:34:37 +02:00
Ewout ter Hoeven
d12fdb5b63
CI: Update builds to Xcode 13.1, add legacy 12.5.1 build
Updates the regular macOS, maccat, iOS and tvOS builds to use Xcode 13.1 instead of 12.4. Also adds a legacy build using Xcode 12.5.1.
2021-10-25 19:27:33 +02:00
Bill Hollings
20ea5413f5
Merge pull request #1446 from cfnptr/master
Add unsupported VkApplicationInfo->apiVersion warning
2021-10-14 16:50:30 -04:00
Nikita Fediuchin
fae1bb53a6 Fix apiVersion check condition 2021-10-06 21:25:01 +03:00
Nikita Fediuchin
c8813898cf Add MVKLogWarning, apiVersion warning
* Added MVKLogWarning logger, and updated header comments.
* Added greater _appInfo.apiVersion  than MoltenVK version warning.
2021-10-04 12:03:36 +03:00
Nikita Fediuchin
a22dfba076 Fix spacing 2021-10-04 00:17:51 +03:00
Nikita Fediuchin
a001c4344e Add VkInstance apiVersion warning 2021-10-04 00:13:14 +03:00
Bill Hollings
d833ce95d7
Merge pull request #1444 from billhollings/dynamic-pipeline-state-fix
Ensure dynamic pipeline state always respects pipeline dynamic flags.
2021-10-01 10:10:34 -04:00
Bill Hollings
cc10af04c9 Ensure dynamic pipeline state always respects pipeline dynamic flags.
Dynamic pipeline state set before the pipeline is set was reading
dynamic flags from previous pipeline. This is fixed here by accepting
the dynamic state, but deferring the decision to use either dynamic
or static state until the pipeline is encoded.
2021-09-30 21:09:07 -04:00
Bill Hollings
82efcb6722
Merge pull request #1443 from billhollings/multilayer-rendering-validation-fix
Move multilayer-rendering validation from MVKImage to MVKImageView.
2021-09-30 15:51:08 -04:00
Bill Hollings
36fae88ee2 Move multilayer-rendering validation from MVKImage to MVKImageView.
An MVKImageView that renders to only one layer of a multilayer MVKImage
is not performing multilayer-rendering. Only validate multilayer-rendering
when it is definitely requested in an MVKImageView, instead of presuming
when a multilayer MVKImage is marked for rendering.
2021-09-30 15:30:23 -04:00
Bill Hollings
0aa67bf094
Merge pull request #1442 from billhollings/update-spirv-cross
Update to latest version of SPIRV-Cross.
2021-09-30 14:46:54 -04:00
Bill Hollings
025ffdc41e Let's try this again, this time with the actual SPIRV-Cross update! 2021-09-30 13:54:28 -04:00
Bill Hollings
ba9623cad5 Update to latest version of SPIRV-Cross.
Add additional SPIRV-Cross header files to ExternalDependencies.xcodeproj
to allow browsing these files in Xcode.
2021-09-30 13:45:54 -04:00
Bill Hollings
f78ab20b79
Merge pull request #1437 from jerrans/mvk-expose-commandqueue
Expose underlying MTLCommandQueue
2021-09-18 14:08:20 -04:00
Jerran Schmidt
8c97b360e1 Added vkGetMTLCommandQueueMVK function to expose underlying MTLCommandQueue object 2021-09-17 12:47:10 +10:00
Bill Hollings
5ff912031b
Merge pull request #1436 from billhollings/gpu-ctr-fixes
Improved checks for timestamp GPU counter support on older devices + Ensure timestamp sync.
2021-09-13 19:06:32 -04:00
Bill Hollings
4ad5930263 Improved checks for timestamp GPU counter support on older devices.
Check that appropriate GPU counter set is supported on
the device before creating GPU counter sample buffer.
Don't attempt to timestamp using GPU counters unless
a GPU sample counter buffer has been created.
2021-09-13 17:20:00 -04:00
Bill Hollings
0cf396a70f Add MTLFence between Metal encoders and timestamp stage counter BLIT encoder
to ensure previous work is finished before being timestamped.
2021-09-13 16:08:16 -04:00
Bill Hollings
8132cec62e
Merge pull request #1435 from billhollings/pt-size+spvx-update
Several updates for CTS test fixes.
2021-09-10 13:03:57 -04:00
Bill Hollings
e36b9e60d5 Set maximum point primitive size based on GPU vendor ID. 2021-09-09 14:33:30 -04:00
Bill Hollings
333084f739 Several updates for CTS test fixes.
Support maximum point primitive size of 511.
Update to latest SPIRV-Cross version to add support
for OpSpecConstantOp ops OpQuantizeToF16 and OpSRem.
Update MoltenVK version to 1.1.6.
2021-09-08 12:05:08 -04:00
Bill Hollings
b10b970707
Merge pull request #1432 from starbucksDave/starbucksDave-SetWorkGroupSize-FunctionType
Add SetWorkGroupSize function type to vk_mvk_moltenvk.h
2021-09-01 11:37:25 -04:00
StarbucksDave
b4d98aa77e
Add SetWorkGroupSize function type 2021-09-01 17:23:40 +02:00
Bill Hollings
c1d03328b2
Merge pull request #1431 from billhollings/SDK-1.2.189
Update library dependencies to match Vulkan SDK 1.2.189.
2021-08-30 16:03:00 -04:00
Bill Hollings
bb7af644ee Remove use of the MTLMaxBlitPassSampleBuffers Metal API definition.
MTLMaxBlitPassSampleBuffers was available in Xcode 12 and had a value of 4.
According to Apple, the definition will be removed from the API in Xcode 13.
For now, assume a value of 1, until we can accurately determine the
appropriate value per platform.
2021-08-30 15:37:49 -04:00
Bill Hollings
a5ee3ead35 Update library dependencies to match Vulkan SDK 1.2.189.
Update What's New document.
2021-08-30 13:54:37 -04:00
Bill Hollings
f5dd310c55
Merge pull request #1426 from billhollings/partial-clear-stencil
Several renderpass clearing and input fixes from CTS
2021-08-23 19:42:13 -04:00
Bill Hollings
653978cae1
Merge pull request #1427 from billhollings/spvx-update
Update to latest version of SPIRV-Cross.
2021-08-23 19:15:45 -04:00
Bill Hollings
2412b97998 Fix from PR code review.
Remove unused MVKCommandUse::kMVKCommandUseBeginMultiViewPass.
2021-08-23 18:43:59 -04:00
Bill Hollings
43a133ff10 Update to latest version of SPIRV-Cross.
MSL: Support row-major transpose when storing matrix from constant RHS matrix.
MSL: Fix casting in constant expressions with different sizes.
MSL: Fix duplicate gl_Position outputs when gl_Position defined but unused.
2021-08-23 18:31:45 -04:00
Bill Hollings
8a7e20d348 Fix GPU race condition when clearing a renderpass input attachment on Apple GPUs.
Apple GPUs do not support rendering/writing to an attachment and then reading
from that attachment within a single Metal renderpass. On Apple Silicon, restart
the Metal renderpass if an input attachment is cleared inside renderpass.

Don't clear render area when restarting Metal renderpass, as it should not occur,
and itself causes a recursive loop restarting the renderpass as a result.

Add MVKCommandUse::kMVKCommandUseRestartSubpass.
MVKCommandEncoder::beginMetalRenderPass() pass MVKCommandUse to help determine
Metal renderpass attachment load and clearing options.
2021-08-23 14:28:20 -04:00
Bill Hollings
ff7ea713f6 Fix depth/stencil clearing broken during recent fix.
A recent change for resolving color formats mistakenly
broke clearing depth and stencil formats.
Remove optionality of all function arguments in
MVKRenderPassAttachment::populateMTLRenderPassAttachmentDescriptor()
to avoid bad calls being masked by optional function arguments.
Add appropriate canResolveFormat values for all calls to that function.
2021-08-20 13:58:32 -04:00
Bill Hollings
ce583f4f3d Support stencil-only partial attachment clearing.
Rename MVKRenderPassAttachment::shouldUseClearAttachment() to
shouldClearAttachment(), pass whether testing for stencil clearing,
and check stencil clearing distinct from depth clearing.
Refactor MVKRenderSubpass::populateClearAttachments() to work with this.
Remove MVKRenderPassAttachment::getAttachmentStencilLoadOp() as obsolete.
2021-08-19 17:22:29 -04:00
Bill Hollings
77c31cd0da
Merge pull request #1418 from billhollings/vulkan-semaphores-via-mtlevents
Prefer MTLEvent for VkSemaphore, except on NVIDIA, prefer emulation.
2021-08-10 13:51:47 -04:00
Bill Hollings
8c7db31cd7 Prefer MTLEvent for VkSemaphore, except on NVIDIA, prefer emulation.
Disable MVK_ALLOW_METAL_FENCES by default.
Disable use of MTLEvent on NVIDIA.
By default, use MTLEvent for VkSemaphore everywhere except NVIDIA.
By default, use CPU synchronization on NVIDIA.

These changes fix a large number of CTS synchronization test failures.
2021-08-10 11:32:21 -04:00
Bill Hollings
8e6731fd8e Revert to prefer MTLEvent over MTLFence for VkSemaphore, except on NVIDIA.
Prefer MTLEvent over MTLFence for VkSemaphore, because MTLEvent handles
sync across MTLCommandBuffers and MTLCommandQueues, except on NVIDIA GPUs,
which have demonstrated trouble with MTLEvents, prefer MTLFence.
Add MVKDevice::VkSemaphoreStyle enum.
2021-08-10 10:29:09 -04:00
Bill Hollings
1032c43b61
Merge pull request #1417 from billhollings/mtlcmdbuff-labels
Add queue and queue family indices to MTLCommandBuffer label.
2021-08-09 18:06:09 -04:00