From 9e1a4666691bae953967d63424527719a5104410 Mon Sep 17 00:00:00 2001 From: Chip Davis Date: Fri, 26 Oct 2018 23:16:33 -0500 Subject: [PATCH 1/2] Support the VK_KHR_16bit_storage extension. This extension allows shaders to use 16-bit types in buffers, push constants, and shader inputs and outputs. One step closer to Vulkan 1.1. --- MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm | 9 +++++++++ MoltenVK/MoltenVK/Layers/MVKExtensions.def | 1 + 2 files changed, 10 insertions(+) diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm index 5aec2d95..51ac2f0c 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm @@ -65,6 +65,15 @@ void MVKPhysicalDevice::getFeatures(VkPhysicalDeviceFeatures2* features) { auto* next = (VkStructureType*)features->pNext; while (next) { switch (*next) { + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: { + auto* storageFeatures = (VkPhysicalDevice16BitStorageFeatures*)next; + storageFeatures->storageBuffer16BitAccess = true; + storageFeatures->uniformAndStorageBuffer16BitAccess = true; + storageFeatures->storagePushConstant16 = true; + storageFeatures->storageInputOutput16 = true; + next = (VkStructureType*)storageFeatures->pNext; + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT: { auto* divisorFeatures = (VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT*)next; divisorFeatures->vertexAttributeInstanceRateDivisor = true; diff --git a/MoltenVK/MoltenVK/Layers/MVKExtensions.def b/MoltenVK/MoltenVK/Layers/MVKExtensions.def index ccffcafe..6cb3b21d 100644 --- a/MoltenVK/MoltenVK/Layers/MVKExtensions.def +++ b/MoltenVK/MoltenVK/Layers/MVKExtensions.def @@ -30,6 +30,7 @@ #define MVK_EXTENSION_LAST(var, EXT) MVK_EXTENSION(var, EXT) #endif +MVK_EXTENSION(KHR_16bit_storage, KHR_16BIT_STORAGE) MVK_EXTENSION(KHR_dedicated_allocation, KHR_DEDICATED_ALLOCATION) MVK_EXTENSION(KHR_descriptor_update_template, KHR_DESCRIPTOR_UPDATE_TEMPLATE) MVK_EXTENSION(KHR_get_memory_requirements2, KHR_GET_MEMORY_REQUIREMENTS_2) From 533e25c342bb32687ce244e049cf7abc0b05eaaf Mon Sep 17 00:00:00 2001 From: Chip Davis Date: Tue, 4 Dec 2018 15:55:18 -0600 Subject: [PATCH 2/2] Add all the extensions I added over the past few months to the user guide. Sort the list. --- Docs/MoltenVK_Runtime_UserGuide.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Docs/MoltenVK_Runtime_UserGuide.md b/Docs/MoltenVK_Runtime_UserGuide.md index 74668126..cb276b06 100644 --- a/Docs/MoltenVK_Runtime_UserGuide.md +++ b/Docs/MoltenVK_Runtime_UserGuide.md @@ -221,17 +221,28 @@ in your source code files as follows: In addition to the core *Vulkan* API, **MoltenVK** also supports the following *Vulkan* extensions: +- `VK_KHR_16bit_storage` +- `VK_KHR_dedicated_allocation` +- `VK_KHR_descriptor_update_template` +- `VK_KHR_get_memory_requirements2` +- `VK_KHR_get_physical_device_properties2` +- `VK_KHR_image_format_list` +- `VK_KHR_maintenance1` +- `VK_KHR_maintenance2` +- `VK_KHR_maintenance3` +- `VK_KHR_push_descriptor` +- `VK_KHR_relaxed_block_layout` +- `VK_KHR_sampler_mirror_clamp_to_edge` +- `VK_KHR_shader_draw_parameters` +- `VK_KHR_storage_buffer_storage_class` +- `VK_KHR_surface` +- `VK_KHR_swapchain` +- `VK_EXT_shader_viewport_index_layer` +- `VK_EXT_vertex_attribute_divisor` - `VK_MVK_moltenvk` - `VK_MVK_macos_surface` (macOS) - `VK_MVK_ios_surface` (iOS) -- `VK_KHR_surface` -- `VK_KHR_swapchain` -- `vk_KHR_maintenance1` -- `vk_AMD_negative_viewport_height` -- `vk_KHR_shader_draw_parameters` -- `vk_KHR_get_physical_device_properties2` -- `vk_KHR_push_descriptor` -- `vk_KHR_descriptor_update_template` +- `VK_AMD_negative_viewport_height` - `VK_IMG_format_pvrtc` (iOS) In order to visibly display your content on *iOS* or *macOS*, you must enable the `VK_MVK_ios_surface`