826 Commits

Author SHA1 Message Date
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
Bill Hollings
d34b0812fe Allow building external libraries from fetchDependencies script or Xcode.
The fetchDependencies script puts build files in External/build directory.
Xcode puts build files in standard Library/.../DerivedData directory.
Copy compiled external static library files to External/build/iOS &
External/build/macOS regardless of location of intermediates.
2018-12-25 21:43:29 -05:00
Bill Hollings
5b7623953c Add Xcode project name to Travis. 2018-12-24 23:20:36 -05:00
Bill Hollings
91ed8ba4b0 Add verbose option to fetchDependencies and use it in Travis to avoid CI timeouts. 2018-12-24 22:15:23 -05:00
Bill Hollings
bdacc5392a Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2018-12-24 19:18:01 -05:00
Bill Hollings
9b42574249 Build external dependencies into static libraries in External/build when fetched.
Add separate ExternalDependencies Xcode project.
Move external dependencies to ExternalDependencies project.
The fetchDependencies script builds external dependencies libraries into External/build.
The fetchDependencies script prepares SPIRV-Tools without preparing glslang.
MoltenVK links to pre-built external dependency static libraries.
MoltenVK includes external library headers using full relative paths.
2018-12-24 19:11:15 -05:00
aerofly
50c55ed49b fix merge errors 2018-12-22 22:00:08 +01:00
aerofly
2fdee5c2e3
Merge branch 'master' into master 2018-12-22 21:39:54 +01:00
aerofly
49364bd7d2 Further reduce heap allocations. Add MVKVector128 for push constants fixed storage as per spec. 2018-12-21 10:45:07 +01:00
aerofly
d1a6c3cf32 Update aerofly fork to latest MoltenVK 2018-12-21 10:32:35 +01:00
Bill Hollings
8ad347d3f8
Merge pull request #424 from DiegoAce/master
Limit fetchDependencies Parallel Building to Number of Available Cores
2018-12-21 00:19:38 -05:00
DiegoAce
ea0bbe5780 Limit fetchDependencies Parallel Building to Number of Available Cores 2018-12-20 20:08:54 -06:00
Bill Hollings
a01b99514e
Merge pull request #420 from mlfarrell/bugfix/default-device-graphics-switching-macos
If user requests system default device curing vkCreateDevice, call …
2018-12-20 17:01:59 -05:00
Bill Hollings
0ac27b087e
Merge pull request #423 from cdavis5e/compressed-format-type
Use a specific format type for compressed formats.
2018-12-20 09:14:40 -05:00
Bill Hollings
e2bcd175bc
Merge pull request #422 from cdavis5e/aux-buffer-inline
Use an inline constant buffer for the auxiliary buffer.
2018-12-20 08:17:28 -05:00
Bill Hollings
b619951321
Merge pull request #421 from cdavis5e/print-vulkan-glsl
Enable Vulkan semantics when printing GLSL.
2018-12-20 08:09:51 -05:00
Bill Hollings
7152633db8
Merge pull request #412 from cdavis5e/forbid-uncompressed-views
MVKImage: Make BLOCK_TEXEL_VIEW a hard error.
2018-12-20 08:08:01 -05:00
Chip Davis
7c2ce795bb Use a specific format type for compressed formats.
Instead of assuming that `kMVKFormatNone` means the format is
compressed. This makes the code doing these checks more obvious and
self-documenting.

Since I changed the public MoltenVK-specific API, I also bumped the
`VK_MVK_moltenvk` spec revision.
2018-12-19 12:25:03 -07:00
Chip Davis
d973602edb Use an inline constant buffer for the auxiliary buffer.
Since a pipeline might be shared between multiple draws, but those draws
could use different textures, it isn't tenable to have a single aux
buffer shared between those draws. Instead, we'll set up constant
buffers using the `setXxxBytes()` method on the command encoder. That
way, separate draws using the same pipeline won't interfere with each
other.

This change also uses separate buffers for the vertex and fragment
shaders, since they may have different sets of textures.
2018-12-19 11:34:03 -07:00
Chip Davis
94fc4de563 Also claim the BLOCK_TEXEL_VIEW_COMPATIBLE bit is unsupported. 2018-12-19 11:32:25 -07:00
Chip Davis
4c9816d424 Enable Vulkan semantics when printing GLSL. 2018-12-19 11:29:38 -07:00
Bill Hollings
c3838c15de
Merge pull request #414 from cdavis5e/vertex-attr-offset-stride
MVKPipeline: Forbid vertex attribute offsets >= stride.
2018-12-19 12:23:56 -05:00
Bill Hollings
6aa4ddbffc
Merge pull request #413 from cdavis5e/immutable-sampler-lifetime
MVKDescriptorSet: Fix handling of immutable samplers.
2018-12-19 12:22:14 -05:00
Bill Hollings
4049518683
Merge pull request #411 from cdavis5e/copy-image-compat-format-2
vkCmdCopyImage: Cast source image to the destination format.
2018-12-19 12:05:10 -05:00
Bill Hollings
7b0630290f
Merge pull request #410 from cdavis5e/format-props-2-match-core
MVKDevice: Make result of extended getFormatProperties() match the core API.
2018-12-19 11:49:45 -05:00
Bill Hollings
f3fc725f38
Merge pull request #409 from cdavis5e/push-descriptor-uninit-ptr
vkCmdPushDescriptorSetWithTemplate: Initialize data pointer to null.
2018-12-19 11:41:38 -05:00
Mike Farrell
e658f9d1c4 - if user requests system default device curing vkCreateDevice, call required trigger method MTLCreateSystemDefaultDevice() to ensure proper graphics switching occurs on macos 2018-12-19 01:32:18 -08:00
aerofly
d87b71887e Reduce heap allocations during rendering 2018-12-18 15:59:49 +01:00