2631 Commits

Author SHA1 Message Date
Bill Hollings
378b5d5bc9 Fix synchronization issue with locking MTLArgumentEncoder.
Move mutex lock for using MTLArgumentEncoder to MVKMTLArgumentEncoder
to be tracked along with the MTLArgumentEncoder it guards.
2021-05-14 22:17:08 -04:00
Bill Hollings
feb66390ca
Merge pull request #1361 from billhollings/null-proc-addrs
Revert to strict publishing of functions only from enabled extensions.
2021-05-13 22:49:43 -04:00
Bill Hollings
1c9a918312 Revert to strict publishing of functions only from enabled extensions.
Previously we had loosened the behavior so that function proc addresses are returned
for an extension function even if that extension is disabled, if the API was artificially
restricted during testing, to bypass CTS tests that appeared to assume certain
extension functions were available.

This loosening in turn caused the dEQP-VK.api.version_check.entry_points test to fail,
so the restriction is reapplied and only functions from enabled extensions are published.
2021-05-13 20:54:12 -04:00
Bill Hollings
226d0fc58c
Merge pull request #1359 from billhollings/sampler-borders
Cleanup handling of sampler border color and mirror edge clamp.
2021-05-13 15:35:39 -04:00
Bill Hollings
ea1d21a939 Cleanup handling of sampler border color and mirror edge clamp.
mvkMTLSamplerAddressModeFromVkSamplerAddressMode() support
MTLSamplerAddressModeClampToBorderColor and
MTLSamplerAddressModeMirrorClampToEdge if available.
Add MVKSampler::getMTLSamplerAddressMode() to test for device feature availability.
Remove special border color handling in MVKSampler::newMTLSamplerDescriptor().
2021-05-13 15:06:35 -04:00
Bill Hollings
77ce400b26
Merge pull request #1357 from billhollings/adjust-VkPhysicalDeviceLimits-values
Fixes for CTS dEQP-VK.info.device_properties failures.
2021-05-07 22:00:58 -04:00
Bill Hollings
e1bbe163d6 Revert pointSizeRange upper limit back to 64 as Metal has inconsistent docs on this. 2021-05-07 21:41:29 -04:00
Bill Hollings
8420988c73 Fixes for CTS dEQP-VK.info.device_properties failures.
Adjust VkPhysicalDeviceLimits values:
- minMemoryMapAlignment raised to MIN of 64 per Vulkan spec.
- pointSizeRange upper limit to 511 per Metal.
- lineWidthGranularity to 0 per Vulkan spec when wideLines disabled.
- maxSamplerLodBias set to 4 to cover setting in shader.
2021-05-07 21:28:56 -04:00
Bill Hollings
5de2e71619
Merge pull request #1355 from cdavis5e/new-amd-32-lane-devices
MVKDevice: Add new AMD devices supporting 32 lanes.
2021-05-06 08:22:20 -04:00
Bill Hollings
a6e73c7937
Merge pull request #1354 from billhollings/fix-1329-2
MVKImagePlane::getMTLTexture() protect against crash when image has no device memory bound.
2021-05-06 08:21:13 -04:00
Chip Davis
78b04f4f6e MVKDevice: Add new AMD devices supporting 32 lanes.
These new cards are supported in the 11.4 beta.
2021-05-05 18:35:45 -05:00
Bill Hollings
19f02fac3d Merge from master and fix PR conflicts. 2021-05-05 16:46:45 -04:00
Bill Hollings
d1983eba9d
Merge pull request #1353 from billhollings/fix-1336
Fix crash when requesting MTLCommandBuffer logs in runtime debug mode on older OS versions.
2021-05-05 16:42:08 -04:00
Bill Hollings
f781ee720a MVKImagePlane::getMTLTexture() protect against
crash when image has no device memory bound.
2021-05-05 16:37:16 -04:00
Bill Hollings
523342dd2f Fix crash when requesting MTLCommandBuffer logs in runtime debug mode on older OS versions. 2021-05-05 14:46:36 -04:00
Bill Hollings
26ff3e594a
Merge pull request #1352 from billhollings/shader-config
Improvements to SPIRVToMSLConversionConfiguration
2021-05-05 14:14:40 -04:00
Bill Hollings
4cb4ff850d
Merge pull request #1351 from billhollings/reference-counting-mixin
Add class mixins for reference counting and configuration results.
2021-05-04 20:17:51 -04:00
Bill Hollings
650e8f3a46 To improve cache hits when matching SPIRVToMSLConversionConfiguration structs
to each other to find cached shader, only consider current shader stage resources.

