1221 Commits

Author SHA1 Message Date
Bill Hollings
8cbc951cc3 Texture memory requirements don't use shared storage on macOS.
MVKBuffer getMemoryRequirements() ensure texel buffers don't use shared memory.
MVKImage getMemoryRequirements() ensure textures don't use shared memory.
MVKBufferView set MTLTexture storageMode & cpuCacheMode directly from MTLBuffer.
2019-07-12 17:00:18 -04:00
Bill Hollings
608028a291 MVKDeviceMemory keep MTLResourceOptions aligned with MTLStorageMode & MTLCPUCacheMode. 2019-07-12 15:20:05 -04:00
Bill Hollings
f01434ebb1 MVKCmdClearImage return error if texture is not renderable. 2019-07-12 14:40:23 -04:00
Bill Hollings
11c96c4d03
Merge pull request #660 from billhollings/master
Move push constant binding to vkCmdBindPipeline() from vkCmdBindDescriptorSet().
2019-07-10 18:31:23 -04:00
Bill Hollings
f46575df60 Move push constant binding to vkCmdBindPipeline() from vkCmdBindDescriptorSet(). 2019-07-10 17:53:44 -04:00
Bill Hollings
9c635d23e7
Merge pull request #659 from billhollings/master
MVKCmdBlitImage clear _mvkImageBlitRenders vector on reuse.
2019-07-10 11:23:32 -04:00
Bill Hollings
04c7e4e8f0 MVKCmdBlitImage clear _mvkImageBlitRenders vector on reuse. 2019-07-10 10:46:48 -04:00
Bill Hollings
79f4c41905
Merge pull request #656 from billhollings/master
Multiple fixes to image copy, BLIT, and resolve (CTS)
2019-07-09 22:58:13 -04:00
Bill Hollings
d926424bfe MVKCmdResolveImage support textures of different sizes. 2019-07-09 17:56:10 -04:00
Bill Hollings
e35426d4c3 MVKCmdBlitImage support multisample textures.
MVKCmdCopyImage track src & dest sample counts.
MVKRPSKeyBlitImg track dest sample count.
2019-07-09 17:16:42 -04:00
Bill Hollings
5289d10746 MVKCmdBlitImage support blit between different texture formats.
MVKRPSKeyBlitImg track both src and dst texture formats.
MVKCmdCopyImage fix copyable comparison.
2019-07-09 15:45:16 -04:00
Bill Hollings
4915b1ec0c Allow MVKCmdBlitImage to use texture view and image->buffer->image copying
from parent MVKCmdCopyImage class.

