987 Commits

Author SHA1 Message Date
Bill Hollings
d95ea7e9a7
Merge pull request #554 from danginsburg/render_area_offset_fix
Fix https://github.com/KhronosGroup/MoltenVK/issues/553 by making the…
2019-03-29 15:16:19 -04:00
danginsburg
7199c2570b Fix https://github.com/KhronosGroup/MoltenVK/issues/553 by making the Metal renderpass descriptor width/height clamped to the renderArea including the offset, not just the extent. 2019-03-29 14:32:27 -04:00
Bill Hollings
3437621f90
Merge pull request #552 from billhollings/master
MSL: Fix crash where variable storage buffer pointers are passed down.
2019-03-29 14:31:48 -04:00
Bill Hollings
4183a6489b
Merge branch 'master' into master 2019-03-29 13:06:00 -04:00
Bill Hollings
6eedbbf5c2
Merge pull request #550 from HansKristian-Work/override-spirv-cross-namespace
Override namespace for SPIRV-Cross.
2019-03-29 12:40:52 -04:00
Hans-Kristian Arntzen
38edfdb3de Override namespace for SPIRV-Cross.
Some projects also link against SPIRV-Cross statically, and in order to
avoid ABI conflicts, we should use a private namespace for the
SPIRV-Cross dependency to avoid bugs. See SPIRV-Cross issue #902 for
more information. The new namespace is MVK_spirv_cross, and the code
now makes use of the SPIRV_CROSS_NAMESPACE macro rather than spirv_cross.
2019-03-29 11:34:55 +01:00
Bill Hollings
0f22e2a70e MSL: Fix crash where variable storage buffer pointers are passed down.
Explicitly build dSYM files in BUILT_PRODUCTS_DIR
to avoid conflict between macOS and iOS build locations.
Update to latest SPIRV-Cross version.
2019-03-28 11:58:05 -04:00
Bill Hollings
9536538035
Merge pull request #547 from HansKristian-Work/vkcmdfillbuffer-offset-crash
Fix wrong offset for vkCmdFillBuffer on VK_WHOLE_SIZE.
2019-03-27 22:46:55 -04:00
Bill Hollings
29f32a3e4c
Merge pull request #545 from cdavis5e/fix-private-buffer-views
Set options properly on a buffer view's MTLTextureDescriptor.
2019-03-27 22:44:57 -04:00
Bill Hollings
cb283a0918
Merge pull request #543 from billhollings/master
CTS fixes. MVKPushConstantsCommandEncoderState compute / tessellation conflict.
2019-03-27 22:44:42 -04:00
Chip Davis
354dc32fb9 Set options properly on a buffer view's MTLTextureDescriptor.
The resource options must match between an `MTLBuffer` and any linear
texture created from it. Further, to be writable, the
`MTLTextureDescriptor` should have the `MTLTextureUsageShaderWrite` bit
set.

Fixes #542.
2019-03-27 13:56:42 -05:00
Hans-Kristian Arntzen
bfd4d182cd Fix wrong offset for vkCmdFillBuffer on VK_WHOLE_SIZE.
A double offset would be applied, causing the word count to wrap around
and trigger an assertion and GPU lockup.
2019-03-27 19:56:35 +01:00
Bill Hollings
32137e6da9 Fixed crash within MVKPushConstantsCommandEncoderState when accessing absent
graphics pipeline during a compute stage.

