1949 Commits

Author SHA1 Message Date
Chip Davis
51afe4745e Enable VK_AMD_shader_image_load_store_lod for Apple Silicon on Mac. 2020-11-04 16:23:33 -06:00
Bill Hollings
5be7b2d8d5
Merge pull request #1131 from billhollings/VK_EXT_descriptor_indexing
Initial support for the VK_EXT_descriptor_indexing extension
2020-11-04 13:17:41 -05:00
Bill Hollings
e23ead807e Fix typo. 2020-11-04 13:00:49 -05:00
Bill Hollings
6e5984832f Sync VK_EXT_descriptor_indexing branch with master. 2020-11-04 11:07:27 -05:00
Bill Hollings
ae20a01c17
Merge pull request #1133 from cdavis5e/dylib-ubsan
Scripts: Support ubsan when building the dylib.
2020-11-04 10:59:32 -05:00
Bill Hollings
77dc97631e
Merge pull request #1132 from cdavis5e/tvos-supported-extensions
MVKExtensions: Add missing tvOS case for unsupported extensions.
2020-11-04 10:58:41 -05:00
Bill Hollings
3288a3f445
Merge pull request #1130 from cdavis5e/apple-gpu-pixel-formats-mac
Support Apple GPU pixel formats with Apple Silicon on Mac.
2020-11-04 10:57:43 -05:00
Chip Davis
0f5af085e7 Scripts: Support ubsan when building the dylib. 2020-11-03 16:25:59 -06:00
Chip Davis
abf2cba022 MVKExtensions: Add missing tvOS case for unsupported extensions. 2020-11-03 16:24:09 -06:00
Chip Davis
d635d19de4 Support Apple GPU pixel formats with Apple Silicon on Mac.
Also, enable rendering caps on linear textures. This is supported on
Apple GPUs.

Conversely, disable capabilities supported by desktop GPUs that are not
supported on Apple GPUs.

Sadly, no support for 16-bit packed pixel formats on non-Apple GPUs.
2020-11-03 16:23:36 -06:00
Bill Hollings
3910f09b6f Sync VK_EXT_descriptor_indexing branch with master. 2020-11-03 12:10:00 -05:00
Bill Hollings
d3155bd811 VK_EXT_descriptor_indexing add support for update after binding.
MVKDevice track enabled VkPhysicalDeviceInlineUniformBlockFeaturesEXT features.
Disable prefilled MTLCommandBuffers if update after binding enabled.
Update to latest SPIRV-Cross that includes support for unsized arrays.
2020-11-03 11:40:10 -05:00
Bill Hollings
3d952d5ed4 Support setting sizes of SPIR-V unsized arrays.
Set SPIRV-Cross MSLResourceBinding::size value
from MVKDescriptorSetLayoutBinding descriptor count.
2020-10-31 17:50:08 -04:00
Bill Hollings
6bd5b76a14
Merge pull request #1128 from cdavis5e/memoryless-mac
Expose MTLStorageTypeMemoryless for Apple Silicon on Mac.
2020-10-30 11:53:24 -04:00
Chip Davis
387763797d Expose MTLStorageTypeMemoryless for Apple Silicon on Mac. 2020-10-29 12:39:34 -05:00
Bill Hollings
ef7f42035d
Merge pull request #1126 from cdavis5e/apple-gpu-properties-mac
MVKDevice: Set properties for Apple Silicon GPUs on macOS.
2020-10-29 13:30:53 -04:00
Bill Hollings
4055d84a22 Use variable descriptor count when determining descriptor binding count.
MVKDescriptorSetLayoutBinding::getDescriptorCount() considers descriptor set
it is being applied to if it has a variable descriptor count.
Consolidate descriptor creation for inline uniform block with other types.
Don't track dynamic offsets consumed by the descriptor set layout. Instead,
during descriptor binding, track dynamic offsets consumed by each binding and set.
2020-10-28 22:36:59 -04:00
Chip Davis
d73017f4db MVKDevice: Set properties for Apple Silicon GPUs on macOS. 2020-10-28 19:35:24 -05:00
Bill Hollings
0098e94668 Set VK_EXT_descriptor_indexing features and properties.
Increase per-stage texture count to 96 for A11 SoC's and above.
Report VkPhysicalDeviceLimits::maxPerStageDescriptorStorageImages as Metal limit of 8.
Add MVKPhysicalDeviceMetalFeatures::maxPerStageStorageTextureCount and set to 8.
Update VK_MVK_MOLTENVK_SPEC_VERSION to 29.
2020-10-28 19:36:33 -04:00
Bill Hollings
4a1a5179bd
Merge pull request #1124 from cdavis5e/khr-timeline-semaphore
Support the VK_KHR_timeline_semaphore extension.
2020-10-28 12:58:41 -04:00
Chip Davis
2b7f9aee43 Support the VK_KHR_timeline_semaphore extension.
This implementation uses `MTLSharedEvent` where possible, and emulates
it on the host otherwise. Unlike binary semaphores, `MTLSharedEvent`s
map well to timeline semaphores; there should be no problems using them
when they're available.

