428 Commits

Author SHA1 Message Date
Bill Hollings
70dae8946a
Merge pull request #290 from billhollings/master
Allocate MVKDescriptorSets from a pool within MVKDescriptorPool.
2018-10-01 16:59:57 -04:00
Bill Hollings
05e028084b Update What's New document. 2018-10-01 16:32:50 -04:00
Bill Hollings
c933330406 Allocate MVKDescriptorSets from a pool within MVKDescriptorPool,
keyed by MVKDescriptorSetLayout reference.

Add MVKObjectPool subclass MVKDeviceObjectPool.
Enlarge window dimensions on macOS Cube demo.
2018-09-30 18:07:13 -04:00
Bill Hollings
26c7b69a3f
Merge pull request #288 from billhollings/master
Update glslang version and What's New document.
2018-09-27 22:36:08 -04:00
Bill Hollings
cded63b008 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2018-09-27 18:21:05 -04:00
Bill Hollings
9f28854a2a Update glslang version and What's New document. 2018-09-27 18:20:20 -04:00
Bill Hollings
dc0da2ceb6
Merge pull request #287 from cdavis5e/render-area
Use the passed render area to set the render target extent.
2018-09-27 18:17:25 -04:00
Chip Davis
6f1c97966c Use the passed render area to set the render target extent.
Use the smaller of the render area and the framebuffer area.
2018-09-27 16:29:37 -05:00
Bill Hollings
7ffc5bd806
Merge pull request #286 from cdavis5e/resource-array-dynamic-indexing
Support the shader{Sampled,Storage}ImageArrayDynamicIndexing feature.
2018-09-27 17:27:11 -04:00
Bill Hollings
dfcc815c82
Merge pull request #285 from cdavis5e/tsan-build
Build the dylib with -fsanitize=thread when tsan is enabled.
2018-09-27 17:25:50 -04:00
Khronos Group Webmaster
7953a73016
Update LICENSE
Change Apache 2.0 to Khronos Apache 2.0 CLA
2018-09-27 17:09:36 -04:00
Bill Hollings
8c58c0bf72
Merge pull request #284 from cdavis5e/no-attachments
Add a dummy attachment in case no attachments were specified.
2018-09-27 16:29:06 -04:00
Chip Davis
fcbbdc1948 Support the shader{Sampled,Storage}ImageArrayDynamicIndexing feature.
Update SPIRV-Cross to support dynamic indexing on iOS 10... and to
actually support arrays of input buffers (which should've been present
before I flipped the `shader{Uniform,Storage}BufferArrayDynamicIndexing`
switch).

Bump patch version.

Fixes #96.
2018-09-27 13:11:55 -05:00
Chip Davis
522793e680 Build the dylib with -fsanitize=thread when tsan is enabled. 2018-09-27 11:27:36 -05:00
Chip Davis
f9022614bb Add a dummy attachment in case no attachments were specified.
Metal currently requires at least one attachment, in order to define the
size of the render target area (and thus, how many times to run the
fragment shader). Vulkan, however, allows specifying no attachments. In
that case, the size of the render target area comes from the extent and
layer count of the framebuffer object. Since Metal doesn't let you (at
least on macOS) define the render target area without an attachment, we
have to supply a dummy attachment that will be discarded once rendering
is complete.

