218 Commits

Author SHA1 Message Date
Aman Gupta
b250212c6f add MVK_TVOS and start conditionalizing build failures 2020-06-15 16:21:13 -07:00
Aman Gupta
b26d8673b0 more tvos fixes 2020-06-15 15:53:54 -07:00
Bill Hollings
348c064b75
Merge pull request #909 from Lichtso/VK_KHR_sampler_ycbcr_conversion
VK_KHR_sampler_ycbcr_conversion
2020-06-11 17:09:34 -04:00
Bill Hollings
dd98fbd26f Remove use of @available() directive as it can cause issues in some build environments.
Generally replace use of @available() with respondsToSelector:.
Add mvkMakeOSVersion() and mvkOSVersionIsAtLeast(macos,ios) to help testing OS versions.
Set maxDrawIndexedIndexValue to kMVKUndefinedLargeUInt32 instead of uint32_t max.
2020-06-11 12:43:38 -04:00
Aman Gupta
118ef06371 add tvos targets to the xcode projects 2020-06-09 15:16:14 -07:00
Bill Hollings
752c1a908d Refactor Xcode build architectures
Set ARCHS build setting to $(ARCHS_STANDARD_64_BIT) in Xcode projects.
Remove ARCHS and VALID_ARCHS build settings in Xcode targets.
2020-06-09 16:39:23 -04:00
Alexander Meißner
5e4e2d83cc Merge master into VK_KHR_sampler_ycbcr_conversion 2020-06-08 00:05:16 +02:00
Bill Hollings
8671295570 Support vertex attribute offsets larger than the vertex buffer stride.
Add MVKTranslatedVertexBinding to describe a translated vertex binding, track these in
MVKGraphicsPipeline, and add a Metal vertex layout for each additional translated binding.
MVKGraphicsResourcesCommandEncoderState query MVKGraphicsPipeline for translated bindings
associated with existing bindings and binds the same MTLBuffer multiple times with
different offsets.
2020-05-31 14:16:12 -04:00
Bill Hollings
e302a6d023 Update to latest version of SPIRV-Cross.
Remove use of obsolete SPIRV-Cross API MSLVertexAttr content.
ExternalDependencies.xcodeproj updated to Xcode 11.5.
Update What's New document.
2020-05-30 16:07:47 -04:00
Bill Hollings
0e92b3277c Use of MVKSmallVector between MVKPipeline and SPIRVReflection.
Make SPIRVReflection global functions inline and templated.
Remove SPIRVReflection.cpp.
Allow MVKSmallVector to be sorted by supporting
random access from MVKSmallVector::iterator.
2020-05-23 17:13:28 -04:00
Bill Hollings
9685f5d00a Support Xcode 11.5. 2020-05-22 18:48:29 -04:00
Alexander Meißner
3da5ecf628 Adds support for VK_KHR_sampler_ycbcr_conversion formats and sampler.
However, the binding of descriptors for
multi-planar / disjoint images is still missing.
2020-05-07 16:02:10 +02:00
Chip Davis
adf63bbdc7 MVKPipeline: Disable fragment shader outputs for unused attachments.
Naturally, Metal complains when a fragment shader write to a
`[[depth]]` output, but there be no depth attachment. I imagine that it
will also complain if the shader write to ``[[stencil]]`` with no
stencil attachment, or it write to a ``[[color(n)]]`` output with no
corresponding attachment.
2020-04-14 14:32:00 -05:00
Bill Hollings
eb99488f04 Reinstate VulkanSamples API-Samples demo apps.
MVKShaderConverterTool add support to output SPIR-V as header (.h) files.
Add MVKShaderConverterTool Xcode target.
Add MVKShaderConverterTool Package Xcode scheme.
fetchDependencies builds MVKShaderConverterTool and runs
it on shader files in VulkanSamples API-Samples directory.
2020-04-11 16:19:03 -04:00
Bill Hollings
0904c49014 Alphabetize file sorting in Xcode Project Navigator. 2020-04-09 14:19:46 -04:00
Bill Hollings
50eba6fee1 Support Xcode 11.4. 2020-03-25 20:24:07 -04:00
Bill Hollings
8ec682938b Update copyright to 2020. 2020-01-07 16:47:29 -05:00
Bill Hollings
a64f62ee53 Update dependency libraries to match Vulkan SDK 1.1.130.
Update ExternalRevisions/README.md to document new glslang build settings.
Update What's New document.
2019-12-16 14:24:57 -05:00
Bill Hollings
b213996c5e Support Xcode 11.3.
Update What's New document.
2019-12-12 12:38:17 -05:00
Bill Hollings
9f64cc4bef Fix tessellation break when control stage declares but does not use position builtin.
Add SPIRVShaderOutput::isUsed retrieved from shader reflection.
mvk::sizeOfOutput() returns zero if output var is not used.
Update to latest SPIRV-Cross version.
2019-11-26 16:11:52 -05:00
Bill Hollings
025abe501a Support Xcode 11.2. 2019-11-04 20:39:41 -05:00
Bill Hollings
93ae214bc8 Support additional capabilities in 1D images, including rendering, clearing, and mipmaps.
Add `MVK_CONFIG_TEXTURE_1D_AS_2D` environment variable, enabled by default.
Modify 1D warning messages to recommend use of `MVK_CONFIG_TEXTURE_1D_AS_2D`.
Update to latest version of SPIRV-Cross.
Align pipeline cache contents to latest CompilerMSL::Options structure.
Clean up code signing on demo Xcode projects.
2019-10-25 14:40:59 -04:00
Colin Hughes
5c3b265888 Braces formatting 2019-10-17 19:02:50 -06:00
Colin Hughes
520bbe2561 Tabs formatting 2019-10-16 00:28:22 -06:00
Colin Hughes
75c3e13281 Add linking separate shader texts to GLSLToSPRIVConverter 2019-10-16 00:27:39 -06:00
Bill Hollings
c6e9d6b189 Support Xcode 11.1. 2019-10-11 15:16:13 -04:00
Bill Hollings
a2951a19e6 Support Xcode 11.
Declare _formatDescriptions[] in mvk_datatypes.mm as officially writable
because Clang now locates static const in non-writable memory.
Update build settings to Xcode 11.
Update MoltenVK_Runtime_UserGuide.md about embedding `libMoltenVK.dylib` in an application.
2019-10-01 00:25:09 -04:00
Chip Davis
deaaab8eff Support the VK_EXT_fragment_shader_interlock extension.
This extension allows fragment shaders to delineate critical sections
where pairs of invocations may not execute simultaneously. In Metal, the
nearest equivalent functionality is raster order groups. This
implementation is thus implemented on top of them.