Rename more references to ShaderConverterContext to ShaderConversionConfig.
2021-05-04 20:06:34 -04:00
Bill Hollings
64a69d0e51 Rename more references to ShaderConverterContext to ShaderConversionConfig. 2021-05-04 18:07:55 -04:00
Bill Hollings
577ec9a447 Rename references to ShaderConverterContext to ShaderConversionConfig
to align better with name of SPIRVToMSLConversionConfiguration structure.
2021-05-04 16:24:41 -04:00
Bill Hollings
1b937aeac4 MSLShaderInput and MSLResourceBinding compare SPIRV-Cross components via memcmp()
to save having to track individual evolutionary changes to those components.
2021-05-04 15:50:56 -04:00
Bill Hollings
91c5f58f7a Add class mixins for reference counting and configuration results.
Separate reference counting from MVKVulkanAPIObject into a new
MVKReferenceCountingMixin class, so reference counting can
potentially be used in other areas of the class hierarchy.
Replace MVKConfigurableObject with MVKConfigurableMixin for the same reason.
Remove some inline definitions as unnecessary in the files being revised here.
2021-05-04 15:26:28 -04:00
Bill Hollings
1e7ff59944
Merge pull request #1348 from billhollings/maintainability-changes
Miscellaneous non-functional maintainability updates.
2021-05-04 10:22:51 -04:00
Bill Hollings
5b1f38fbb9 Miscellaneous non-functional maintainability updates.
Rename kMVKShaderStageMax to kMVKShaderStageCount
to clarify it's common use in array sizing and for loops.
Change mvkConfig() to return reference instead of pointer
to improve syntactic sugar to use . instead of ->.
Update MoltenVK version to 1.1.4.
Update What's New document.
2021-05-03 18:56:30 -04:00
Bill Hollings
2eba556084
Merge pull request #1345 from billhollings/xc-125
Support Xcode 12.5
2021-05-03 15:04:58 -04:00
Bill Hollings
f2aa573188
Merge pull request #1346 from starbucksDave/patch-1
Use SPIRV_CROSS_NAMESPACE define in MVKDescriptor.mm
2021-05-03 14:11:33 -04:00
Bill Hollings
f2eb8e60c8 Further fixes to Xcode 12.5 support.
Indicate that MacCatalyst does not support BC compression.
2021-05-03 13:49:41 -04:00
StarbucksDave
fea0eddcee
Update MVKDescriptor.mm
Fix space (from web commit).
2021-05-03 10:04:23 +02:00
StarbucksDave
1d480dbe63
Use SPIRV_CROSS_NAMESPACE define in MVKDescriptor.mm
I believe SPIRV_CROSS_NAMESPACE_OVERRIDE should be replaced by SPIRV_CROSS_NAMESPACE defined in SPIRV-Cross spirv_common.hpp. This ensures that SPIRV_CROSS_NAMESPACE_OVERRIDE usage in MVK is optional.
2021-05-03 09:57:12 +02:00
Bill Hollings
5fd821bb5d
Merge pull request #1344 from kleinerm/googledisplaytiming
Compliance fixes for VK_GOOGLE_display_timing extension implementation.
2021-05-01 16:19:58 -04:00
Bill Hollings
6614ef2005
Merge pull request #1342 from kleinerm/iosurfacewithoutobjc
Expose vkGetIOSurfaceMVK() / vkUseIOSurfaceMVK() also under non-ObjC.
2021-05-01 16:13:06 -04:00
Bill Hollings
0a062600c1 Further fixes to Xcode 12.5 support.
Revert to Xcode 12.4 in GitHub Actions CI, as 12.5 not deployed yet for the
macos-latest virtual environment, which is currently macOS 10.15, and a
macOS 11.0 virtual environment is available only in private preview.
2021-05-01 16:00:23 -04:00
Bill Hollings
4a76e5a904 Further fixes to Xcode 12.5 support.
Fix macro logic in mvkSupportsBCTextureCompression() for iOS & tvOS platforms.
2021-05-01 15:35:19 -04:00
Bill Hollings
0bfd127428 Further fixes to Xcode 12.5 support.
Test for [MTLDevice supportsBCTextureCompression] only when using Xcode 12 and above.
Use Xcode 12.5 in GitHub Actions CI.
Fix typos in comments.
2021-05-01 15:21:57 -04:00
Bill Hollings
434b95e829 Fix build error when querying MTLDevice support for BC compression.
This build error seems to have been exposed in Xcode 12.5.
Add mvkSupportsBCTextureCompression() to manage use of
[MTLDevice supportsBCTextureCompression] to query for
MTLDevice support for BC compression across all platforms.
2021-05-01 14:00:17 -04:00
Bill Hollings
1655f3b455 Add tag names to anonymous structs. 2021-04-30 20:49:01 -04:00
Bill Hollings
c0e5f88bf5 Support Xcode 12.5 build settings. 2021-04-30 19:41:54 -04:00
kleinerm
ffed2a26b2 Make vkGetPastPresentationTimingGOOGLE() queuing behavior spec compliant.
Citing section 33.8 "Display Timing Queries", the description of
VK_GOOGLE_display_timing's vkGetPastPresentationTimingGOOGLE()
the spec states that "The results for a given swapchain and presentID are
only returned once from vkGetPastPresentationTimingGOOGLE."

