748 Commits

Author SHA1 Message Date
Bill Hollings
677f2cb9be Modify README.md to direct developers to Vulkan SDK. 2019-02-08 19:36:52 -05:00
Bill Hollings
94404ae0da
Merge pull request #489 from cdavis5e/quiesce-swizzle-log
Only warn on non-default swizzles when fullImageViewSwizzle is off.
2019-02-07 16:35:34 -05:00
Chip Davis
1652f6d719 Don't warn at all on pipelines with full swizzling support.
This could happen, for example, if image views with a non-default
swizzle are used with shaders that don't sample those images. In this
case, MoltenVK will warn, because the pipeline said not to set up the
aux buffer.
2019-02-06 13:17:50 -06:00
Chip Davis
f1c5c79365 Only warn on non-default swizzles when fullImageViewSwizzle is off.
Otherwise, the log will be spammed with hundreds of useless messages
that the `IDENTITY` swizzle is not supported.
2019-02-05 13:56:45 -06:00
Bill Hollings
24c7be84dc
Merge pull request #488 from billhollings/master
Add GPU device ID for iOS A12 SoC.
2019-02-04 11:42:52 -05:00
Bill Hollings
8e02a5d2f3 Add GPU device ID for iOS A12 SoC. 2019-02-04 10:15:03 -05:00
Bill Hollings
31069218db
Merge pull request #485 from cdavis5e/registry-id
Use the device's registryID property to locate it in IOKit.
2019-02-04 10:04:04 -05:00
Chip Davis
8307a66f80 Use the device's registryID property to locate it in IOKit.
This should be better behaved with systems that have more than one GPU
and aren't e.g. MacBooks with graphics switching.
2019-01-31 19:34:01 -06:00
Bill Hollings
e4c196c3b6
Merge pull request #484 from cdavis5e/memory-budget
Support the VK_EXT_memory_budget extension.
2019-01-31 16:12:07 -06:00
Chip Davis
3df6d2d00f Support the VK_EXT_memory_budget extension.
This requires macOS 10.13 or iOS 11, for the `currentAllocatedSize`
property of `MTLDevice`. Ideally, we'd check for that method instead of
keying on the version.
2019-01-31 12:10:57 -06:00
Bill Hollings
97ab7dfa92
Merge pull request #482 from billhollings/master
Allow logging level to be controlled via runtime environment variable.
2019-01-30 10:20:18 -06:00
Bill Hollings
216e86de19 Allow logging level to be controlled via runtime environment variable. 2019-01-29 21:10:31 -05:00
Bill Hollings
66e383f4b2
Merge pull request #481 from billhollings/master
Update to latest SPIRV-Cross version.
2019-01-28 19:34:09 -06:00
Bill Hollings
f591fed43e Update to latest SPIRV-Cross version. 2019-01-28 19:58:32 -05:00
Bill Hollings
eba0908ef3
Merge pull request #480 from billhollings/master
vkSetMTLTextureMVK() function retains texture object.
2019-01-28 18:56:59 -06:00
Bill Hollings
57864944b5 Merge branch 'master' of https://github.com/billhollings/MoltenVK 2019-01-28 17:16:20 -05:00
Bill Hollings
18a31fb3dd vkSetMTLTextureMVK() function retains texture object. 2019-01-28 17:09:57 -05:00
Bill Hollings
e703705a9a
Merge pull request #479 from cdavis5e/yet-more-features
MVKDevice: Correct some more features and limits.
2019-01-28 16:06:18 -06:00
Bill Hollings
07be6c1d81 vkSetMTLTextureMVK() function retains texture object. 2019-01-28 16:18:55 -05:00
Bill Hollings
21a349a364
Merge pull request #478 from cdavis5e/log-to-stderr
Log to stderr instead of stdout.
2019-01-28 14:32:11 -06:00
Chip Davis
34c7f6c09c MVKDevice: Correct some more features and limits.
Actually turn on the `layeredRendering` feature for A12 on iOS. This
should actually allow clients to take advantage of that on A12 devices.

Turn on the `variableMultisampleRate` and `inheritedQueries` features.
`variableMultisampleRate` means that pipelines with no attachments may
have different sample counts. Since no-attachment pipelines are
emulated, we don't have that limitation anyway. If and when Metal gains
real support for no-attachment pipelines, we may have to revisit this.

`inheritedQueries` means that queries may apply to secondary command
buffers as well as primary commands. Secondary command buffers are also
emulated, and should by virtue of being inlined into the primary's
`MTLCommandBuffer` inherit any query-related state.