Update SPIRV-Cross to pull in SPIR-V support for this new extension.
2019-09-06 12:52:39 -05:00
Chip Davis
100d7aa543 Support the VK_KHR_device_group extension.
Largely minimal for now. Much of it, particularly most of the
interactions with `VK_KHR_swapchain`, was already implemented
previously. The only interesting bits are the `vkCmdDispatchBase()`
command, and the ability to create arbitrary swapchain images and bind
them to swapchain memory, which requires the use of the previously
implemented `VK_KHR_bind_memory2` extension. Most everything else can be
safely ignored for now.

Non-zero dispatch bases use the compute stage-input region to pass the
dispatch base group to the shader, which must manually adjust the
`WorkgroupId` and `GlobalInvocationId` builtins, since Metal does not do
this for us. I have tested that this approach works well--at least, well
enough to pass the CTS.

Because of the ability to bind arbitrary images to swapchain memory,
I've sucked the guts out of `MVKSwapchainImage` and into `MVKSwapchain`
itself. Availability and drawable management is now performed by the
swapchain object. `MVKSwapchainImage` is now just a specialized kind of
image, created when requested with a `VkImageCreateSwapchainInfoKHR`
structure.

Update SPIRV-Cross so we can support the `vkCmdDispatchBase()` command.

One more step towards Vulkan 1.1.
2019-08-09 11:41:10 -05:00
Bill Hollings
095dd3339b Update to latest version of SPIRV-Cross.
Update demos to latest dependency library versions.
Update to Xcode 10.3.
Update What's New document.
2019-07-24 14:39:38 -04:00
Bill Hollings
84ea825ea3 Separate SPIRVToMSLConverterContext into input config and output results.
Refactor SPIRVToMSLConverterContext into distinct SPIRVToMSLConversionConfiguration
and SPIRVToMSLConversionResults for conversion input and output, respectively.
Update to latest SPIRV-Cross version.
Update What's New document.
2019-06-29 18:01:07 -04:00
Bill Hollings
11ca15edaa Quick fixes for pipeline cache lookups.
SPIRVToMSLConverterOptions should really be refactored into two separate config and results structs.
2019-06-19 16:23:50 -04:00
Bill Hollings
64d7e07243 Support immutable depth compare samplers as constexpr samplers hardcoded in MSL.
On iOS GPU family 2 and earlier:
  - Allow immutable samplers to be passed to SPIRV-Cross in a format
    they can be output as hardcoded constexpr samplers in MSL.
  - Validate depth compare samplers are only used as immutable.

