diff --git a/Docs/MoltenVK_Runtime_UserGuide.md b/Docs/MoltenVK_Runtime_UserGuide.md index 80528d54..b3270cda 100644 --- a/Docs/MoltenVK_Runtime_UserGuide.md +++ b/Docs/MoltenVK_Runtime_UserGuide.md @@ -274,6 +274,7 @@ In addition to core *Vulkan* functionality, **MoltenVK** also supports the foll - `VK_EXT_memory_budget` *(requires Metal 2.0)* - `VK_EXT_metal_surface` - `VK_EXT_post_depth_coverage` *(iOS, requires GPU family 4)* +- `VK_EXT_robustness2` - `VK_EXT_scalar_block_layout` - `VK_EXT_shader_stencil_export` *(requires Mac GPU family 2 or iOS GPU family 5)* - `VK_EXT_shader_viewport_index_layer` diff --git a/Docs/Whats_New.md b/Docs/Whats_New.md index 987a2cc1..14e79ac6 100644 --- a/Docs/Whats_New.md +++ b/Docs/Whats_New.md @@ -20,6 +20,7 @@ Released TBD - Add support for extensions: - VK_KHR_sampler_ycbcr_conversion + - VK_EXT_robustness2 - Fix issue where mapped host-coherent device memory not updated from image contents on *macOS*. - Remove use of `@available()` directive as it was causing issues in some build environments. - Refactor **MoltenVK** *Xcode* build architectures. diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm index e12ed99e..0f7b4784 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm @@ -114,6 +114,13 @@ void MVKPhysicalDevice::getFeatures(VkPhysicalDeviceFeatures2* features) { hostQueryResetFeatures->hostQueryReset = true; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: { + auto* robustness2Features = (VkPhysicalDeviceRobustness2FeaturesEXT*)next; + robustness2Features->robustBufferAccess2 = false; + robustness2Features->robustImageAccess2 = true; + robustness2Features->nullDescriptor = false; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT: { auto* scalarLayoutFeatures = (VkPhysicalDeviceScalarBlockLayoutFeaturesEXT*)next; scalarLayoutFeatures->scalarBlockLayout = true; @@ -186,6 +193,14 @@ void MVKPhysicalDevice::getProperties(VkPhysicalDeviceProperties2* properties) { pushDescProps->maxPushDescriptors = _properties.limits.maxPerStageResources; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: { + auto* robustness2Props = (VkPhysicalDeviceRobustness2PropertiesEXT*)next; + // This isn't implemented yet, but when it is, I expect that we'll wind up + // doing it manually. + robustness2Props->robustStorageBufferAccessSizeAlignment = 1; + robustness2Props->robustUniformBufferAccessSizeAlignment = 1; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT: { auto* texelBuffAlignProps = (VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT*)next; // Save the 'next' pointer; we'll unintentionally overwrite it diff --git a/MoltenVK/MoltenVK/Layers/MVKExtensions.def b/MoltenVK/MoltenVK/Layers/MVKExtensions.def index 0c74478d..a3638b1c 100644 --- a/MoltenVK/MoltenVK/Layers/MVKExtensions.def +++ b/MoltenVK/MoltenVK/Layers/MVKExtensions.def @@ -77,6 +77,7 @@ MVK_EXTENSION(EXT_inline_uniform_block, EXT_INLINE_UNIFORM_BLOCK, DEVICE) MVK_EXTENSION(EXT_memory_budget, EXT_MEMORY_BUDGET, DEVICE) MVK_EXTENSION(EXT_metal_surface, EXT_METAL_SURFACE, INSTANCE) MVK_EXTENSION(EXT_post_depth_coverage, EXT_POST_DEPTH_COVERAGE, DEVICE) +MVK_EXTENSION(EXT_robustness2, EXT_ROBUSTNESS_2, DEVICE) MVK_EXTENSION(EXT_scalar_block_layout, EXT_SCALAR_BLOCK_LAYOUT, DEVICE) MVK_EXTENSION(EXT_shader_stencil_export, EXT_SHADER_STENCIL_EXPORT, DEVICE) MVK_EXTENSION(EXT_shader_viewport_index_layer, EXT_SHADER_VIEWPORT_INDEX_LAYER, DEVICE)