Use the `maxBufferLength` property of `MTLDevice` when available to get
the true maximum buffer size. (This is one of the "secret" properties in
earlier versions of Metal. It finally became a public, supported API in
Metal 2.1.)

Limit the number of dual-source blending color attachments to 1. This is
a documented limitation of Metal 1.2. I don't know if Metal 2 or 2.1
have lifted this restriction.

Indicate that this implementation uses the standard sample locations.
For Metal, these are actually documented in "Using Programmable Sample
Positions," which discusses setting custom sample locations. The default
sample locations given there are all consistent with the standard
locations documented in the Vulkan spec.
2019-01-28 14:12:28 -06:00
Bill Hollings
43d0a5a308
Merge pull request #477 from billhollings/master
Advertise VkPhysicalDevicePortabilitySubsetFeaturesEXTX::standardImageViews
2019-01-28 14:09:34 -06:00
Chip Davis
e59ffbb84b Log to stderr instead of stdout. 2019-01-28 13:29:41 -06:00
Bill Hollings
64ca492696 Advertise VkPhysicalDevicePortabilitySubsetFeaturesEXTX::standardImageViews
enabled if MVKConfiguration::fullImageViewSwizzle enabled.
2019-01-28 13:55:43 -05:00
Bill Hollings
601acf6884
Merge pull request #475 from cdavis5e/separate-stencil-mask-ref
Advertise support for the separateStencilMaskRef portability feature.
2019-01-28 12:30:34 -06:00
Chip Davis
cedaed7d7e Advertise support for the separateStencilMaskRef portability feature.
Why was this turned off? Pretty sure Metal supports this.
2019-01-27 23:01:08 -06:00
Bill Hollings
df807bca63
Merge pull request #474 from billhollings/master
Add support for VK_EXTX_portability_subset extension.
2019-01-27 20:44:45 -06:00
Bill Hollings
cb0c91cbd0 Update to latest SPIRV-Cross and update What's new document. 2019-01-27 21:18:47 -05:00
Bill Hollings
f969bcc937 Minor refactoring to simplify fetchDependencies script. 2019-01-27 20:34:41 -05:00
Bill Hollings
dd5c0186bb Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2019-01-27 19:53:59 -05:00
Bill Hollings
e5a890775b Add support for VK_EXTX_portability_subset extension.
Add KhronosGroup/Vulkan-Portability as external dependency repo.
Add ExternalRevisions/Vulkan-Portability_repo_revision.
Add vk_extx_portability_subset.h header file to mvk_vulkan.h.
MVKImageView allow constructor with no image or device.
Add mvkVkComponentMappingsMatch() & mvkVkComponentSwizzlesMatch() functions.
Cleanup some local var init warnings.
2019-01-27 19:52:59 -05:00
Bill Hollings
3b7af5c5c1
Merge pull request #470 from jeremyk-lunarg/jeremyk_MVK_fix_spirv-tools_include_from_provided_glslang_path
fetchDependencies: Fix SPIRV-Tools including pre-built glslang
2019-01-27 18:49:29 -06:00
Jeremy Kniager
60b4f2fa9d fetchDependencies: Fix SPIRV-Tools including pre-built glslang
Glslang does not build SPIRV-Tools when including it.
The `fetchDependencies` script does this when cloning
the repo on its own, but neglects to do this when a path
to a pre-built glslang is provided.

This commit adds the SPIRV-Tools build step when given
a path to a pre-built glslang.
2019-01-25 10:21:07 -07:00
Bill Hollings
100848304d Minor leftover cleanup from MVKVector. 2019-01-23 20:29:04 -06:00
Bill Hollings
01e7da2a50
Merge pull request #460 from aerofly/master
Missing functions for MVKVector
2019-01-23 20:00:25 -05:00
Bill Hollings
5a1417fd60
Merge pull request #467 from cdavis5e/fix-image-format-props
MVKDevice: Correct returned values from getImageFormatProperties().
2019-01-23 19:05:43 -05:00
Chip Davis
69dabceaf1 MVKDevice: Correct returned values from getImageFormatProperties().
According to the Vulkan spec:

