1033 Commits

Author SHA1 Message Date
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
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
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
bearishsun
4df8b92e9c Rename vkSetThreadgroupSizeMVK to vkSetWorkgroupSizeMVK to be consistent with Vulkan terminology 2019-06-07 09:59:27 +02:00
Bill Hollings
66b512c004
Merge pull request #636 from billhollings/master
Guard against missing Metal pipeline states when pipeline compilation fails.
2019-06-06 22:09:01 -04:00
Bill Hollings
907c85a54c Guard against missing Metal pipeline states when pipeline compilation fails.
MVKPipeline records whether Metal pipelines are successfully compiled.
Pipeline and draw commands check for valid Metal pipeline state before encoding.
Compute compilation operations can have custom names.
Name Tessellation control stage compute compiler for logging.
2019-06-06 18:27:43 -04:00
Bill Hollings
68573e3c93
Merge pull request #635 from BearishSun/set-threadgroup-size
Added a way to set compute kernel threadgroup size.
2019-06-06 17:32:02 -04:00
bearishsun
7f5a70d802 Added a way to set compute kernel threadgroup size when using MSL source code or MSL compiled code 2019-06-06 11:19:41 +02:00
Bill Hollings
606f499f1f
Merge pull request #633 from billhollings/master
VkSemaphore optionally uses MTLEvent, if available and MVK_ALLOW_METAL_EVENTS environment variable is enabled.
2019-06-05 15:21:27 -04:00
Bill Hollings
673788cba8 VkSemaphore optionally uses MTLEvent, if available and
MVK_ALLOW_METAL_EVENTS environment variable is enabled.
2019-06-05 11:23:46 -04:00
Bill Hollings
1182d822a6
Merge pull request #626 from billhollings/master
Fix crash on pipeline cache merge after VkShaderModule destroyed.
2019-05-30 22:39:36 -04:00
Bill Hollings
70b78ac7fa Fix crash on pipeline cache merge after VkShaderModule destroyed.
Set MTLFunction label immediately after creation from MVKShaderModule.
Remove _shaderModule reference from MVKShaderLibrary & MVKShaderLibraryCache.
No-op propogateDebugName() function in MVKShaderModule & MVKPipelineCache.
2019-05-30 17:53:11 -04:00
Bill Hollings
97a1f68069
Merge pull request #624 from billhollings/master
Add support for the VK_EXT_debug_utils extension.
2019-05-30 00:54:45 -04:00
Bill Hollings
3e069c4a78 Add support for the VK_EXT_debug_utils extension.
Dispatch messenger callbacks on any reported message or error.
Add MVKDebugUtilsMessenger class.
Add MVKVulkanAPIObject::getVkObjectType() function and override in all Vulkan API objects.
MVKDevice::getMTLPixelFormatFromVkFormat() take base object for reporting.
2019-05-29 17:26:50 -04:00
Bill Hollings
7d37d5be16
Merge pull request #623 from cdavis5e/no-viewports-assertion
Don't assert if no viewports or scissor rects were given.
2019-05-29 13:00:43 -04:00
Bill Hollings
2e36a38524
Merge pull request #622 from cdavis5e/new-spirv-cross
Update SPIRV-Cross.
2019-05-29 12:59:45 -04:00
Chip Davis
edecd7e804 Don't assert if no viewports or scissor rects were given.
Instead, just avoid calling into Metal. It's perfectly valid to specify
no viewports--for example, if rasterization is disabled. Perhaps, then,
it'd be better to assert that rasterization is disabled when no
viewports are given.
2019-05-29 10:53:56 -05:00
Chip Davis
f075adc93f Update SPIRV-Cross.
This adds support for the `OpArrayLength` instruction.
2019-05-29 10:49:28 -05:00
Bill Hollings
39dd7c866a
Merge pull request #620 from billhollings/master
Fixes to VK_EXT_debug_marker extension.
2019-05-29 10:06:09 -04:00
Bill Hollings
f8a2707b21 Fixes to VK_EXT_debug_marker extension.
vkCmdDebugMarkerBegin() and vkCmdDebugMarkerEnd() attach debug
groups to render encoder if available, or command buffer if not.
Name MTLRenderCommandEncoder first after renderpass,
if named, then command buffer, if named, then usage name.
Add MVKCommandEncoder::endRenderpass() to clean up renderpass components.
MVKShaderLibrary and MVKShaderLibraryCache track shader module to
retrieve name for MTLLibrary and MTLFunction, even when cached offline.
2019-05-29 09:13:01 -04:00
Bill Hollings
7e110dfc38
Merge pull request #619 from billhollings/master
Fixes and consolidation of external library header references.
2019-05-28 17:57:39 -04:00
Bill Hollings
fbf2af58a0 Fixes and consolidation of external library header references.
All external library header references consistently include framework references.
Cleanup references to external library headers that are no longer required.
Simplify and consolidate external library header paths in Xcode projects.
Add MVK_EXCLUDE_SPIRV_TOOLS build option to avoid use of SPIRV-Tools library.
Remove all other references to headers within SPIRV-Tools library.
2019-05-28 17:19:43 -04:00
Bill Hollings
a684b47baa
Merge pull request #617 from billhollings/master
Fix offset of buffer view relative to buffer offset within device memory.
2019-05-27 21:10:06 -04:00
Bill Hollings
c2706f3e6b Fix offset of buffer view relative to buffer offset within device memory. 2019-05-27 17:56:44 -04:00
Bill Hollings
1c3130462a
Merge pull request #616 from billhollings/master
Guard against null _debugNames being used to build name strings.
2019-05-27 17:21:07 -04:00
Bill Hollings
8efebd6485 Guard against null _debugNames being used to build name strings. 2019-05-27 15:48:10 -04:00
Bill Hollings
4e4b654ed7
Merge pull request #614 from ch45er/fix/large_texel_buffer_addressing_in_CS
Added missing texelBufferTextureWidth setting in MVKComputePipeline::getMTLFunction.
2019-05-27 15:34:42 -04:00
Bill Hollings
e173bfe2e6
Merge pull request #612 from jozefkucia/fix-tess-level-attribute
Fix [[attribute]] assignment for tessellation evaluation shaders.
2019-05-27 13:31:14 -04:00
Sergey Cherepanov
ce492f4f54 Added missing texelBufferTextureWidth setting in MVKComputePipeline::getMTLFunction.
Fixes #589.
2019-05-27 20:29:18 +03:00
Bill Hollings
974d2db55d
Merge pull request #613 from jozefkucia/fix-dxt-decompression
Use device address space when decompressing DXT image data.
2019-05-27 12:36:19 -04:00
Józef Kucia
1f8967a617 Use device address space when decompressing DXT image data.
Buffers in constant address space must be aligned to 256 bytes on macOS.