When possible, the render target uses the memoryless storage mode,
falling back to private when that isn't supported. It is marked as
volatile, and its load and store actions are set to "don't care." The
texture is retained for the lifetime of the subpass.
2018-09-26 21:00:07 -05:00
Bill Hollings
99a242e167 Allocate MVKCommandBuffers from a pool within MVKCommandPool.
Add support for trimming command pools.
2018-09-26 18:31:31 -04:00
Bill Hollings
4c5f7b8b0d
Merge pull request #281 from billhollings/master
Update What's New document.
2018-09-25 14:22:36 -04:00
Bill Hollings
dfa27ecc61 Update SPRIV-Cross version. 2018-09-25 13:47:43 -04:00
Bill Hollings
166ff6adf5 Update What's New document. 2018-09-25 13:09:36 -04:00
Bill Hollings
1f7bd607d1
Merge pull request #280 from cdavis5e/fix-dedicated-alloc-segfault
MVKResource: Check that a VkDeviceMemory is nonnull before using it.
2018-09-25 12:01:26 -04:00
Bill Hollings
c89d22fc31
Merge pull request #279 from cdavis5e/vertex-attribute-divisor
Support the VK_EXT_vertex_attribute_divisor extension.
2018-09-25 11:59:49 -04:00
Chip Davis
f1888dff95 MVKResource: Check that a VkDeviceMemory is nonnull before using it. 2018-09-25 10:21:08 -05:00
Chip Davis
d667f570f6 Support the VK_EXT_vertex_attribute_divisor extension. 2018-09-25 10:19:05 -05:00
Bill Hollings
1533fdda39
Merge pull request #278 from cdavis5e/fix-query-deadlock
MVKQueryPool: Shunt copying results off to another thread.
2018-09-25 10:56:29 -04:00
Bill Hollings
ec32a16971
Merge pull request #276 from cdavis5e/fence-sitter-race
MVKFenceSitter: Put a hash table read behind the lock.
2018-09-25 10:51:07 -04:00
Bill Hollings
873bceabe5
Merge pull request #275 from cdavis5e/3d-subviews
Better support subviews of 3D textures.
2018-09-25 10:48:11 -04:00
Bill Hollings
21cb79df09
Merge pull request #274 from cdavis5e/render-target-size
vkRenderPass: Set renderTargetWidth and renderTargetHeight when possible.
2018-09-25 10:47:48 -04:00
Bill Hollings
6b18bd2e40
Merge pull request #273 from cdavis5e/sampler-mirror-clamp-to-edge
Advertise the VK_KHR_sampler_mirror_clamp_to_edge extension.
2018-09-25 10:47:31 -04:00
Chip Davis
6ec39da6b2 MVKQueryPool: Shunt copying results off to another thread.
Copying the results could block if the client said to wait. If this
completion handler runs before the one that actually finishes the
queries--and it will if it's scheduled first--it will block
indefinitely, causing a deadlock. Instead, run this on a different
dispatch queue; then the query will be allowed to finish.
2018-09-25 08:55:13 -05:00
Chip Davis
dd367fea0c MVKFenceSitter: Put a hash table read behind the lock.
To avoid a data race. Caught this with `ThreadSanitizer`.
2018-09-24 17:12:23 -05:00
Chip Davis
5f5f2243c2 Better support subviews of 3D textures.
Now when we set up the `MTLRenderPassAttachmentDescriptor` for the 3D
texture, we set the `depthPlane` property instead of the `slice`
property. Combined with an appropriate setting for
`renderTargetArrayLength` in the base descriptor, this allows rendering
to a subset of a 3D texture.
2018-09-24 16:35:19 -05:00
Chip Davis
74e0ce8962 vkRenderPass: Set renderTargetWidth and renderTargetHeight when possible.
These properties were introduced in Metal 2.0 on iOS. (They don't exist
yet on Mac.) Currently, they are only used to constrain the size of the
render target area. Perhaps someday, they may be used to support render
passes with no render target attachments. For now, though, Metal doesn't
support that.
2018-09-24 16:30:34 -05:00
Chip Davis
7e050d0584 Advertise the VK_KHR_sampler_mirror_clamp_to_edge extension.
We already support this extension. The enumerant added by this extension
is already mapped to its Metal equivalent. Only advertise the extension
on macOS, though. iOS doesn't support this.
2018-09-24 16:27:37 -05:00
Bill Hollings
ac10059a6b
Merge pull request #272 from cdavis5e/khr-maintenance2
Support the VK_KHR_maintenance2 extension.
2018-09-24 17:24:20 -04:00
Chip Davis
3b65e20936 Validate the image view config after setting the usage.
It's not convenient to get the usage out of the `pCreateInfo`, since
it's tucked away in an extension struct. (Unfortunately, I had assumed
we were already doing this...)
2018-09-24 15:50:03 -05:00
Chip Davis
32d4702265 Support the VK_KHR_maintenance2 extension.
We don't really restrict which usages you can request on an image, so
the `VK_IMAGE_CREATE_EXTENDED_USAGE_BIT` doesn't really apply to us.
Since we don't yet support tessellation, we don't support
`VkPipelineTessellationDomainOriginStateCreateInfo`, either. Finally,
as near as I can tell, we don't really do anything with input
attachments, so any `VkRenderPassInputAttachmentAspectCreateInfo` will
be ignored.