> `sampleCounts` will be set to `VK_SAMPLE_COUNT_1_BIT` if at least one
> of the following conditions is true:
>
> * `tiling` is `VK_IMAGE_TILING_LINEAR` [we already handled this]
> * `type` is not `VK_IMAGE_TYPE_2D`
> * `flags` contains `VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT`
> * Neither the `VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT` nor the
>   `VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT` flag in
>   `VkFormatProperties::optimalTilingFeatures` returned by
>   `vkGetPhysicalDeviceFormatProperties` is set

Use the maximum cube dimensions for cube-compatible images. It makes no
difference in practice, since the maximum dimensions of a cube and a 2D
image are the same on all platforms and devices, but this seems more
correct to me.
2019-01-22 19:05:11 -06:00
Bill Hollings
ab59655a72
Merge pull request #466 from cdavis5e/no-atomic-image
Stop advertising atomic image support.
2019-01-22 12:29:38 -08:00
Bill Hollings
663e56f8c9
Merge pull request #465 from cdavis5e/more-features-ios
Support some more features on iOS.
2019-01-22 11:52:59 -08:00
Bill Hollings
8b00d92fdd
Merge pull request #464 from cdavis5e/combined-store-resolve
MVKRenderPass: Use combined store-resolve ops when requested and supported.
2019-01-22 11:52:39 -08:00
Chip Davis
ee0c59cd9f Stop advertising atomic image support.
We don't support this on any format--not even `VK_FORMAT_R32_UINT`,
which is the only format the spec requires support for. I'm still
waiting for Apple to add support for this to Metal. Until then, stop
telling applications they can use this.
2019-01-22 13:38:11 -06:00
Bill Hollings
88e0a04882
Merge branch 'master' into more-features-ios 2019-01-22 11:03:26 -08:00
Bill Hollings
a9420c2898
Merge branch 'master' into combined-store-resolve 2019-01-22 10:58:06 -08:00
Bill Hollings
1a867a22ab
Merge pull request #463 from billhollings/master
Fixes for issues #459, #301, #446.
2019-01-22 10:43:13 -08:00
Chip Davis
ce9afc4745 Support some more features on iOS.
Dual-source blending is supported on all devices starting with iOS 11.
Cube arrays are supported on A11. Layered rendering and multiple
viewports are supported on A12.
2019-01-21 22:08:50 -06:00
Chip Davis
8fdbf8f6de MVKRenderPass: Use combined store-resolve ops when requested and supported.
There is nothing in the Vulkan spec to suggest that
`VK_ATTACHMENT_STORE_OP_STORE` and a resolve attachment cannot both be
specified, nor that one or the other has no effect. So, if the app
supplies a color attachment with both `VK_ATTACHMENT_STORE_OP_STORE` and
a resolve attachment, that means it wants the output to be both stored
to the color attachment and resolved to the resolve attachment. In that
case, we should respect the application's wishes and do both. We can
only do that if the device supports this, though. All devices on Mac
starting with macOS 10.12 support this. On iOS, only the A9 and above
support combined store-resolve actions.
2019-01-21 21:54:59 -06:00
Bill Hollings
16377056f0 Log and return VK_ERROR_FEATURE_NOT_PRESENT error if array
of textures or array of samplers requested but not supported.

Add MVKPhysicalDeviceMetalFeatures::arrayOfTextures & arrayOfSamplers flags.
MVKDescriptorSetLayoutBinding log and return appropriate error.
Add MVKPhysicalDevice::getName() and MVKDevice::getName() functions.
2019-01-21 14:14:40 -05:00
Bill Hollings
e792a3a575 Allow default GPU Capture scope to be assigned to any queue in any queue family.
Add MVKConfiguration::defaultGPUCaptureScopeQueueFamilyIndex and corresponding
MVK_CONFIG_DEFAULT_GPU_CAPTURE_SCOPE_QUEUE_FAMILY_INDEX env var/build setting.
Add MVKConfiguration::defaultGPUCaptureScopeQueueIndex and corresponding
MVK_CONFIG_DEFAULT_GPU_CAPTURE_SCOPE_QUEUE_INDEX env var/build setting.
Ensure VkDeviceQueueCreateInfo::queueCount is limited to VkQueueFamilyProperties::queueCount.
Update MoltenVK version to 1.0.32.
Update VK_MVK_MOLTENVK_SPEC_VERSION to 17.
2019-01-21 13:02:05 -05:00
Bill Hollings
1a334c191d Treat all attributes & resources as used by shader when using pre-converted MSL. 2019-01-21 11:32:15 -05:00
aerofly
992d6e78c0 Add missing std::vector functions to MVKVector 2019-01-18 15:34:29 +01:00