2165 Commits

Author SHA1 Message Date
Bill Hollings
ffbe364b77
Merge pull request #1238 from past-due/github_actions_xcode_legacy_1
CI enhancements - update to Xcode 12.4, add (legacy) Xcode 11.7 build
2021-02-04 12:26:41 -05:00
Bill Hollings
1735a22512
Merge pull request #1237 from billhollings/getphysicaldevice
Add MVKDeviceTrackingMixin::getPhysicalDevice() to streamline access.
2021-02-04 12:04:24 -05:00
Bill Hollings
95cf144ccf Add ability to automatically capture first GPU frame.
Refactor auto GPU capture code to support both device and frame capture.
Add ability to automatically capture first GPU frame by setting
`MVK_CONFIG_AUTO_GPU_CAPTURE_SCOPE` to `2`.
Wrap GPU capture in autorelease pool to handle both cases of capture call
being made in run loop as in an app GUI, or in one-shot app like CTS.
2021-02-04 11:56:28 -05:00
past-due
023290503d [GitHub Actions] Add "legacy" Xcode 11.7 build configuration 2021-02-03 16:00:38 -05:00
past-due
ac04d80cb9 [GitHub Actions] Update to Xcode 12.4, adjust build matrix 2021-02-03 15:59:50 -05:00
Bill Hollings
51188b5932 Add MVKDeviceTrackingMixin::getPhysicalDevice() to streamline access. 2021-02-03 14:17:53 -05:00
Bill Hollings
fcb4701f47
Merge pull request #1232 from cdavis5e/volatile-temp-buffers
MVKMTLBufferAllocation: Mark temp buffers as volatile.
2021-02-01 17:46:52 -05:00
Chip Davis
e1ac50c07e MVKMTLBufferAllocation: Mark temp buffers as volatile.
They are not expected to be useful beyond the commands that use them,
but they take up memory nonetheless. This is exactly the use case
purgeability was designed for. Tell the system that it's OK to reclaim
their memory if necessary.

Doing this every time the buffer is used will cause the purgeable state
to be reset from `MTLPurgeableStateEmpty`, in case the system really did
reclaim their memory.

In accordance with Apple's advice, lock the pages for the buffer when
loading it, so the memory isn't pulled out from under us.
2021-02-01 16:15:17 -06:00
Bill Hollings
ae347c4f6f
Merge pull request #1230 from billhollings/xc124
Update Xcode build settings to cover Xcode 12.4.
2021-02-01 15:51:30 -05:00
Bill Hollings
e5e1f65dfc Update Xcode build settings to cover Xcode 12.4. 2021-02-01 13:50:42 -05:00
Bill Hollings
6cee2fe190
Merge pull request #1229 from cdavis5e/occlusion-query-temp-buffers
MVKCommandEncoder: Use the temp buffer mechanism for visibility buffers.
2021-02-01 13:22:52 -05:00
Chip Davis
55d206e058 MVKCommandEncoder: Use the temp buffer mechanism for visibility buffers.
Add support for "dedicated" temp buffers, where instead of allocating a
big buffer and carving regions out of it, a unique buffer is returned
for each allocation request. This is necessary for visibility buffers,
because the offset passed to `-[MTLRenderCommandEncoder
setVisibilityResultMode:offset:]` cannot exceed an
implementation-defined value, currently 256k less 8 bytes for Mac family
2 on Catalina and up, and on Apple family 7; and 64k less 8 bytes
otherwise.
2021-02-01 10:41:29 -06:00
Bill Hollings
ff7737beb5
Merge pull request #1226 from billhollings/fastmath
MSL compilations settings: ffast-math and position invariance
2021-01-29 18:33:45 -05:00
Bill Hollings
a69982ef38 Add guard code for XCode 11. 2021-01-29 17:54:50 -05:00
Bill Hollings
4083dd1229 Merge branch 'master' of https://github.com/billhollings/MoltenVK into fastmath 2021-01-29 17:30:23 -05:00
Bill Hollings
05fe007de8
Merge pull request #1227 from cdavis5e/xcode-11-fixes
Fix build on Xcode 11.
2021-01-29 17:22:08 -05:00
Chip Davis
2bfb5ed77b Fix build on Xcode 11.
I missed this.
2021-01-29 14:53:03 -06:00
Bill Hollings
7ce4e0ccbb Update to latest SPIRV-Cross to query shader invariance. 2021-01-29 15:33:27 -05:00
Bill Hollings
b80a620afc
Merge pull request #1223 from cdavis5e/occlusion-query-rewrite
MVKQueryPool: Totally rework the way occlusion queries work.
2021-01-29 14:58:52 -05:00
Bill Hollings
5d00644d7f
Merge pull request #1224 from cdavis5e/mac-family-2-features
Require Mac family 2 for some features
2021-01-29 13:04:42 -05:00
Chip Davis
24c1b7276e MVKPhysicalDevice: Require Mac family 2 for quad-scope permutation.
According to the Metal Feature Set Tables, only family 2 supports
quad-scope permutation. We've been seeing issues with SIMD-group
functions on family 1 hardware, so for now I'm moving quad-group
permutation to family 2.
2021-01-28 22:07:43 -06:00
Chip Davis
592cec58fd MVKPhysicalDevice: Require Mac family 2 for render without attachments.
We've seen reports that rendering without attachments doesn't work on
family 1 GPUs. Disable it for them.
2021-01-28 22:07:43 -06:00
Chip Davis
8e8edbadb1 MVKQueryPool: Totally rework the way occlusion queries work.
Instead of having Metal directly write to the query pool's internal
storage, we'll have it write to a temp buffer whose lifetime is tied to
the command buffer. The temp buffer's contents are then accumulated to
all queries that were activated.