I'm extremely confident in the `MTLSharedEvent`-based implementation. It
passes nearly all the synchronization tests. I'm less confident in the
emulated implementation.
2020-10-27 18:56:00 -05:00
Bill Hollings
794edc5ec1 Initial support for handling VK_EXT_descriptor_indexing structures.
VK_EXT_descriptor_indexing adds no new functions, but does add six structures to
existing pNext chains. This initial commit processes these structs, but does not
yet perform any operational functionality for this extension.
2020-10-27 11:32:06 -04:00
Bill Hollings
dd08daa478
Merge pull request #1123 from cdavis5e/intel-nv-strictlines
MVKPhysicalDevice: Enable strictLines for Intel and NVIDIA.
2020-10-27 10:20:45 -04:00
Bill Hollings
c156ccb11b
Merge pull request #1121 from cdavis5e/3d-blit-r-offset
MVKCmdBlitImage: Add 0.5 to layer index before interpolating.
2020-10-27 10:05:21 -04:00
Chip Davis
1aad3c3659 MVKPhysicalDevice: Enable strictLines for Intel and NVIDIA.
Both Intel and NV Vulkan drivers enable `strictLines`. My testing shows
in fact that AMD and Apple Silicon exhibit the non-strict-line behavior,
while Intel shows the strict-line behavior.
2020-10-26 17:53:27 -05:00
Chip Davis
9cf3a21b40 MVKCmdBlitImage: Add 0.5 to layer index before interpolating.
This is why the 3D blit tests failed.
2020-10-23 19:05:29 -05:00
Bill Hollings
bc8bb0453f
Merge pull request #1120 from js6i/master
MVKPipeline: shorten vertex attribute format's length when stride < size
2020-10-22 13:13:04 -04:00
Jan Sikorski
e7c49d4e7f MVKPipeline: shorten vertex attribute format's length when stride < size
Metal currently does not support overlapping attribute loads and asserts on
them. Prevent it by shortening format's vector length to fit within the stride,
but print a cautionary message.