Refactor MVKCmdCopyImage & MVKCmdBlitImage to hold corresponding Vulkan structs.
MVKCommandResourceFactory::getBlitFragFunction() only pass srcSlice.
2019-07-09 10:14:42 -04:00
Bill Hollings
5b7038b21d vkCmdCopyImage() adjust dest extent when copying from compressed to uncompressed images.
Add MVKImage::getIsCompressed().
MVKPhysicalDevice::getImageFormatProperties() optimize use of mvkFormatTypeFromVkFormat().
2019-07-08 22:28:33 -04:00
Bill Hollings
35d40a83b0 vkCmdCopyImage() support copying between compressed and uncompressed formats. 2019-07-05 19:39:52 -04:00
Bill Hollings
5e0214d3e1 MVKCmdBufferImageCopy don't supply bytes per image if not array texture.
MVKRPSKeyBlitImg::isArrayType() include multisample array type.
Clean up formatting in texture type functions in mvk_datatypes.mm.
2019-07-05 11:21:23 -04:00
Bill Hollings
c593cebce5 MVKCmdCopyImage validate that formats are compatible for copying.
MVKCmdBlitImage use same validation to use direct copy when possible.
2019-07-04 19:19:11 -04:00
Bill Hollings
423944d01e Rename mvkAreFlagsEnabled() & mvkAreOnlyAnyFlagsEnabled()
functions for consistency with similar functions.
2019-07-04 16:08:12 -04:00
Bill Hollings
74e38659aa Set Metal texture usage to allow texture copy via view.
MVKCmdCopyImage uses texture view if formats different. Enable
MTLTextureUsagePixelFormatView for VK_IMAGE_USAGE_TRANSFER_SRC_BIT.
Refactor mvkMTLTextureUsageFromVkImageUsageFlags() to clarify Metal usages
and enable views on depth-stencil attachments by default.
2019-07-04 15:50:12 -04:00
Bill Hollings
46bea62230
Merge pull request #654 from billhollings/master
Support VK_EXT_metal_surface extension.
2019-07-03 23:53:41 -04:00
Bill Hollings
aa6a10570a Support VK_EXT_metal_surface extension.
Modify demo apps to pass OS layer instead of view.
2019-07-03 20:23:43 -04:00
Bill Hollings
4115d8ad3e
Merge pull request #652 from billhollings/master
Fix race condition between swapchain image destruction and presentation completion callback
2019-06-30 18:18:01 -04:00
Bill Hollings
8df685a9dc Fix race condition between swapchain image destruction and presentation completion callback.
Retain MVKSwapchainImage before passing to MTLCommandBuffer completion handler.
Redesign MVKVulkanAPIObject retain/release functionality using atomic ref count
instead of mutex locks, to simplify design and improve performance.
2019-06-30 17:28:52 -04:00
Bill Hollings
a5cefa5c98
Merge pull request #650 from billhollings/master
For shaders created directly from MSL, set function name from VkPipelineShaderStageCreateInfo::pName
2019-06-30 12:14:31 -04:00
Bill Hollings
fb4dd158d0 Document each function in vk_mvk_moltenvk.h to indicate they cannot be used
with objects retrieved through the Vulkan SDK Loader and Layers framework.
2019-06-30 11:16:08 -04:00
Bill Hollings
7c71263f98 Add note in MoltenVK_Runtime_UserGuide.md that the functions in vk_mvk_moltenvk.h cannot
be used with objects retrieved through the Vulkan SDK Loader and Layers framework.
2019-06-29 19:55:07 -04:00
Bill Hollings
1b4124d4aa For shaders created directly from MSL, set function name from
VkPipelineShaderStageCreateInfo::pName.
2019-06-29 19:18:32 -04:00
Bill Hollings
84ea825ea3 Separate SPIRVToMSLConverterContext into input config and output results.
Refactor SPIRVToMSLConverterContext into distinct SPIRVToMSLConversionConfiguration
and SPIRVToMSLConversionResults for conversion input and output, respectively.
Update to latest SPIRV-Cross version.
Update What's New document.
2019-06-29 18:01:07 -04:00
Bill Hollings
17496c30df
Merge pull request #648 from billhollings/master
Add additional performance and call tracing options.
2019-06-24 16:58:23 -04:00
Bill Hollings
a0f0c78b34 Expand MVK_CONFIG_TRACE_VULKAN_CALLS to optionally log Vulkan call timings.
Update What's New document.
2019-06-21 22:56:13 -04:00
Bill Hollings
e6afb1fedb Add MTLCommandBuffer completion timing performance tracking option.
Add MVKPerformanceStatistics::MVKQueuePerformance::mtlCommandBufferCompletion.
Increment VK_MVK_MOLTENVK_SPEC_VERSION to 21.
2019-06-20 17:31:19 -04:00
Bill Hollings
7331535c2b
Merge pull request #646 from billhollings/master
Quick fixes for pipeline cache lookups.
2019-06-20 07:50:10 -04:00
Bill Hollings
11ca15edaa Quick fixes for pipeline cache lookups.
SPIRVToMSLConverterOptions should really be refactored into two separate config and results structs.
2019-06-19 16:23:50 -04:00
Bill Hollings
80b2068bac
Merge pull request #643 from billhollings/Metal-3.0
Sync Metal-3.0 with master
2019-06-16 15:17:23 -04:00
Bill Hollings
11482aed03 Merge branch 'master' into Metal-3.0 2019-06-16 14:35:49 -04:00
Bill Hollings
541d223c3a
Merge pull request #644 from billhollings/master
Support immutable depth compare samplers as constexpr samplers hardcoded in MSL.
2019-06-16 13:55:12 -04:00
Bill Hollings
fb076b7a97 Reapply -v option to fetchDependencies in Travis. 2019-06-16 12:17:03 -04:00
Bill Hollings
ef8de08ff1 Skip SPIRV-Tools build in Travis.
Add fetchDependencies option to skip building SPIRV-Tools and use a template of pre-generated headers.
Modify .travis.yml to use this.
2019-06-16 12:00:22 -04:00
Bill Hollings
cd1023e23f Travis set up virtualenv to use Python 3 for spirv-tools build. 2019-06-16 09:07:24 -04:00
Bill Hollings
64d7e07243 Support immutable depth compare samplers as constexpr samplers hardcoded in MSL.
On iOS GPU family 2 and earlier:
  - Allow immutable samplers to be passed to SPIRV-Cross in a format
    they can be output as hardcoded constexpr samplers in MSL.
  - Validate depth compare samplers are only used as immutable.