This last step is particularly important for queries that span multiple
render passes. Since Metal resets the query counter at a render pass
boundary, this means that, up until now, only the last draw counted
toward the query. Data from the others were lost. By using this temp
buffer and accumulating the results to the query storage, the counter
will correctly count draws from all render passes inside the query
bounds.

This will also fix problems using multiple query pools, particularly
with large query pool support on, in a single render pass. Because Metal
requires us to set the visibility results buffer at render pass start
time, we couldn't use multiple query pools inside a single render pass.
Using a single temp buffer bypasses this problem.

Also, don't make queries available to the host unless they became
available to the device first. That way, a query that is immediately
reset during command buffer execution will properly report that the
query is unavailable. This fixes the remaining dEQP-VK.query_pool.*
tests. Fix some bugs that shook out of this.
2021-01-28 16:15:26 -06:00
Bill Hollings
3e20e1a137 Support compiling MSL with position invariance if indicated in SPIRV shader.
Add SPIRVToMSLConversionResults::isPositionInvariant to query
position invariance from SPIR-V.
MVKDevice::getMTLCompileOptions() takes into consideration need to preserve invariance.
MVKShaderModule compile MSL to preserve invariance if required by shader.
2021-01-28 16:46:49 -05:00
Bill Hollings
2343c0267b Enable MSL ffast-math compilation option by default.
Support querying SignedZeroInfNanPreserve execution mode
from SPIR-V to disable fast-math for individual shaders.
Clean up namespace references in SPIRVToMSLConverter.cpp.
2021-01-28 08:05:33 -05:00
Bill Hollings
2780ba1e40
Merge pull request #1220 from billhollings/global-config
Make MVKConfiguration access global, ignoring provided VkInstance.
2021-01-27 07:22:29 -05:00
Bill Hollings
696de7a4e7 Make MVKConfiguration access global, ignoring provided VkInstance.
MVKConfiguration access is now global, and the VkInstance provided in the
vkGet/Set/MoltenVKConfigurationMVK() functions is ignored. This allows these
functions to be provided with a VkInstance object that originates from a
different Vulkan layer than MoltenVK, without risking breaking the API.

MVKConfiguration extended to cover all MoltenVK environment variables.

