1688 Commits

Author SHA1 Message Date
Bill Hollings
484e1dffdb
Merge pull request #972 from BearishSun/various-fixes
Various fixes
2020-07-27 10:04:00 -04:00
Chip Davis
cda8a2cf44 MVKPipeline: Pass the pipeline sample mask, if present, to SPIRV-Cross.
SPIRV-Cross can now AND the `gl_SampleMask` output with an additional
fixed mask, presumably from the pipeline. Use this new functionality to
implement pipeline sample mask handling.

Special thanks to Tomek Pontika and Corentin Wallez of Google for
graciously contributing their implementation to SPIRV-Cross.

Update SPIRV-Cross to pull in the change necessary for this.
2020-07-24 15:15:11 -05:00
Chip Davis
b1803ea5d7 MVKDevice: Support the VK_EXT_image_robustness extension.
This extension provides weaker guarantees than `VK_EXT_robustness2` and
its `robustImageAccess2` feature. Metal easily meets those guarantees,
with no action on our part necessary.
2020-07-24 15:13:58 -05:00
Marko Pintera
e2f4828f42 Less error prone way of calculating bytes per layer 2020-07-24 09:58:17 +02:00
Marko Pintera
6da2fbb353 Don't over-allocate memory for higher mip levels of 3D textures 2020-07-23 15:06:49 +02:00
Marko Pintera
f13fb48905 Allocate correctly sized images 2020-07-23 15:05:44 +02:00
Marko Pintera
d351a7a173 Use correct offset when calculating overlap between image and device memory ranges 2020-07-23 15:03:48 +02:00
Marko Pintera
0b6a5db049 Don't assign MTLTextureUsageRenderTarget to linear textures 2020-07-23 15:02:26 +02:00
Bill Hollings
115275bd9f
Merge pull request #971 from billhollings/master
Fix intermittent concurrent shader specialization race condition.
2020-07-22 18:22:26 -04:00
Bill Hollings
1f68d5fc2a Fix intermittent concurrent shader specialization race condition.
MVKShaderLibrary::getMTLFunction() synchronize and refactor release of Metal objects.
Make use of existing autorelease pool instead of discrete retain/release.
Wrap entire specialization operation in @synchronized() to guard against
Metal internals not coping with multiple simultaneous specializations.
2020-07-22 17:48:19 -04:00
Bill Hollings
c0103fd008 Remove redundant validation check for 2D image views on 3D images. 2020-07-22 14:52:06 -04:00
Bill Hollings
b53a111ba8
Merge pull request #969 from TheSpydog/scaled-vertex-formats
Add support for USCALED/SSCALED vertex formats
2020-07-22 14:30:02 -04:00
Caleb Cornett
c8cba37170 Add support for USCALED/SSCALED vertex formats 2020-07-21 21:06:13 -04:00
Bill Hollings
0d3b128eaa
Merge pull request #968 from billhollings/master
Track if indirect tessellation drawing is supported.
2020-07-21 15:09:09 -04:00
Bill Hollings
81ec314787 Track if indirect tessellation drawing is supported.
Add MVKPhysicalDeviceMetalFeatures::indirectTessellationDrawing.
Return error if indirect tessellated draw command is used when not supported.
2020-07-21 14:10:20 -04:00
Bill Hollings
9b1ec34ce7
Merge pull request #967 from billhollings/master
VkPhysicalDeviceProperties::pipelineCacheUUID include MoltenVK Git revision hash.
2020-07-21 10:21:04 -04:00
Bill Hollings
927bfddbc7 VkPhysicalDeviceProperties::pipelineCacheUUID include MoltenVK Git revision hash. 2020-07-20 17:53:11 -04:00
Bill Hollings
87d15ee9e7
Merge pull request #966 from billhollings/master
Set VkPhysicalDeviceDriverPropertiesKHR::driverID to VK_DRIVER_ID_MOLTENVK.
2020-07-20 17:02:43 -04:00
Bill Hollings
fc0750d67c Set VkPhysicalDeviceDriverPropertiesKHR::driverID to VK_DRIVER_ID_MOLTENVK.
Update to latest version of Vulkan-Headers.
2020-07-20 14:51:40 -04:00
Bill Hollings
b4ea11fe2a
Merge pull request #965 from billhollings/master
Several minor updates: VK_FORMAT_D16_UNORM plus vertex attribute stride test
2020-07-20 14:16:48 -04:00
Bill Hollings
4d082f0501
Merge pull request #948 from TheSpydog/driverprops
Implement VK_KHR_driver_properties extension
2020-07-20 13:35:22 -04:00
Bill Hollings
e784ae2cbb
Merge pull request #964 from js6i/master
Add missing offset when flushing buffer data to device
2020-07-20 12:32:26 -04:00
Bill Hollings
fac6516557
Merge pull request #963 from cdavis5e/gbgr-bgrg-format-fix
MVKPixelFormats: Correct format features for GBGR/BGRG formats.
2020-07-20 12:31:48 -04:00
Bill Hollings
2859c6302d MVKCommands delegate reportError() to MVKCommandBuffer. 2020-07-18 00:33:05 -04:00
Bill Hollings
7aca997250 Support Xcode 11.6. 2020-07-18 00:11:56 -04:00
Bill Hollings
f5b937c7f9 Add native support for VK_FORMAT_D16_UNORM on iOS 13.0+ and tvOS 13.0+. 2020-07-18 00:06:51 -04:00
Bill Hollings
72c4ba1118 Remove unneeded MVK_IOS_SIMULATOR and MVK_TVOS_SIMULATOR macros. 2020-07-17 22:18:08 -04:00
Jan Sikorski
d90528b0c9 Add missing offset when flushing buffer data to device 2020-07-16 12:17:09 +02:00
Chip Davis
00fdbc47bc MVKPixelFormats: Correct format features for GBGR/BGRG formats.
Some things I missed in my review.

