664 Commits

Author SHA1 Message Date
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
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
Chip Davis
6ff8a46a3c Actually check the vertex binding I meant to check. 2018-12-17 11:05:37 -06:00
Chip Davis
288211d81f Fix handling of case where vertex bindings and binding indices don't match up. 2018-12-17 10:35:36 -06:00
Chip Davis
8e6b2e3e11 MVKPipeline: Forbid vertex attribute offsets >= stride.
Metal validates that this is so.
2018-12-17 09:36:45 -06:00
Chip Davis
972ba0e148 MVKDescriptorSet: Fix handling of immutable samplers.
Null the `sampler` field of the stored `VkDescriptorImageInfo` if the
descriptor uses an immutable sampler. That way, we won't try to
double-free a sampler.

Retain immutable samplers when the set is created. Release them when the
set is destroyed.
2018-12-17 09:32:55 -06:00
Chip Davis
9c9d23f621 MVKImage: Make BLOCK_TEXEL_VIEW a hard error.
As I feared. It's impossible to create an uncompressed view from a
compressed texture.
2018-12-17 09:32:11 -06:00
Chip Davis
79f0b175fc vkCmdCopyImage: Cast source image to the destination format.
In which I am proved wrong again. While Metal indeed won't assert if the
pixel formats don't match, the results of attempting such a copy are...
mixed, to say the least. Sometimes, nothing is copied at all. Other
times, pixels are copied in weird ways that don't seem to conform at all
to expectation. (This is most apparent in the output of the CTS's image
copying tests.) It's best, then, to ensure that the source and
destination have the same format.

Unfortunately, in the process of writing this, my fears regarding not
being able to make uncompressed views of compressed images were
confirmed. So we can't do this for compressed images.
2018-12-17 09:29:27 -06:00
Chip Davis
9f58016c35 MVKDevice: Make result of extended getFormatProperties() match the core API. 2018-12-17 09:25:31 -06:00
Chip Davis
2bfa7b47d6 vkCmdPushDescriptorSetWithTemplate: Initialize data pointer to null.
The command object assumes it is null if it hasn't been used yet. Let's
ensure this is so.
2018-12-17 09:23:46 -06:00
Bill Hollings
f3416e7806
Merge pull request #408 from billhollings/master
Update What's New document redux.
2018-12-15 16:53:43 -05:00
Bill Hollings
92c03d9dc6 Update What's New document redux. 2018-12-15 16:52:36 -05:00
Bill Hollings
34f524ee43
Merge pull request #407 from billhollings/master
Update What's New document.
2018-12-15 16:37:51 -05:00