1642 Commits

Author SHA1 Message Date
Bill Hollings
099b6de13e
Merge pull request #49 from mmaldacker/bugfix/push_constant_offset
push constant offset
2018-02-14 13:20:45 -05:00
Maximilian Maldacker
529b3d1e8e added missing break statements 2018-02-13 22:54:03 +01:00
Maximilian Maldacker
c6723a187b don't align push constant buffer (otherwise it'll overwrite other push constants) 2018-02-13 22:53:17 +01:00
Karl Schultz
c4ce08402d Disable watermark in debug builds 2018-02-13 12:47:18 -07:00
Bill Hollings
433632abc1
Merge pull request #42 from mmaldacker/bugfix/texture_synchronize
don't check if texture is coherent since it never is on macOS
2018-02-13 11:14:38 -05:00
Maximilian Maldacker
93e20e28d3 check if storage mode is not shared when checking if synchronize is needed 2018-02-13 12:39:26 +01:00
Maximilian Maldacker
dcb08d262c setup push constants for compute shaders 2018-02-08 21:36:42 +01:00
Maximilian Maldacker
c0355293c3 don't check if texture is coherent since it never is on macOS 2018-02-08 21:35:30 +01:00
Bill Hollings
5beaf7af01 Combine multiple VkCommandBuffers into a single MTLCommandBuffer. 2018-02-06 11:49:51 -05:00
Bill Hollings
6191d6731f
Merge pull request #38 from danginsburg/blit_image_fix
Fix vkCmdBlitImage between images of different sizes.
2018-02-01 16:59:53 -05:00
Dan Ginsburg
d834f4d4cd Fix vkCmdBlitImage between images of different sizes.
Fix typo that was setting the dstExtent from the source image.  This was
causing Desktop-Friendly fullscreen resolution not to render correctly
in Dota.
2018-02-01 14:55:56 -05:00
Bill Hollings
98b050e6e2 Update copyright dates to 2018. 2018-01-31 16:57:59 -05:00
Bill Hollings
13687d1a57 Updates to Metal resource locking.
MVKBufferView add lock when creating MTLTexture.
MVKDeviceMemory add lock when creating MTLBuffer during memory mapping.
MVKMTLBufferAllocator does not need to be threadsafe.
Cleanup syntax on other lock handling to add consistency.
2018-01-31 13:43:19 -05:00
Bill Hollings
a1b5ea5494
Merge pull request #35 from danginsburg/issue_34
Closes issue #34 - fix Metal validation error with a renderpass with …
2018-01-31 11:51:56 -05:00
Dan Ginsburg
a46855ecfd Closes issue #34 - fix Metal validation error with a renderpass with no depth attachment
If there is no depth attachment, Metal Validation will give the
following error: "validateDepthStencilState:3657: failed assertion
`MTLDepthStencilDescriptor sets depth test but MTLRenderPassDescriptor
has a nil depthAttachment texture'".  Fix by checking the current
subpass to see if there is a depth/stencil attachment, and if not use a
depth/stencil state with depth test always, depth write disabled, and no
stencil state.
2018-01-31 11:03:24 -05:00
Dan Ginsburg
640c989a20 Address feedback from pull request review
* Move mutex lock in MVKBuffer::getMTLBuffer() to be after checking
MVKDeviceMemory::getMTLBuffer() so we don't always lock in that case
* Fix comment I put in the wrong place in previous commit
2018-01-31 09:07:45 -05:00
Dan Ginsburg
6d50a88178 Fix intermittent corruption uploading textures in Dota 2.
The problem was that MVKBuffer::getMTLBuffer() was not thread-safe.  If
multiple threads called it at the same time, more than one underlying
_mtlBuffer would be created.  This could make the vkCmdCopyBufferToImage
copy from an unfilled buffer leaving the texture corrupted.  I also
added similar thread safety to MVKImage::getMTLTexture() and
MVKImageView::getMTLTexture() since they both looked like they would
have the same potential problem.
2018-01-30 12:28:14 -05:00
Bill Hollings
e8e75f480e Enhance viewport and scissor handling.
In debug mode, ensure scissors fit inside renderpass area to avoid Metal validation assertions.
Consolidate setting of viewport and scissors by pipeline and command.
2018-01-30 11:00:50 -05:00
Bill Hollings
856f5ebc36 Allow color attachment when clearing depth only. 2018-01-29 15:46:49 -05:00
Bill Hollings
c3ac62ecd7 GPU management.
Log which GPU is attached to a VkDevice.
Sort multiple GPU's to put higher-power GPU's at front of list.
Use pipelineStatisticsQuery feature to determine whether pipeline stats are available.
Update to latest SPIRV-Cross.
2018-01-29 11:57:14 -05:00
Dan Ginsburg
85f7a99523 Closes issue #7. Support DXT1 RGB texture compression. 2018-01-24 11:02:25 -05:00
Bill Hollings
b2644ad909 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2018-01-23 22:21:28 -05:00
Bill Hollings
67abb772f5
Merge pull request #26 from danginsburg/bind_image_memory_crash
Fix vkBindImageMemory crash when multiple simultaneous threads are bi…
2018-01-23 22:19:26 -05:00
Bill Hollings
89e1c92845 Retrieve heap size from MTLDevice on macOS and from free shared system memory on iOS. 2018-01-23 22:06:43 -05:00
Dan Ginsburg
9105bf58cd Use MTLDevice recommendedMaxWorkingSetSize to set the heap size rather than leaving it at 0 (on macOS). recommenededMaxWorkingSetSize does not exist on iOS so for iOS continue to leave it at 0 for now. 2018-01-23 15:16:07 -05:00
Dan Ginsburg
47952be008 Fix vkBindImageMemory crash when multiple simultaneous threads are binding to different offsets in the of the same VkDeviceMemory. The _resources vector inside of MVKDeviceMemory was not mutex protected which could cause it to become corrupted on simulaneous access. Add mutex protection. 2018-01-23 13:47:02 -05:00
Bill Hollings
89bd4b7413
Merge pull request #23 from danginsburg/issue_22_fix
Closes #22. Fix "Game Rendering Quality" slider and Pause (F9) in dota2
2018-01-18 13:17:09 -05:00
Bill Hollings
df48f0ff58
Merge pull request #20 from danginsburg/issue_19_fix
Closes issue #19.  The problem was that MVKRenderPass was ignoring VK…
2018-01-18 11:21:35 -05:00
Bill Hollings
22390372ce
Merge pull request #18 from danginsburg/image_view_attachment_bug
Closes issue #17.  Modify MVKImageView::populateMTLRenderPassAttachme…
2018-01-18 11:20:06 -05:00
Bill Hollings
4cffdc449e Allow color attachment on depth-only rendering.
SPIR-V use initializer list for composite initializations.
2018-01-18 10:58:04 -05:00
Dan Ginsburg
12736f5956 Remove accidental inclusion of other fix. 2018-01-16 10:31:29 -05:00
Dan Ginsburg
79c4658ed6 Closes #22. Fix "Game Rendering Quality" slider and Pause (F9) in dota2:
* In the case of vkCmdBlitImage with formats that don't match, use the Metal Blit render path and don't return an error.
* Fix MvkCmdBlitImage::populateVertices which had the source and destination y shifted.
2018-01-16 10:29:24 -05:00
Dan Ginsburg
893894ae5f Closes issue #19. The problem was that MVKRenderPass was ignoring VKAttachmentDescription.stencil[Load|Store]Op and was instead using the regular [load|store]Op for the stencil attachment. This fixes water reflections/refractions not rendering correctly in Dota 2. 2018-01-12 12:31:17 -05:00
Dan Ginsburg
e4d8f5afa6 Closes issue #17. Modify MVKImageView::populateMTLRenderPassAttachmentDescriptor and MVKImageView::populateMTLRenderPassAttachmentDescriptorResolve to use the MTLTextureView rather than MTLTexture. This makes sure that the texture view with the correct format is used for the renderpass. For example, in the case of a mutable image with sRGB and UNORM format, the correct format will be used for the renderpass attachment. 2018-01-12 09:20:47 -05:00
Bill Hollings
9c4d66d7a6 Add Vulkan Loader and Validation Layer ICD JSON file. 2018-01-09 21:12:02 -05:00
Bill Hollings
9a6c7f0711 Add support for Vulkan Loader and Validation Layer API version 5.
Update to latest SPIRV-Cross and Vulkan-LVL versions.
2018-01-09 15:38:14 -05:00
Bill Hollings
03f865ea96 SPIR-V enhancements.
Fix OOM conditions with multiple consecutive two-vector OpVectorShuffles.
Support non-square row-major matrix conversions.
Add ability to write SPIR-V to file for debugging purposes.
Update ThirdPartyConfig.md to latest use of SPIRV-Cross testability.
Update to latest SPIRV-Cross version.
2018-01-08 21:44:46 -05:00
Bill Hollings
9b185a9c3a Fixes to compute workgroup sizes and barriers.
Improved extraction of entry point name and workgroup size from SPIR-V.
Consolidate to a single ThirdPartyConfig.md document.
MSL enhancements to nested function use of globals.
Support customizing MSL based on iOS or macOS platform.
MSL threadgroup barrier memory scope only on iOS MSL 2.0.
Update to latest SPIRV libraries.
2017-12-26 22:20:20 -05:00
Bill Hollings
83f96078ec Add support for LunarG Vulkan Loader ICD API.
Return Loader-compatible structure for dispatchable Vulkan objects.
Add Vulkan-LoaderAndValidationLayers repository as submodule.
2017-12-21 10:48:51 -05:00
Bill Hollings
150b06a189 Don't log error from vkGetPhysicalDeviceFormatProperties() if format not supported.
Fix MoltenVK version logging.
Update to latest SPRIV-Cross.
2017-12-14 20:54:39 -05:00
Bill Hollings
780d3efe62 Updates and fixes to dynamic library creation process.
Use clang instead of libtool for building dynamic library from static library.
Fix SDK issue when building dylib with Xcode 9 on Sierra.
Add scripts to update submodules to latest versions.
Update to latest versions of submodules.
Remove Brenwill code signing IDs from Demo projects.
2017-11-26 15:37:55 -05:00
Bill Hollings
fd7b8234f9 Initial open-source commit. 2017-11-17 11:14:29 -05:00