MVKPushConstantsCommandEncoderState test for tessellation only during graphics stages.
Guard against possible missing graphics pipeline even during graphics stages.
2019-03-27 12:40:58 -04:00
Bill Hollings
f31a56a93c Support null device in MVKBaseDeviceObject and MVKDispatchableDeviceObject instances. 2019-03-26 16:49:23 -04:00
Bill Hollings
ccdfa67a7b
Merge pull request #539 from billhollings/master
Fix PVRTC texture content loading via memory mapping.
2019-03-26 15:06:23 -04:00
Bill Hollings
b3240794fc Fix PVRTC texture content loading via memory mapping.
MoltenVK_Runtime_UserGuide.md: Add limitation explanation
about loading PVRTC using host-visible memory only.
Update What's New document.
2019-03-26 13:31:26 -04:00
Bill Hollings
e4d96f6fa2 Support Xcode 10.2. 2019-03-26 11:50:39 -04:00
Bill Hollings
89a3a511c5
Merge pull request #538 from billhollings/master
Track enabled device features and clean up sparse binding errors.
2019-03-25 22:48:57 -04:00
Bill Hollings
91f78b6bea Add support for tracking device features enabled during vkCreateDevice().
Enable device features based on content of pCreateDeviceInfo.
Validate requested features are available and return  if not.
Support returning error from vkCreateDevice(), vkFlushMappedMemoryRanges()
and vkInvalidateMappedMemoryRanges().
Update What's New Document.
2019-03-25 19:58:36 -04:00
Bill Hollings
cc2dd1cc21 Clean up sparse binding functions.
Remove "unimplemented" error reporting from sparse binding functions.
As per Vulkan spec, sparse binding query functions simply return zero responses.
vkQueueBindSparse() returns VK_ERROR_FEATURE_NOT_PRESENT error.
2019-03-25 11:48:48 -04:00
Bill Hollings
e771f79d5c
Merge pull request #537 from billhollings/master
Project build enhancements, and MoltenVKShaderConverter tool now validates converted MSL with a test compilation.
2019-03-22 20:31:49 -04:00
Bill Hollings
0ac1edbac0 Project build enhancements, and MoltenVKShaderConverter
tool now validates converted MSL with a test compilation.

Project build scripts now build dylib and framework in separate build directories
to enable MoltenVKShaderConverter to link to static library instead of dynamic library.
Final Package structure remains the same.
In Debug build, copy dylib dSYM files to Package.
Package/Latest directory now links relative to local Debug or Release directory.
Add install option to Makefile.
MoltenVKShaderConverter tool now validates converted MSL with a test compilation.
Clean up various MSL conversion and compilation error logging.
MVKCommandResourceFactory wrap Metal library compile with autorelease pool.
Build ExternalDependencies with same symbol hiding as MoltenVK to suppress visibility warnings.
Update What's New document.
2019-03-22 19:36:21 -04:00
Bill Hollings
fbc66c1ea3
Merge pull request #536 from cdavis5e/tess-shader-push-const
Fix updating push constants for tessellation shaders.
2019-03-22 17:53:25 -04:00
Chip Davis
316429225a Fix updating push constants for tessellation shaders.
Missed this when I was initially implementing this.
2019-03-22 12:57:09 -05:00
Bill Hollings
8bbbb442b5
Merge pull request #534 from cdavis5e/unneeded-check
vkCmdBlitImage: Remove check for invalid behavior.
2019-03-22 09:38:43 -04:00
Chip Davis
4b0d84e576 vkCmdBlitImage: Remove check for invalid behavior.
According to the Vulkan spec:

> * If either of `srcImage` or `dstImage` was created with a
>   depth/stencil format, the other **must** have exactly the same format

So this should not happen in well-behaved clients.
2019-03-21 15:45:08 -05:00
Bill Hollings
9a14df85af
Merge pull request #532 from billhollings/master
Add correct function entry point handling.
2019-03-21 10:27:34 -04:00
Bill Hollings
bdaf306233 Update VK_KHR_swapchain and VK_KHR_get_surface_capabilities2 extensions.
Add support for VK_KHR_get_surface_capabilities2 extension.
Implement newer VK_KHR_swapchain extension functions.
Fix when the following functions return VK_INCOMPLETE:
    vkGetPhysicalDeviceSurfaceFormatsKHR()
    vkGetSwapchainImagesKHR()
    vkEnumeratePhysicalDevices()
    vkEnumerateInstanceLayerProperties()
    vkGetPhysicalDeviceQueueFamilyProperties()