These formats use implicit reconstruction, and we don't support explicit
reconstruction here yet. If there's a demand for it, I or someone else
can implement it, but I don't expect it to be an issue.

Because it uses implicit reconstruction, chroma sampling is determined
by the implementation, i.e. Metal. My testing shows that Metal on AMD
and Intel uses midpoint reconstruction. Based on this, I think NV will
be the same.

Finally, according to the Vulkan spec:

> Implicit reconstruction takes place by the samples being interpolated,
> as required by the filter settings of the sampler, *except that
> `chromaFilter` takes precedence for the chroma samples*. [emphasis
> added]

Since Metal obviously uses the same filters for chroma and luma, we
can't support the separate reconstruction filter feature here.
2020-07-16 00:02:18 -05:00
Bill Hollings
5ff8531bba Include vertex attribute size when testing whether attribute offset exceeds stride.
Track Metal vertex binding stride alignment.
Add MVKPhysicalDeviceMetalFeatures::vertexStrideAlignment.
Update VK_MVK_MOLTENVK_SPEC_VERSION to 27.
Update pipeline cache archive description for CompilerMSL::Options.
2020-07-11 15:36:44 -04:00
Bill Hollings
f967fb6aeb
Merge pull request #954 from billhollings/master
Also remove use of Metal kCGColorSpaceITUR_2020_PQ to avoid App Store rejections.
2020-07-09 12:54:54 -04:00
Bill Hollings
1b84dd769d Also remove use of Metal kCGColorSpaceITUR_2020_PQ to avoid App Store rejections. 2020-07-09 12:26:42 -04:00
Caleb Cornett
b77404ad36 Change conformance version, refactor strcpy 2020-07-08 20:57:49 -04:00
Bill Hollings
960f597f08
Merge pull request #953 from billhollings/master
Attempt to fix Travis builds.
2020-07-08 17:10:32 -04:00
Bill Hollings
5d6c8eb1f7 Attempt to fix Travis builds.
In .travis.yml, move fetchDependencies run from install section
to script section, and run it with --no-parallel-build option.
2020-07-08 16:14:51 -04:00
Bill Hollings
6a1acc8570
Merge pull request #952 from billhollings/master
Fix new and unexpected App Store failure on newly deprecated color space values.
2020-07-08 15:28:29 -04:00
Bill Hollings
e39dde02ec Fix new and unexpected App Store failure on newly deprecated color space values. 2020-07-08 14:58:29 -04:00
Bill Hollings
bbb2295734
Merge pull request #951 from billhollings/master
Fix failure of MoltenVKShaderConverter Xcode build target packaging script.
2020-07-08 13:16:27 -04:00
Bill Hollings
1acc1ac8ed Fix failure of MoltenVKShaderConverter Xcode build target packaging script.
Update outstanding uses of MVK_BUILT_PROD_PATH to MVK_BUILT_PROD_DIR.
2020-07-08 12:51:29 -04:00
Caleb Cornett
7f64c419c2 Implement VK_KHR_driver_properties 2020-07-07 16:31:07 -04:00
Bill Hollings
c6cb503e3f
Merge pull request #947 from billhollings/master
Fix small memory leak when setting swapchain color space.
2020-07-06 18:02:46 -04:00
Bill Hollings
cd18cec727 Fix small memory leak when setting swapchain color space.
Add CAMetalLayer::colorspaceNameMVK property to handle retain/release automatically.
2020-07-06 17:36:05 -04:00
Bill Hollings
c3f9951dad
Merge pull request #946 from billhollings/master
Update to latest SPIRV-Cross version.
2020-07-06 13:39:21 -04:00
Bill Hollings
e40153abae Update to latest SPIRV-Cross version,
MSL: Workaround broken scalar access chain behavior in LLVM IR / AIR
2020-07-06 13:05:55 -04:00
Bill Hollings
52e7c2ff31
Merge pull request #943 from billhollings/master
MVKPhysicalDevice::getSurfaceFormats() reduce fragility of surface format definitions.
2020-06-30 16:59:38 -04:00
Bill Hollings
1a686efc19 MVKPhysicalDevice::getSurfaceFormats() reduce fragility of surface format definitions. 2020-06-30 15:28:52 -04:00
Bill Hollings
c0b0e4e6c4
Merge pull request #939 from cdavis5e/macos-rgb10a2-surface
MVKDevice: Advertise VK_FORMAT_A2B10G10R10_UNORM_PACK32 as a surface format.
2020-06-30 14:40:47 -04:00
Bill Hollings
d79926a579
Merge pull request #934 from tmm1/tvos-fixups
tvOS fixups
2020-06-29 13:43:10 -04:00
Chip Davis
85357d0a5d MVKDevice: Advertise VK_FORMAT_A2B10G10R10_UNORM_PACK32 as a surface format.
The corresponding Metal format is now documented as supported for
`CAMetalLayer`, confirming my findings in #673.

Only support the 10-10-10-2 formats on macOS. iOS and tvOS instead have
extended-range formats, which unfortunately have no Vulkan equivalents.
I've added them anyway for completeness. I suppose if Vulkan ever does
get these formats, we'll then be ready to expose them as surface
formats.
2020-06-25 13:34:00 -05:00
Aman Gupta
9d886adac5 mark shared memory type as VK_MEMORY_PROPERTY_HOST_CACHED_BIT 2020-06-25 10:49:50 -07:00