I'm not sure if creating image views of compressed images using an
uncompressed format will work. Metal's docs say texture views between
any two color formats of the same size will work, but they also
specifically call out converting between sRGB and non-sRGB compressed
formats, which implies that, say, creating an `RG32Uint` view on a
`BC1_RGBA` texture may not work. Thus, I've logged any uses of the
`VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT`.
2018-09-24 15:15:07 -05:00
Bill Hollings
aab8b9a798
Merge pull request #271 from cdavis5e/image-format-list
Advertise the VK_KHR_image_format_list extension.
2018-09-21 18:50:05 -04:00
Chip Davis
876ceeb269 Advertise the VK_KHR_image_format_list extension.
We don't actually do anything with the extension struct, but that's OK;
it's just an optimization hint anyway. I'm not sure what we'd do with
this information. It's intended to enable implementations to better
optimize image layouts, but that's under Metal's control in MoltenVK.
2018-09-20 21:24:55 -05:00
Bill Hollings
dd9408fa50
Merge pull request #270 from billhollings/master
Update library dependencies for Vulkan SDK.
2018-09-20 22:02:10 -04:00
Bill Hollings
7051582859 Update library dependencies for Vulkan SDK. 2018-09-20 21:02:39 -04:00
Bill Hollings
ccc534d583
Merge pull request #269 from cdavis5e/really-update-spirv-cross
Fix SPIRV-Cross update that I bungled.
2018-09-20 19:49:05 -04:00
Bill Hollings
57e361d95d
Merge pull request #267 from cdavis5e/dedicated-alloc
Support the VK_KHR_dedicated_allocation extension.
2018-09-20 19:27:41 -04:00
Bill Hollings
523f1571af
Merge pull request #268 from billhollings/master
Update travis to use Xcode 10.
2018-09-20 19:26:37 -04:00
Chip Davis
f0db0c746a Fix SPIRV-Cross update that I bungled.
(Do I have to bump the patch version again...?)
2018-09-20 18:19:25 -05:00
Chip Davis
ecddc6a539 Log failures to use dedicated allocs with the wrong objects. 2018-09-20 16:13:19 -05:00
Bill Hollings
d9cae70f85 Update travis to use Xcode 10. 2018-09-20 17:10:03 -04:00
Chip Davis
b9a42fe815 Support the VK_KHR_dedicated_allocation extension.
This is used to declare that a `VkDeviceMemory` object is for the sole
use of a particular buffer or image.

In fact, until Metal 1.2 on iOS (2.0 on Mac), Metal didn't really
support anything *but* dedicated allocations. MoltenVK hacks around this
limitation by manually syncing memory between buffers and images that
used the `VkDeviceMemory` object.

Maybe someday we can use the new `MTLHeap` object to support some sort
of sub-allocation scheme. But at this moment, it won't let you specify
the exact offset within the heap, nor can it be used for managed or (on
macOS) shared memory, nor will it let you directly map the heap memory
(something that could be worked around with an aliasable `MTLBuffer`
taking up the entire heap space), all of which makes it unsuitable for
implementing `VkDeviceMemory`. So, for now, we always prefer dedicated
allocation.
2018-09-20 15:46:04 -05:00
Bill Hollings
c329fa68ee
Merge pull request #266 from cdavis5e/get-memory-reqs-2
Support the VK_KHR_get_memory_requirements2 extension.
2018-09-20 16:45:00 -04:00
Chip Davis
77f935c265 Support the VK_KHR_get_memory_requirements2 extension.
In preparation for supporting `VK_KHR_dedicated_allocation`.
2018-09-20 14:21:12 -05:00
Bill Hollings
54b9f1364d
Merge pull request #265 from cdavis5e/more-easy-features
Advertise some more features we already support.
2018-09-20 15:18:26 -04:00