953 Commits

Author SHA1 Message Date
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
aerofly
1c2348b17c Merge with KhronosGroup latest 2019-01-18 15:15:11 +01:00
Bill Hollings
519b594ae0
Merge pull request #457 from billhollings/master
Update to latest dependency libraries for Vulkan SDK 1.1.97.
2019-01-17 17:13:43 -05:00
Bill Hollings
991a1944fe Update to latest dependency libraries for Vulkan SDK 1.1.97.
Update to latest SPIRV-Cross version:
2019-01-17 15:27:20 -05:00
Bill Hollings
58d78623c3 Update inline MVKVector sizing for viewport & scissors.
Revert MVKSwapchainImage::_availabilitySignalers to use std::list for performance.
2019-01-17 14:54:03 -05:00
Bill Hollings
f7336d8071
Merge pull request #425 from aerofly/master
Further reductions of heap allocations during rendering
2019-01-17 13:51:42 -05:00
aerofly
85a8356809 implemented recommended MVKVector changes and merge with HEAD 2019-01-16 22:45:09 +01:00
aerofly
3cdef7ac33 implemented recommended MVKVector changes 2019-01-16 21:33:40 +01:00
Bill Hollings
f4ebbfd5de
Merge pull request #456 from billhollings/master
MoltenVKShaderConverter tool returns failure exit code when any file in directory fails.
2019-01-16 14:09:36 -05:00
Bill Hollings
cf22742c40 MoltenVKShaderConverter tool returns failure exit code when any file in directory fails. 2019-01-16 13:36:43 -05:00
Bill Hollings
710b9c96cc
Merge pull request #453 from cdavis5e/variable-pointers
Support the VK_KHR_variable_pointers extension.
2019-01-15 20:12:54 -05:00
Chip Davis
acefcca1ff Support the VK_KHR_variable_pointers extension. 2019-01-15 16:53:08 -06:00
Bill Hollings
ba3ece417d
Merge pull request #451 from cdavis5e/amd-gpu-shader-half-float
Advertise the VK_AMD_gpu_shader_half_float extension.
2019-01-15 17:51:57 -05:00
Chip Davis
9862e2a458 Update "What's new" doc. 2019-01-15 15:47:15 -06:00
Chip Davis
2450c890dd
Merge branch 'master' into amd-gpu-shader-half-float 2019-01-15 15:44:47 -06:00
Bill Hollings
fb0bee885c
Merge pull request #450 from billhollings/master
Configuration enhancements & prepare for SDK release
2019-01-15 16:42:03 -05:00
Chip Davis
361cbd61e9 Advertise the VK_AMD_gpu_shader_half_float extension. 2019-01-15 15:01:12 -06:00
Bill Hollings
ec1b237806 Add support for copying to and from PVRTC images. 2019-01-15 15:03:23 -05:00
Bill Hollings
7f03e1fb3b Pad fragment output to 4 components when needed.
Update to latest SPIRV-Cross.
2019-01-15 13:52:01 -05:00
Bill Hollings
ff03ef3edd Log Vulkan versions in human readable form when reporting Vulkan version error. 2019-01-14 19:23:29 -05:00
Bill Hollings
a7ab108166 Log error and assertion if ImageView swizzling is disabled but needed.
MVKConfiguration::fullTextureSwizzle renamed to fullImageViewSwizzle.
Env var MVK_CONFIG_FULL_TEXTURE_SWIZZLE renamed to MVK_CONFIG_FULL_IMAGE_VIEW_SWIZZLE.
Refactor MVKResourcesCommandEncoderState swizzle updates.
Add mvkPackSwizzle(), mvkUnpackSwizzle() & mvkVkComponentSwizzleName() and remove from MVKImage.
Refactor mvkVkResultName() to use literal strings.
2019-01-14 17:36:39 -05:00
Bill Hollings
0f9aabfc7b Update What's New document. 2019-01-12 12:40:40 -05:00
Bill Hollings
02aeb0797a Add full texture swizzling to config, and disable it by default.
Add MVKConfiguration::fullTextureSwizzle and corresponding MVK_CONFIG_FULL_TEXTURE_SWIZZLE
env var & build setting, and set to false, to disable texture swizzling by default.
Add SPIRVToMSLConverterOptions::shouldSwizzleTextureSamples.
Lazily init queue families to allow time for specializedQueueFamilies config change.
Fix consistency of pipeline encoding state auxiliary buffer binding.
Improve documentation of MVKConfiguration environment variables and build settings.
2019-01-12 12:19:01 -05:00
Bill Hollings
bdf540d25a Support runtime config via runtime environment variables
and enable sync queue submits as default.