MVKMVKPipelineLayout & MVKDescriptorSetLayout can take null MVKCommandEncoder
to perform a validation pass when binding or pushing.
Reduce redundancy by combining SPIRVToMSLConverterContext structs
with compatible SPIRV-Cross structs.
Update MoltenVK version to 1.0.36.
2019-06-15 01:47:13 -04:00
Bill Hollings
e4466ef8db Merge branch 'master' into Metal-3.0 2019-06-14 12:11:02 -04:00
Bill Hollings
00c86d8f35
Merge pull request #642 from billhollings/master
Updates for SDK 1.1.108 release.
2019-06-13 17:51:01 -04:00
Bill Hollings
bf8c7f8bb8 Updates for SDK 1.1.108 release.
Update to latest external dependency libraries.
MVKDescriptorSetLayoutBinding allow binding of null MVKBuffer.
Update What's New document.
2019-06-13 17:11:44 -04:00
Bill Hollings
e755a17907 Report image layer limits for attachments in vkGetPhysicalDeviceImageFormatProperties(). 2019-06-13 14:30:16 -04:00
Bill Hollings
7ba7f1efef Fixes to clearning attachments.
vkCmdClearAttachments(): Return encoder to previous pipeline, depth-stencil & resource state after execution.
Fix issue clearing stencil attachment via renderpass when depth attachment is not being cleared.
2019-06-13 13:21:26 -04:00
Bill Hollings
a6d13062bf
Merge pull request #640 from jozefkucia/fix-stencil-reference-value
Mark stencil reference value as dirty in MVKCmdClearAttachment command.
2019-06-11 12:03:35 -04:00
Józef Kucia
f9399f70e1 Mark stencil reference value as dirty in MVKCmdClearAttachment command.
MVKCmdClearAttachment sets the stencil reference value to 0 and the stencil
reference value is not properly restored for subsequent draw calls.

I'm affraid there might be more similar bugs in MoltenVK.
2019-06-11 13:51:19 +02:00
Bill Hollings
510d5a5e67
Merge pull request #638 from billhollings/Metal-3.0
Initial support for Metal 3.0.
2019-06-10 16:58:17 -04:00
Bill Hollings
d4ccebd498 Support Xcode 11 in Travis CI. 2019-06-10 16:00:09 -04:00
Bill Hollings
869ba75d5d Support Metal 3.0.
Add MVKPhysicalDevice functions to support new MTLDevice methods supportsVersion: and supportsFamily:.
MVKPhysicalDevice tests for Metal 3.0 & MSL 2.2.
Move some global functions into the MVKPhysicalDevice class.
Support Xcode 11.
2019-06-09 23:42:06 -04:00
Bill Hollings
09d51d2912
Merge pull request #637 from BearishSun/set-threadgroup-size
Rename `vkSetThreadgroupSizeMVK` to `vkSetWorkgroupSizeMVK` to be con…
2019-06-07 09:42:44 -04:00