CTS: Pass supported *.macos.surface.* and *.macos.swapchain.* tests.
Update What's New document.
2019-03-21 08:53:18 -04:00
Bill Hollings
522f3ad0d4 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2019-03-21 07:07:31 -04:00
Bill Hollings
7dfce32a43
Merge pull request #529 from cdavis5e/ios-no-stg-image-array
MVKDevice: Don't enable the shaderStorageImageArrayDynamicIndexing feature on iOS.
2019-03-20 12:52:22 -04:00
Chip Davis
06babd1cdb Move feature setting into the macOS-specific block. 2019-03-20 10:31:58 -05:00
Chip Davis
0a44de3889 MVKDevice: Don't enable the shaderStorageImageArrayDynamicIndexing feature on iOS.
iOS does not actually support arrays of writable textures. At all.
2019-03-20 09:59:51 -05:00
Bill Hollings
614ac65933 Add correct function entry point handling.
Add MVKEntryPoint struct to track entry points as
instance vs device, and core vs enabled extensions.
Add stubs for newer VK_KHR_swapchain functions.
Pass CTS dEQP-VK.api.version_check.entry_points.
Update What's New document.
2019-03-19 16:43:04 -04:00
Bill Hollings
b97992ffd9
Merge pull request #528 from cdavis5e/host-query-reset
Support the VK_EXT_host_query_reset extension.
2019-03-18 13:41:28 -04:00
Chip Davis
4468f36bc6 Support the VK_EXT_host_query_reset extension.
This allows clients to reset query pools on the host, instead of with a
GPU command.

This updates Vulkan headers to 1.1.104... but, there's a problem. This
change has not been merged to `master` in the `Vulkan-Headers` repo yet,
because of an issue building the C++ binding headers. Luckily, we only
need the core C header.
2019-03-17 19:59:15 -05:00
Bill Hollings
d42d7aac79
Merge pull request #526 from billhollings/master
Update to latest SPIRV-Cross version.
2019-03-16 10:06:34 -04:00
Bill Hollings
19576e031b Update to latest SPIRV-Cross version. 2019-03-16 09:29:17 -04:00
Bill Hollings
26772d5ed7
Merge pull request #525 from billhollings/master
Update to latest SPIRV-Cross version.
2019-03-16 08:41:46 -04:00
Bill Hollings
a2b1e04e8d Update to latest SPIRV-Cross version.
Adapt to API changes resulting from the introduction of the SPIRV-Cross C API.
Update What's New document.
2019-03-15 20:25:55 -04:00
Bill Hollings
0a536b2747
Merge pull request #508 from cdavis5e/tessellation
Add support for tessellation.
2019-03-15 16:39:45 -04:00
Bill Hollings
caba1186e4
Merge branch 'master' into tessellation 2019-03-15 16:11:11 -04:00
Bill Hollings
1b941bf75b
Merge pull request #522 from billhollings/master
Allow zero offset and stride combo in VkVertexInputBindingDescription.
2019-03-14 18:34:31 -04:00
Bill Hollings
e13444e305 Allow zero offset and stride combo in VkVertexInputBindingDescription.
Also fix memory overrun if no VB found with same binding as a VA.
2019-03-14 17:50:20 -04:00
Bill Hollings
e5ebf069ee
Merge pull request #521 from billhollings/master
Fix potential memory leak on synchronous command buffer submission.
2019-03-12 21:19:03 -04:00
Bill Hollings
05b14366da Use autorelease pool for synchronous command buffer submissions also. 2019-03-12 17:36:01 -04:00
Chip Davis
6061614895 Fix case where all attributes are skipped.
If none of the attributes in a buffer is used but still present, then
the offset will be non-zero, leading us to set a non-zero stride for a
vertex buffer that is not used. This is invalid.

Fixes tessellation in Final Fantasy XIV.
2019-03-11 14:19:49 -05:00
Chip Davis
d50e654acd Fix a possible race condition around MVKMTLBufferAllocation.
I don't think a race is actually possible here, but this makes Thread
Sanitizer happy.
2019-03-11 14:19:49 -05:00
Chip Davis
a1be5a37d3 Fix broken indirect non-tessellated draws. 2019-03-11 14:19:49 -05:00
Chip Davis
d7e0167b43 Fix more brokenness. 2019-03-11 14:19:49 -05:00
Chip Davis
1069786f25 Fix a broken change from the last commit. 2019-03-11 14:19:49 -05:00