An example of affected program is Kingdom Come: Deliverance, which sets
attribute format to RGBA32 in IA and binding stride to 12, while the shader
input is just a float3.
2020-10-22 18:37:41 +02:00
Jan Sikorski
9ee50b526a MVKPixelFormats: Add getName() for MTLVertexFormat 2020-10-22 18:37:41 +02:00
Bill Hollings
9097890688
Merge pull request #1119 from billhollings/xc122
Upgrade to Xcode 12.2 build settings.
2020-10-22 09:57:13 -04:00
Bill Hollings
a71267797d Upgrade to Xcode 12.2 build settings. 2020-10-21 23:01:33 -04:00
Bill Hollings
6595ac8987
Merge pull request #1118 from cdavis5e/3d-image-view-render
MVKImage: Always set the depth plane when rendering to a 3D image.
2020-10-21 20:07:00 -04:00
Chip Davis
b052600404 MVKImage: Always set the depth plane when rendering to a 3D image.
Even if we used a texture view. We can't constrain the depth planes in a
3D texture using a texture view, so we need to set the render depth
plane in that case.
2020-10-21 18:04:20 -05:00
Bill Hollings
59ab58484a
Merge pull request #1117 from billhollings/master
Allow binding descriptor set using layout different than it was created with.
2020-10-21 18:06:42 -04:00
Bill Hollings
a66f00f4de
Merge pull request #1116 from cdavis5e/view-ignore-transfer-usage
MVKImageView: Always ignore transfer usages.
2020-10-21 18:04:11 -04:00
Bill Hollings
eb81f2b5be Streamline binding access in MVKDescriptorSetLayout.
Use temporary MVKSmallVector of bindings to sort dynamic offset indices.
Use getDescriptor() where in read/write functions.
2020-10-21 15:34:10 -04:00
Chip Davis
b3f828afcd MVKImageView: Always ignore transfer usages.
Transfer commands don't use image views. The transfer usages, then,
shouldn't figure into whether it's valid to use a view a particular way.
2020-10-21 10:12:45 -05:00
Bill Hollings
0738e5471b MVKDescriptorSetLayout speed up lookup of descriptor index. 2020-10-20 21:56:31 -04:00
Bill Hollings
cd9e2b0437 Allow binding descriptor set using layout different than it was created with.
Bind descriptors based on binding number within pipeline layout, not order within
layout, and descriptor set looks up descriptor using binding layout it was created with.
2020-10-20 17:24:17 -04:00
Bill Hollings
35d4e5d2d5
Merge pull request #1115 from cdavis5e/align-plane-heap-offsets
MVKImage: Make sure plane heap offsets are properly aligned.
2020-10-19 17:06:22 -04:00
Bill Hollings
90f069e86f
Merge pull request #1114 from cdavis5e/max-point-size
MVKPhysicalDevice: Reduce maximum point size to 64.
2020-10-19 15:29:59 -04:00
Chip Davis
5e832634ca MVKImage: Make sure plane heap offsets are properly aligned.
If the texture is not properly aligned, creation will fail. Make sure
we ask for enough memory to hold all planes with alignment, or a plane
could wind up beyond the bounds of the heap.
2020-10-19 14:11:05 -05:00
Bill Hollings
9290f4e3a5
Merge pull request #1113 from cdavis5e/linear-image-mtlheap
MVKImage: Always use texel buffers for linear images in MTLHeaps.
2020-10-19 15:05:20 -04:00
Chip Davis
aeb0ec2b7c MVKPhysicalDevice: Reduce maximum point size to 64.
The Metal Feature Set Tables lied. The maximum point size supported by a
device varies; values higher than the true maximum are clamped. For
example, my AMD Radeon Pro 460 clamps point sizes above 64, and my Intel
HD Graphics 530 clamps them above 256. 64 is the minimum maximum
mandated by Vulkan, so that's what we'll report.
2020-10-19 13:54:30 -05:00
Bill Hollings
a9255d379f
Merge pull request #1112 from cdavis5e/max-desc-set-rez
MVKPhysicalDevice: Correct max descriptor set resources.
2020-10-19 14:52:44 -04:00
Chip Davis
be0f67d79d MVKImage: Always use texel buffers for linear images in MTLHeaps.
This is particularly important if the resource will be aliased with
another resource; the memory in this case must have a linear layout.
2020-10-18 22:08:35 -05:00
Chip Davis
f0ba184c41 MVKPhysicalDevice: Correct max descriptor set resources.
The minimum number of samplers is the lesser of 96 or *n* times the
per-stage maximum, where *n* is the number of stages supported. So we
need to account for compute shaders as well as graphics pipeline
shaders.
2020-10-18 22:06:22 -05:00
Bill Hollings
af331a393f
Merge pull request #1111 from cdavis5e/capture-scope-refcount-kluge
MVKGPUCapture: Make sure the MTLCaptureScope has only one reference.
2020-10-18 15:30:52 -04:00
Bill Hollings
343a55c91a
Merge pull request #1110 from cdavis5e/cull-mode-both
MVKPipeline: Also disable rasterization if culling both sides.
2020-10-18 15:17:30 -04:00
Bill Hollings
e39a5b0457
Merge pull request #1109 from cdavis5e/fragment-components
MVKPhysicalDevice: Correct fragment input component limit.
2020-10-18 14:40:14 -04:00