In other words, every VkPastPresentationTimingGOOGLE timing record
stored in the internal queue must get removed from the internal queue,
once it was returned to the calling client application via a successfull
call to vkGetPastPresentationTimingGOOGLE().

The current implementation does not remove delivered entries from the
queue. Instead it keeps the last kMaxPresentationHistory (== 60) records,
so the internal queue grows to its maximum fill level and never empties.
Successive calls to vkGetPastPresentationTimingGOOGLE() deliver the same
records repeatedly, confusing applications which are written according to
spec.

This commit changes the queueing behavior to properly remove items from
the queue, so that it operates in a FIFO fashion and only retains items which
have not been fetched yet, up to kMaxPresentationHistory, after which the
oldest items get discarded.

Tested on macOS 10.15.7 with AMD for different intervals between calling
vkGetPastPresentationTimingGOOGLE() and different input values for
pPresentationTimingCount, to make sure it behaves properly for cases like
1 item in queue at query time, queue half full at query time, queue completely
full, queue "overflowing" - ie. items are properly discarded in FIFO order, and
for fetching 1 item at a time, multiple items (partially emptying the queue in
each iteration) or all items (emptying the queue in one go).
2021-04-29 06:07:57 +02:00
kleinerm
136a5cbd4a Fix behaviour of vkGetPastPresentationTimingGOOGLE().
On return, *pPresentationTimingCount was not assigned the actual number
of timing records written, as the spec requires. Fix this.

If pPresentationTimingCount was smaller than the number of available
records, the function still returned VK_SUCCESS instead of VK_INCOMPLETE,
as the spec requires. Fix this.
2021-04-29 06:04:24 +02:00
Bill Hollings
55dd4ed229
Merge pull request #1343 from billhollings/minor-doc-fix
Change documentation references to macOS 10.16 to macOS 11.0.
2021-04-27 13:09:46 -04:00
Bill Hollings
8f94b820a8 Change documentation references to macOS 10.16 to macOS 11.0. 2021-04-27 12:53:02 -04:00
Bill Hollings
c445d09a76
Merge pull request #1335 from billhollings/argument-buffers
Initial Metal argument buffer support
2021-04-27 12:19:32 -04:00
kleinerm
14bbf3453d Expose vkGetIOSurfaceMVK() / vkUseIOSurfaceMVK() also under non-ObjC.
Those functions are also usable from standard C, no need for the caller
to be compiled as Objective-C. Move their definition outside the __OBJC__
guards.
2021-04-27 17:15:30 +02:00
Bill Hollings
404aa3e8cd Metal argument buffers code review fixes.
Use `[MTLDevice maxArgumentBufferSamplerCount]` to determine maximum sampler counts.
When checking `[MTLDevice argumentBuffersSupport]` tiers, compare
using `>=` to automatically handle evolution of this value in future.
Remove suspect use of early breaks in
MVKDescriptorSetLayoutBinding::initMetalResourceIndexOffsets().
Revert to using void* when padding for buffers in shader desc set structs.
Fix several typos.
2021-04-27 10:09:16 -04:00
Bill Hollings
852610735d Merge branch master into branch argument-buffers. 2021-04-26 17:51:52 -04:00
Bill Hollings
5d9d640e61
Merge pull request #1341 from billhollings/sdk-1.2.176
Update dependency libraries to match Vulkan SDK 1.2.176, and update What's New document.
2021-04-26 17:17:38 -04:00
Bill Hollings
8969e4d4a4 Update dependency libraries to match Vulkan SDK 1.2.176, and update What's New document. 2021-04-26 16:38:23 -04:00
Bill Hollings
fd7d7dabf8 MVKBitArray updates reuse pointer for data if
under 64 bits, and remove inline declarations.
2021-04-23 20:23:06 -04:00
Bill Hollings
dde1e55149 Fix memory corruption caused in tessellation pipeline
by introduction of Metal argument buffer support.

Add copy assignment operator to MVKMTLFunction, plus other objects that have
notable copy constructors: MVKBitArray, MVKShaderLibrary, MVKVulkanAPIObject.

There are still some classes that have destructors without copy and
copy assign overrides, but these are higher level classes that should
not be subject to copy or assignment by value.

Note to self: Respect the Rule of Three!
2021-04-23 14:52:55 -04:00
Bill Hollings
1b54d50ae1 Rename SPIRVToMSLConverter.mm back to SPIRVToMSLConverter.cpp
as it no longer needs to access the Metal framework directly.
2021-04-20 19:56:11 -04:00