2141 Commits

Author SHA1 Message Date
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
Bill Hollings
12d9bb4ab0 Merge pull request #1206 from mbechard/master
fix incorrect behavior for MVKCmdResolveImage
2021-01-19 12:27:48 -05:00
Bill Hollings
23f1b9dae9
Merge pull request #1204 from VZout/patch-1
SPIRVReflection: Multiple entry point support for getShaderOutputs
2021-01-19 12:22:04 -05:00
Bill Hollings
d9eb86473d
Merge pull request #1199 from kohver/patch-1
Hide note about a markdown reader if you already use one.
2021-01-19 12:11:16 -05:00
Malcolm Bechard
526779ad66 fix incorrect behavior for MVKCmdResolveImage
fix incorrectly changing first resolve layer's src/dst base layer,
as well and out of bounds access to the mtlResolveSlices array
2021-01-18 22:58:07 -05:00
Viktor Zoutman
051d5155bc
make getShaderOutputs respect multiple entry points. 2021-01-15 19:08:27 +01:00
Bill Hollings
aab7c01a17
Merge pull request #1202 from markreidvfx/master
Support immmutableSamplers with sampler arrays, fixes #1181
2021-01-10 11:19:13 -05:00
Mark Reid
40cd45d4d7 Support immmutableSamplers with sampler arrays, fixes #1181 2021-01-09 19:57:39 -08:00
Artyom Kohver
972f292cca
Update README.md 2021-01-09 00:13:44 +03:00
Artyom Kohver
3d46b93591
Hide note about a reader if you already use one. 2021-01-09 00:08:13 +03:00
Bill Hollings
15bf3d45c5
Merge pull request #1198 from cdavis5e/memoryless-build-fix
MVKRenderPass: Only use MTLStorageModeMemoryless where available.
2021-01-06 09:46:33 -05:00
Chip Davis
2eb0fe6947 MVKRenderPass: Only use MTLStorageModeMemoryless where available.
Fixes #1197.
2021-01-05 22:44:55 -06:00
Bill Hollings
1ad099883d
Merge pull request #1194 from cdavis5e/apple-gpu-render-granularity
MVKRenderPass: Use a non-trivial granularity for TBDR GPUs.
2021-01-04 10:57:55 -05:00
Chip Davis
930525f289 MVKRenderPass: Use a non-trivial granularity for TBDR GPUs.
This parameter is intended to indicate the optimal granularity for the
render area. For TBDR GPUs, this will be the tile size. IMR GPUs
continue to use 1x1.

Apple GPUs support tile sizes of 16x16, 32x16, and 32x32. But, we can't
read the tile size used for a Metal render pass until a render command
encoder has been created. So for now, hardcode 32x32 for TBDR GPUs.
2020-12-31 13:18:11 -06:00
Bill Hollings
34dc378371
Merge pull request #1191 from cdavis5e/apple-gpu-barriers
Don't use barriers in render passes on Apple GPUs.
2020-12-31 09:40:17 -05:00
Chip Davis
d22d9e3d17 Don't use barriers in render passes on Apple GPUs.
Apple GPUs don't support them, and in fact Metal's validation layer will
complain if you try to use them.
2020-12-30 15:09:53 -06:00
Bill Hollings
e9bc3b3c62
Merge pull request #1193 from cdavis5e/memoryless-host-accessibility
MVKDeviceMemory: Don't consider Memoryless host-accessible on macOS/tvOS.
2020-12-30 10:11:24 -05:00
Bill Hollings
c985bbf4c3
Merge pull request #1192 from cdavis5e/memoryless-rt-actions
MVKRenderPass: Don't use Load/Store actions for memoryless.
2020-12-30 10:06:09 -05:00
Bill Hollings
4f0d370166
Merge pull request #1190 from cdavis5e/render-rgb9e5-mask
MVKGraphicsPipeline: Fix color write mask with RGB9E5 RTs.
2020-12-30 09:52:29 -05:00
Bill Hollings
326e872a65
Merge pull request #1189 from cdavis5e/sync-create-texture
MVKImagePlane: When sync'ing, create the texture if it doesn't exist.
2020-12-30 09:48:34 -05:00
Bill Hollings
8dce95b8e2
Merge pull request #1188 from cdavis5e/apple-gpu-linear-rt
MVKPixelFormats: Enable RenderTarget usage for linear textures on Apple GPUs.
2020-12-30 09:47:32 -05:00
Chip Davis
4d6b92bb9c MVKDeviceMemory: Don't consider Memoryless host-accessible on macOS/tvOS.
I missed this when I added support for memoryless on macOS.
2020-12-29 21:21:02 -06:00
Chip Davis
aa65392027 MVKRenderPass: Don't use Load/Store actions for memoryless.
Memoryless textures cannot use `Load`/`Store` actions, because there is
no memory to load from or store to. So don't use these actions, even if
we're not rendering to the whole thing.

Multiple subpasses might be a problem. Tessellation and indirect
multiview *will* be problems, because these require us to interrupt the
render pass in order to do compute--and that causes us to use `Store`
unconditionally.

One option, which I've mentioned before, is using tile shaders for these
cases. But I haven't looked seriously into that yet. The other involves
a subtle distinction between Metal's `MTLStorageModeMemoryless` and
Vulkan's `VK_MEMORY_TYPE_LAZILY_ALLOCATED_BIT`: the former *never*
commits memory; while the latter doesn't commit memory *at first*, but
may do so later. If we find that we're going to need to `Store` to a
`LAZILY_ALLOCATED` image, then what we can do is replace the
`Memoryless` texture with one with a real backing store in `Private`
memory. This change does not do that yet. It'll require some more
thought.

As for multiple subpasses, I eventually want to look into optimizing
render passes by shuffling the subpasses around to minimize the need to
load and store attachments from/to memory, which TBDR GPUs absolutely
hate. That should help with this problem, too.
2020-12-29 21:19:18 -06:00
Chip Davis
e6a8409b31 MVKGraphicsPipeline: Fix color write mask with RGB9E5 RTs.
Metal does not allow color write masks with this format where some but
not all of the channels are disabled. Either all must be enabled or none
must be enabled. Presumably, this is because of the shared exponent.

This is just good enough to stop the validation layer from violently
terminating the program. To implement this properly requires using
framebuffer fetch, with a change to SPIRV-Cross. Luckily, the only GPUs
that support `RGB9E5` rendering also support framebuffer fetch.
Honestly, I don't understand why Apple's drivers don't do this.
2020-12-29 21:15:14 -06:00
Chip Davis
f875055ecd MVKImagePlane: When sync'ing, create the texture if it doesn't exist.
Before we can upload the texture, we need to make sure there is a
texture to upload to.
2020-12-29 21:13:43 -06:00