This fixes Metal validation errors:

Compute Function(cmdCopyBufferToImage3DDecompressDXTn): the offset into the buffer src that is bound at buffer index 0 must be a multiple of 256 but was set to 12928.
Compute Function(cmdCopyBufferToImage3DDecompressDXTn): the offset into the buffer src that is bound at buffer index 0 must be a multiple of 256 but was set to 78464.
2019-05-27 12:42:11 +02:00
Józef Kucia
b8abc58b7e Fix [[attribute]] assignment for tessellation evaluation shaders.
This is needed for TessLevelInner and TessLevelOuter in tessellation evaluation
shaders.

Fixes dEQP-VK.tessellation.shader_input_output.tess_level_inner_0_tes.
2019-05-26 13:41:28 +02:00
Bill Hollings
6b556a9625
Merge pull request #608 from billhollings/master
Add support for VK_EXT_debug_marker extension.
2019-05-25 16:54:01 -04:00
Bill Hollings
8d9fa6bbd5 Add support for VK_EXT_debug_marker extension.
Move MVKVulkanAPIObject to its own .h/mm files.
Add MVKCmdDebug.h/mm files.
Change extension on MVKExtensions.cpp and MVKBaseObject.cpp to .mm.
Remove unused command use in MVKQueue submit() and waitIdle() functions.
MVKCommandPool constructor use default isPooling value in MVKCommandTypePool constructors.
MVKSwapchainImage pass image index in constructor.
2019-05-25 16:23:05 -04:00
Bill Hollings
d1aba9ae8b
Merge pull request #606 from billhollings/master
Fix sporadic crash on vkDestroySwapchainKHR().
2019-05-20 16:54:02 -04:00
Bill Hollings
b773e7aaab Fix sporadic crash on vkDestroySwapchainKHR().
MVKSwapchain & MVKSurface init _layerObserver to nil.
2019-05-20 16:13:52 -04:00
Bill Hollings
ffa9ca1b3c
Merge pull request #605 from billhollings/master
Clear attachments using layered rendering only if framebuffer is layered.
2019-05-15 23:18:40 -04:00
Bill Hollings
2da855a6bc Clear attachments using layered rendering only if framebuffer is layered.
Consolidate testing of subpass layered rendering.
Add MVKCommandEncoder _isUsingLayeredRendering member variable.
Track layered rendering enabled in MVKRPSKeyClearAtt.
Rename MVKRPSKeyClearAtt::enable() and ::isEnabled() functions.
Add MVKRPSKeyClearAtt::reset() function.
Consolidate viewport, scissor & attachment limits.
MVKImage add validation for layered rendering when used as attachment.
2019-05-15 22:40:47 -04:00
Bill Hollings
e80b535526
Merge pull request #604 from billhollings/master
Fixes to Metal renderpass layered rendering settings.
2019-05-15 16:43:58 -04:00
Bill Hollings
a52b984a31 Fixes to Metal renderpass layered rendering settings.
Only set MTLRenderPassDescriptor layered rendering properties if layered rendering
is supported and the framebuffer really has multiple layers.
MVKCmdClearImage don't set renderTargetArrayLength, since layers are cleared individually.
Update highest available MTLFeatureSets for use in pipelineCacheUUID.
2019-05-15 15:08:17 -04:00
Bill Hollings
e2f7654d1b
Merge pull request #603 from billhollings/master
Fix crash with multisample layered rendering on older macOS devices.
2019-05-15 13:08:26 -04:00