MVKMVKPipelineLayout & MVKDescriptorSetLayout can take null MVKCommandEncoder
to perform a validation pass when binding or pushing.
Reduce redundancy by combining SPIRVToMSLConverterContext structs
with compatible SPIRV-Cross structs.
Update MoltenVK version to 1.0.36.
2019-06-15 01:47:13 -04:00
bearishsun
7f5a70d802 Added a way to set compute kernel threadgroup size when using MSL source code or MSL compiled code 2019-06-06 11:19:41 +02:00
Chip Davis
f075adc93f Update SPIRV-Cross.
This adds support for the `OpArrayLength` instruction.
2019-05-29 10:49:28 -05:00
Bill Hollings
fbf2af58a0 Fixes and consolidation of external library header references.
All external library header references consistently include framework references.
Cleanup references to external library headers that are no longer required.
Simplify and consolidate external library header paths in Xcode projects.
Add MVK_EXCLUDE_SPIRV_TOOLS build option to avoid use of SPIRV-Tools library.
Remove all other references to headers within SPIRV-Tools library.
2019-05-28 17:19:43 -04:00
Bill Hollings
c2706f3e6b Fix offset of buffer view relative to buffer offset within device memory. 2019-05-27 17:56:44 -04:00
Józef Kucia
b8abc58b7e Fix [[attribute]] assignment for tessellation evaluation shaders.
This is needed for TessLevelInner and TessLevelOuter in tessellation evaluation
shaders.

