2311 Commits

Author SHA1 Message Date
Bill Hollings
269fca63ba Upgrade project builds to use C++17. 2021-06-14 10:39:42 -04:00
Bill Hollings
ef34fb7f37 Set project build optimizations to -O2 for all Release mode builds. 2021-06-10 18:32:38 -04:00
Bill Hollings
bb7b46be0f MoltenVKShaderConverter build fixes.
Remove #include "SPIRVReflection.h" from SPIRVToMSLConverter.h.
Remove MoltenVKShaderConverter/Common and move contained files to
MoltenVKShaderConverter/MoltenVKShaderConverter.
2021-06-10 15:56:58 -04:00
Bill Hollings
b74040a93d
Merge pull request #1375 from billhollings/begin-renderpass-fixes
Begin renderpass fixes
2021-06-01 23:04:53 -04:00
Bill Hollings
db056e36f7 Pass attachments to MVKBeginRenderPass::setContents() as an MVKArrayRef.
MVKBeginRenderPass::setContents() use MVKSmallVector::assign()
to add attachments and clear colors.
MVKFramebuffer add getAttachments() and remove getAttachment()
and getAttachmentCount().
2021-06-01 12:40:26 -04:00
Bill Hollings
8eaf065aa0 Derive MVKCmdBeginRenderPass attachment count and imageless status once. 2021-05-31 22:30:54 -04:00
Bill Hollings
a73f10a35d Consolidate vkCmdBeginRenderPass() and vkCmdBeginRenderPass2KHR() handling.
Add mvkCmdBeginRenderPass() and call from both
vkCmdBeginRenderPass() and vkCmdBeginRenderPass2KHR().
MVKCmdBeginRenderPassBase and MVKCmdBeginRenderPassBase
constructors pass VkSubpassBeginInfo.
Remove overloaded MVKCmdBeginRenderPassBase::setContent().
2021-05-31 22:08:11 -04:00
Bill Hollings
51188ace2c Clear attachments in MVKCmdBeginRenderPass between invocations.
Fixes crash due to incorrect number of attachments.
Update What's New document with VK_KHR_imageless_framebuffer extension.
2021-05-31 21:31:30 -04:00
Bill Hollings
1f29e4e599
Merge pull request #1373 from billhollings/memoryless-fixes
Fix crash using memoryless storage for input attachments on Apple Silicon.
2021-05-31 20:23:42 -04:00
Bill Hollings
776719106c Fix crash using memoryless storage for input attachments on Apple Silicon.
Don't allow memoryless storage for VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT.
Memoryless storage for VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT descriptors
requires support for, and use of, shader framebuffer fetch.

Remove compile-time checking for MVK_APPLE_SILICON before disabling memoryless storage
for buffers and images, since the requirement exists for all platforms, and memoryless
storage will already otherwise be disabled on other platforms anyway.
2021-05-31 17:20:35 -04:00
Bill Hollings
e06eb3a892
Merge pull request #1370 from f32by/imageless_framebuffer
Support the VK_KHR_imageless_framebuffer extension.
2021-05-31 13:20:24 -04:00
UnsafeBy
6fe4cc5e13 Add MVKCmdBeginRenderPass template specializations for 2 framebuffer attachments. 2021-05-31 14:11:13 +08:00
UnsafeBy
d402a3265f Implement iterator-based assign() in pointer verion of MVKSmallVectorImpl. 2021-05-30 11:06:17 +08:00
Bill Hollings
0973096add
Merge pull request #1368 from ahelpingchip/fix-docs-typos
Fix minor typos in docs
2021-05-29 16:21:55 -04:00
Bill Hollings
3a2a92763d
Merge pull request #1369 from billhollings/mtlcmdbuff-labels
Add label strings to MTLCommandBuffers, based on use type, for GPU Capture debugging.
2021-05-29 16:21:16 -04:00
UnsafeBy
703cdcf332 Update: support the VK_KHR_imageless_framebuffer extension.
Remove framebuffer reference in MVKCommandEncoder. Instead,
1) non-imageless: copy the attachment vector from
   VkFramebufferCreateInfo if it does not contain the
   VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT_KHR flag.
or
2) imageless: copy the attachment vector from
   VkRenderPassAttachmentBeginInfo when calling
   vkBeginRenderPass/vkBeginRenderPass2.
2021-05-29 11:59:42 +08:00
UnsafeBy
c49ad89ffa
Update MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm
Co-authored-by: Chip Davis <cdavis@codeweavers.com>
2021-05-29 10:00:27 +08:00
UnsafeBy
797b92e606
Update MoltenVK/MoltenVK/Commands/MVKCommandBuffer.h
Co-authored-by: Chip Davis <cdavis@codeweavers.com>
2021-05-29 10:00:19 +08:00
UnsafeBy
a723dc1f21 Support the VK_KHR_imageless_framebuffer extension.
I'm not sure this is the elegant way but it works in my own
project:)
2021-05-28 23:28:20 +08:00
Bill Hollings
5f4c4b257f Add label strings to MTLCommandBuffers, based on use type, for GPU Capture debugging.
Extend MVKCommandUse enum to identify additional command buffer uses.
MVKQueueCommandBufferSubmission track use type.
MVKQueue pass use type in functions that result in creation of a MTLCommandBuffer.
Add mvkMTLCommandBufferLabel() to map use types to label strings.
2021-05-27 18:15:27 -04:00
Philip Cheang
c70790bf0f
Fix minor typos in What's New 2021-05-28 02:18:48 +08:00
Philip Cheang
76abba6199
Fix minor typos in User Guide. 2021-05-28 02:02:15 +08:00
Bill Hollings
102037491a
Merge pull request #1367 from billhollings/device-loss-fixes
Device loss fixes
2021-05-25 23:35:27 -04:00
Bill Hollings
729dd5f7d4
Minor comment typo fix.
Co-authored-by: Chip Davis <cdavis@codeweavers.com>
2021-05-25 23:14:18 -04:00
Bill Hollings
9e5ff3a614 Changes to MVKConfiguration::resumeLostDevice behavior.
On command buffer submission failure, if MVKConfiguration::resumeLostDevice enabled,
do not release waits on VkDevice, and do not return VK_ERROR_DEVICE_LOST, unless
VkPhysicalDevice is also lost.
2021-05-25 12:14:14 -04:00
Bill Hollings
f4fbc1ec23 Fix race condition on MVKQueueCommandBufferSubmission fence during device loss.
MVKQueueCommandBufferSubmission retain() and release() fence and signal semaphores
to ensure they live long enough for the submission to finish using them.
2021-05-24 18:23:12 -04:00
Bill Hollings
cafb188d6f
Merge pull request #1365 from billhollings/linear-attach-decision-fix
Fix inconsistent handling of linear attachment decisions on Apple Silicon.
2021-05-20 22:11:12 -04:00
Bill Hollings
d806530d7b
Fix syntactic typo in comment.
Co-authored-by: Chip Davis <cdavis@codeweavers.com>
2021-05-20 21:51:03 -04:00
Bill Hollings
4d2448db3f Fix inconsistent handling of linear attachment decisions on Apple Silicon. 2021-05-20 16:07:34 -04:00
Bill Hollings
6f980c3d3e
Merge pull request #1362 from billhollings/mtlargencoder-sync
Fix synchronization issue with locking MTLArgumentEncoder.
2021-05-16 09:26:53 -04:00
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