Move all environment variable declarations to MVKEnvironment.h.
Add MVKEnvironment.cpp to define config functions.
Cleanup .m files to use MVKCommonEnvironment.h instead of MVKEnvironment.h.
2021-01-26 17:59:13 -05:00
Bill Hollings
6c74fbf1b5
Merge pull request #1217 from billhollings/shaderInt64
Advertise support for shaderInt64 feature.
2021-01-25 22:05:43 -05:00
Bill Hollings
2fc9fcb079 Support shaderInt64 feature only on minimum MSL 2.3 and higher GPUs. 2021-01-25 21:40:29 -05:00
Bill Hollings
f6374fe8bc
Merge pull request #1219 from billhollings/mtl-fence-semaphore
For Vulkan semaphores, prefer using MTLFence over MTLEvent.
2021-01-25 15:05:10 -05:00
Bill Hollings
dd36159fb9
Merge pull request #1218 from billhollings/m1-integrated
Advertise macOS M1 GPU as VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU.
2021-01-25 15:04:12 -05:00
Bill Hollings
64a273fb23 For Vulkan semaphores, prefer using MTLFence over MTLEvent,
and add documentation for VK_SEMAPHORE_TYPE_TIMELINE.
2021-01-25 14:35:58 -05:00
Bill Hollings
f123cb4b19 Advertise macOS M1 GPU as VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU. 2021-01-25 14:01:07 -05:00
Bill Hollings
57763529b1 Advertise support for shaderInt64 feature.
Add MVKDevice::mslVersionIsAtLeast() to support tests for MSL version.
Also bump MSL support level of standalone MoltenVKShaderConverter tool.
2021-01-25 13:08:41 -05:00
Bill Hollings
c757f3012c
Merge pull request #1213 from billhollings/minor-updates
Minor non-behavior-changing updates and clean-up
2021-01-22 15:08:30 -05:00
Bill Hollings
28bd13d903
Merge pull request #1212 from past-due/github_actions_update_xcode_1
GitHub Actions: Update Xcode to 12.3
2021-01-22 08:50:56 -05:00
Bill Hollings
01d6feea07
Merge pull request #1211 from billhollings/non-functional-admin-changes
Non functional admin and documentation changes.
2021-01-22 08:47:16 -05:00
Bill Hollings
597ac4ed4c
Merge pull request #1210 from billhollings/update-spirv-cross
Update to latest SPIRV-Cross to fix conversion regression edge case.
2021-01-22 08:46:19 -05:00
past-due
d51c65a185 GitHub Actions: Update Xcode to 12.3 2021-01-21 19:25:41 -05:00
Bill Hollings
3ec61667a6 Update MVKSmallVector constructors, and remove unnecessary or obsolete code.
MVKSmallVector allow constructor to size with default values.
Remove obsolete MVKVector, which was long ago replaced with MVKSmallVector.
Remove unnecessary concrete implementations of template functions that are
used only within a single compilation unit.
2021-01-21 18:54:20 -05:00
Bill Hollings
b87b91f144 Remove unused member variables.
Remove MVKGPUCaptureScope::_queue.
Remove MVKQueue::_nextMTLCmdBuffID.
2021-01-21 17:46:29 -05:00
Bill Hollings
e1b3585413 Add MVK_APPLE_SILICON macro definition.
Use MVK_APPLE_SILICON instead of
MVK_IOS_OR_TVOS || MVK_MACOS_APPLE_SILICON or
MVK_MACOS_APPLE_SILICON || MVK_IOS_OR_TVOS.
2021-01-21 16:53:17 -05:00
Bill Hollings
4a65c293c6 Make logging functions globally accessible to ease their use in debugging activities.
Include MVKLogging.h in MVKEnvironment.h, and remove references elsewhere.
2021-01-21 16:21:13 -05:00
Bill Hollings
28c514d03b Add strings for all current VkResult values. 2021-01-21 15:45:23 -05:00
Bill Hollings
ff8460ac0b Documentation updates.
Add link to Vulkan SDK Getting Started doc to README.md and
MoltenVK_Runtime_UserGuide.md documents.
Add Github CI badge to README.md, and remove Travis CI badge.
Make document notices of use of Markdown into comments
so they are invisible when using a Markdown reader.
2021-01-21 14:49:24 -05:00
Bill Hollings
015031c955 Update copyright notices to year 2021 and Xcode build settings check to Xcode 12.3. 2021-01-21 13:37:07 -05:00
Bill Hollings
fbc3600787 Support Xcode 12.3 and remove Travis CI ref from project. 2021-01-21 12:27:37 -05:00
Bill Hollings
787a7bca5d
Merge pull request #1207 from mbechard/master
further fix for 526779ad66
2021-01-21 11:43:04 -05:00
Bill Hollings
926e405c4f Update to latest SPIRV-Cross to fix conversion regression edge case. 2021-01-21 11:36:59 -05:00
Malcolm Bechard
2235458838 further fix for 526779ad66 2021-01-19 18:17:22 -05:00