Fixes dEQP-VK.tessellation.shader_input_output.tess_level_inner_0_tes.
2019-05-26 13:41:28 +02:00
Bill Hollings
c3aaf976ae Add support for the VK_NV_glsl_shader extension.
Support runtime shader compilation from GLSL.
Return VK_ERROR_INVALID_SHADER_NV on shader and pipeline compilation errors.
Add MVKShaderCompilationPerformance::glslToSPRIV to track GLSL conversion performance.
Rename MoltenVKGLSLToSPIRVConverter MVKShaderStage enum to MVKGLSLConversionShaderStage
to avoid naming conflicts with MoltenVK MVKShaderStage enum.
Hologram demo load SPIR-V directly instead of using GLSL through either
MoltenVKGLSLToSPIRVConverter or VK_NV_glsl_shader extension.
Update to latest version of VulkanSamples that supports MVKGLSLConversionShaderStage.
2019-05-10 12:21:03 -04:00
Bill Hollings
173d8cc5f3 Add support for the VK_EXT_debug_report extension.
Add MVKDebugReportCallback class.
Add MVKVulkanAPIObject class as base class of classes exposed in Vulkan API.
Remove MVKRefCountedDeviceObject class and move ref-counting to MVKVulkanAPIObject.
Rename MVKDispatchableObject class to MVKDispatchableVulkanAPIObject.
Introduce multiple inheritance mixin classes into class hierarchy.
Add MVKBaseObject::getVulkanAPIObject() function to find Vulkan API object
controlling any subobject that needs to report something.
MVKCommandResourceFactory functions pass in calling object for reporting.
Add MVKBaseObject::reportMessage() & reportError() functions.
Replace mvkNotifyErrorWithText() static function with reportError()
instance function to allow access to debug reporting.
Redefine MVKLog*() functions to call reportError() instance method.
Delete MVKLogging.cpp.
Remove MVKLogging.h from MoltenVKShaderConverter project.
Add mvk_datatypes.hpp to redirect errors in mvk_datatypes.h functions to debug
reporting. Use mvk_datatypes.hpp internally for all references to these functions.
Convert several static methods to instance methods.
Refactor platform defines in MVKSurface.h.
Explicitly count MVKExtensionList extension count to avoid relying on struct size.
Remove MVKCommandBuffer::recordResult() and use setConfigurationResult().
Change log indication of error in logs from [***MoltenVK ERROR***] to [mvk-error],
for consistency with other log level indications.
Update MoltenVK version to 1.0.35.
2019-05-01 22:27:03 -04:00
Bill Hollings
ee6e6f5ad0 Enable AMD and NV GLSL extensions when building glslang for MoltenVKGLSLToSPIRVConverter. 2019-04-18 17:39:25 -04:00
Bill Hollings
62f374bf7e Allow building external dependency libraries in Debug mode.
Add ExternalDependencies (Debug) scheme to ExternalDependencies Xcode project.
Add --debug option to fetchDependencies script.
Support Release, Debug & Latest directories in External/build directory.
Enable DEPLOYMENT_POSTPROCESSING build setting when compiling
SPIRV-Tools to avoid warning spam when building dylibs.
Disable visibility warnings when building MoltenVKShaderConverter
in Release mode from external libraries built in Debug mode.
Always use -Xlinker -w option when creating dylibs to disable visibility warnings.
2019-04-18 15:08:39 -04:00
Bill Hollings
eca03b8de1 MoltenVKShaderConverter tool add MSL version and platform command-line options.
Add SPIRVToMSLConverterOptions::platform to track platform. Default to build platform.
Update default SPIRVToMSLConverterOptions MSL version to 2.1.
MoltenVKShaderConverter test MSL compilation use same MSL version as conversion.
Default min perf tracking value to 0.0.
SPIRVToMSLConverter.h reference spirv.hpp via SPIRV-Cross framework.
Update What's New document.
2019-04-17 16:09:07 -04:00
Bill Hollings
ebce19b0b7 Add MoltenVKShaderConverter tool option to log shader conversion performance.
Move MVKOSExtension.h/mm to from MoltenVK to Common
and move MTLDevice functions to MVKDevice.
2019-04-11 14:26:35 -04:00
Bill Hollings
c388619792 Suppress visibility warning spam when building Debug macOS from SPIRV-Cross Release
Pass -Xlinker -w when building Debug macOS dylibs.
Include -w in OTHER_LDFLAGS when building Debug macOS MoltenVKShaderConverter tool.
2019-04-02 12:25:49 -04:00
Bill Hollings
dfd5638a0f Clean up use of SPIRV_CROSS_NAMESPACE_OVERRIDE in Xcode projects.
Setting of SPIRV_CROSS_NAMESPACE_OVERRIDE in Xcode projects was stomping on DEBUG setting.
Update What's New document.
2019-04-01 22:41:20 -04:00
Bill Hollings
4183a6489b
Merge branch 'master' into master 2019-03-29 13:06:00 -04:00
Hans-Kristian Arntzen
38edfdb3de Override namespace for SPIRV-Cross.
Some projects also link against SPIRV-Cross statically, and in order to
avoid ABI conflicts, we should use a private namespace for the
SPIRV-Cross dependency to avoid bugs. See SPIRV-Cross issue #902 for
more information. The new namespace is MVK_spirv_cross, and the code
now makes use of the SPIRV_CROSS_NAMESPACE macro rather than spirv_cross.
2019-03-29 11:34:55 +01:00
Bill Hollings
0f22e2a70e MSL: Fix crash where variable storage buffer pointers are passed down.
Explicitly build dSYM files in BUILT_PRODUCTS_DIR
to avoid conflict between macOS and iOS build locations.
Update to latest SPIRV-Cross version.
2019-03-28 11:58:05 -04:00
Bill Hollings
e4d96f6fa2 Support Xcode 10.2. 2019-03-26 11:50:39 -04:00