MVKConfiguration values can be set via runtime environment variables
or compile time build settings.
Enable GPU switching control via MVKConfiguration::switchSystemGPU
and MVK_CONFIG_SWITCH_SYSTEM_GPU env var & build setting.
Enable MVKConfiguration::synchronousQueueSubmits by default.
Set MVKConfiguration::performanceTracking via
MVK_CONFIG_PERFORMANCE_TRACKING env var & build setting.
Set MVKConfiguration::performanceLoggingFrameCount via
MVK_CONFIG_PERFORMANCE_LOGGING_FRAME_COUNT env var & build setting.
Add mvkGetEnvVar(), mvkGetEnvVarInt64() & mvkGetEnvVarBool() functions.
Add MVK_SET_FROM_ENV_OR_BUILD_BOOL(), MVK_SET_FROM_ENV_OR_BUILD_INT32()
& MVK_SET_FROM_ENV_OR_BUILD_INT64() macros.
Rename MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_POOL macro
to MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE.
2019-01-09 16:59:04 -05:00
Bill Hollings
d13e5d487c Support 4 queue families.
Add config setting to determine if queue families are general or specialized.
Update to latest SPIRV-Cross version.
Update VK_MVK_MOLTENVK_SPEC_VERSION to 16.
Update MoltenVK version to 1.0.31.
2019-01-07 19:25:20 -05:00
Bill Hollings
61fc7564a0
Merge pull request #442 from billhollings/master
Fix for multiple image copy regions + Remove arm64e support for now.
2019-01-04 17:58:23 -05:00
Bill Hollings
cc09598493 Fix Metal buffer offset with multiple copy regions in MVKCmdBufferImageCopy::encode(). 2019-01-04 14:50:47 -05:00
Bill Hollings
fde6d98866 Remove support for arm64e architecture until it is better supported by Xcode. 2019-01-03 16:43:50 -05:00
Bill Hollings
99f29a05f3
Merge pull request #439 from billhollings/master
Update Brenwill copyright noticies to 2019.
2019-01-01 22:10:28 -05:00
Bill Hollings
fe55930fd5 Update Brenwill copyright noticies to 2019. 2019-01-01 21:13:25 -05:00
Bill Hollings
76146fc2a8
Merge pull request #437 from billhollings/master
Support iOS builds for arm64e architecture.
2018-12-31 18:07:37 -05:00
Bill Hollings
4e2a6f3811
Merge pull request #435 from cdavis5e/s3tc-compressed-3d
Add support for uploading 3D S3TC-compressed images.
2018-12-31 17:18:35 -05:00
Bill Hollings
36f3cedbc9 Revert What's New document. 2018-12-31 17:17:35 -05:00
Bill Hollings
b70bc49fb3 Update What's New document. 2018-12-31 17:10:29 -05:00
Chip Davis
16231fcd86 Update "What's new" doc. 2018-12-31 15:51:58 -06:00
Chip Davis
5c8a472a1b Add support for uploading 3D S3TC-compressed images.
This allows clients to initialize 3D image objects with data in a BC1,
BC2, or BC3 (aka DXTn, aka S3TC) format. Since Metal doesn't support
this natively, DXTn-compressed image data are manually decompressed
prior to upload or copying. This particular algorithm was derived from
Wine, from code originally authored by Connor McAdams. It's somewhat
primitive, and could probably stand some vectorization, but it's a good
first start.

The meat of the algorithm is pulled into a header, "MVKDXTnCodec.def",
intended to be used by both CPU and shader code. CPU uploads, which in
MoltenVK happen when binding a `VkDeviceMemory` object to an image, run
the code normally. GPU uploads, i.e. copying from a buffer to a texture,
run the algorithm as a compute shader, possibly storing the results to
an intermediate buffer to then copy directly to the texture.
Intermediate buffers are used when uploading to mip levels higher than
0, since desktop Metal doesn't support directly writing to higher mip
levels from a shader.

Only uploads are supported. Downloads are not implemented yet.

Theoretically, this could be extended to other compressed formats as
well, allowing MoltenVK to support all texture compression formats on
all platforms.
2018-12-31 15:51:06 -06:00
Bill Hollings
d5c91a9578 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2018-12-31 16:47:16 -05:00
Bill Hollings
66a407dcc6 Support iOS builds for arm64e architecture. 2018-12-31 16:46:45 -05:00
Bill Hollings
3549d13ad8
Merge pull request #433 from billhollings/master
Fix issues #429 & #430.
2018-12-31 16:18:06 -05:00
Bill Hollings
f80136c2fe
Merge pull request #436 from cdavis5e/reenable-aux-buffer
Remove needless disablement of the fragment aux buffer.
2018-12-31 15:43:14 -05:00
Bill Hollings
682523d27e Update What's New document. 2018-12-31 15:34:13 -05:00
Chip Davis
0f7525bf13 Remove needless disablement of the fragment aux buffer. 2018-12-31 13:48:53 -06:00
Bill Hollings
b74cb7b947 Swapchain supports both double and triple buffering.
Decrease minimum swapchain images to 2.
Add MVKPhysicalDeviceMetalFeatures::minSwapchainImageCount & maxSwapchainImageCount.
Minor refactoring of mvkClamp() & MVKPhysicalDevice::getSurfacePresentModes().
Update VK_MVK_MOLTENVK_SPEC_VERSION to 15.
Update MoltenVK version to 1.0.30.
2018-12-31 13:17:00 -05:00
Bill Hollings
a1ac6d9b63 Return VK_TIMEOUT even on zero wait if fences not signaled. 2018-12-30 14:32:48 -05:00
Bill Hollings
33a7ad2f85 Increase max swapchain images to 3. 2018-12-29 17:14:07 -05:00
Bill Hollings
5f661ea6d8
Merge pull request #426 from billhollings/master
Build external dependencies into static libraries in External/build when fetched.
2018-12-25 22:06:47 -05:00