-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
- Update to latest SPIRV-Cross to support `SPV_KHR_physical_storage_buffer` for `VK_KHR_buffer_device_address` and `VK_EXT_buffer_device_address` - Add support for `VK_EXT_buffer_device_address` extension. - Advertise support for `VK_KHR_buffer_device_address` and `VK_EXT_buffer_device_address` on macOS 12.5. - Add appropriate extension reporting and enablement for `VkPhysicalDeviceBufferDeviceAddressFeatures`, `VkPhysicalDeviceBufferDeviceAddressFeaturesEXT`, and `VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR`. - Support reading `VkMemoryAllocateFlagsInfo` to identify memory allocations that need to support buffer pointer access (in case needed in future on non-shared memory). - Update `Whats_New.md` and `MoltenVK_Runtime_UserGuide` documents.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
50b4d5389b6a06f86fb63a2848e1a7da6d9755ca | ||
d8d051381f65b9606fb8016c79b7c3bab872eec3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,16 +288,23 @@ | |
break; | ||
} | ||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: { | ||
auto* barycentricProperties = (VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR*)next; | ||
barycentricProperties->fragmentShaderBarycentric = true; | ||
auto* barycentricFeatures = (VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR*)next; | ||
barycentricFeatures->fragmentShaderBarycentric = true; | ||
break; | ||
} | ||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: { | ||
auto* bufferDeviceAddressFeatures = (VkPhysicalDeviceBufferDeviceAddressFeatures*)next; | ||
bufferDeviceAddressFeatures->bufferDeviceAddress = true; | ||
bufferDeviceAddressFeatures->bufferDeviceAddress = mvkOSVersionIsAtLeast(12.05, 16.0); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
billhollings
Author
Contributor
|
||
bufferDeviceAddressFeatures->bufferDeviceAddressCaptureReplay = false; | ||
bufferDeviceAddressFeatures->bufferDeviceAddressMultiDevice = false; | ||
} | ||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: { | ||
auto* bufferDeviceAddressFeatures = (VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*)next; | ||
bufferDeviceAddressFeatures->bufferDeviceAddress = mvkOSVersionIsAtLeast(12.05, 16.0); | ||
bufferDeviceAddressFeatures->bufferDeviceAddressCaptureReplay = false; | ||
bufferDeviceAddressFeatures->bufferDeviceAddressMultiDevice = false; | ||
break; | ||
} | ||
default: | ||
break; | ||
} | ||
|
@@ -4115,7 +4122,10 @@ static uint32_t mvkGetEntryProperty(io_registry_entry_t entry, CFStringRef prope | |
_enabledPortabilityFeatures(), | ||
_enabledImagelessFramebufferFeatures(), | ||
_enabledDynamicRenderingFeatures(), | ||
_enabledSeparateDepthStencilLayoutsFeatures() { | ||
_enabledSeparateDepthStencilLayoutsFeatures(), | ||
_enabledFragmentShaderBarycentricFeatures(), | ||
_enabledBufferDeviceAddressFeatures(), | ||
_enabledBufferDeviceAddressFeaturesEXT() { | ||
|
||
// If the physical device is lost, bail. | ||
if (physicalDevice->getConfigurationResult() != VK_SUCCESS) { | ||
|
@@ -4244,10 +4254,25 @@ static uint32_t mvkGetEntryProperty(io_registry_entry_t entry, CFStringRef prope | |
mvkClear(&_enabledImagelessFramebufferFeatures); | ||
mvkClear(&_enabledDynamicRenderingFeatures); | ||
mvkClear(&_enabledSeparateDepthStencilLayoutsFeatures); | ||
mvkClear(&_enabledFragmentShaderBarycentricFeatures); | ||
mvkClear(&_enabledBufferDeviceAddressFeatures); | ||
mvkClear(&_enabledBufferDeviceAddressFeaturesEXT); | ||
|
||
VkPhysicalDeviceBufferDeviceAddressFeaturesEXT pdBufferDeviceAddressFeaturesEXT; | ||
pdBufferDeviceAddressFeaturesEXT.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT; | ||
pdBufferDeviceAddressFeaturesEXT.pNext = nullptr; | ||
|
||
VkPhysicalDeviceBufferDeviceAddressFeatures pdBufferDeviceAddressFeatures; | ||
pdBufferDeviceAddressFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES; | ||
pdBufferDeviceAddressFeatures.pNext = &pdBufferDeviceAddressFeaturesEXT; | ||
|
||
VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR pdFragmentShaderBarycentricFeatures; | ||
pdFragmentShaderBarycentricFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR; | ||
pdFragmentShaderBarycentricFeatures.pNext = &pdBufferDeviceAddressFeatures; | ||
|
||
VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures pdSeparateDepthStencilLayoutsFeatures; | ||
pdSeparateDepthStencilLayoutsFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES; | ||
pdSeparateDepthStencilLayoutsFeatures.pNext = nullptr; | ||
pdSeparateDepthStencilLayoutsFeatures.pNext = &pdFragmentShaderBarycentricFeatures; | ||
|
||
VkPhysicalDeviceDynamicRenderingFeatures pdDynamicRenderingFeatures; | ||
pdDynamicRenderingFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES; | ||
|
@@ -4466,6 +4491,27 @@ static uint32_t mvkGetEntryProperty(io_registry_entry_t entry, CFStringRef prope | |
&pdSeparateDepthStencilLayoutsFeatures.separateDepthStencilLayouts, 1); | ||
break; | ||
} | ||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR: { | ||
auto* requestedFeatures = (VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR*)next; | ||
enableFeatures(&_enabledFragmentShaderBarycentricFeatures.fragmentShaderBarycentric, | ||
&requestedFeatures->fragmentShaderBarycentric, | ||
&pdFragmentShaderBarycentricFeatures.fragmentShaderBarycentric, 1); | ||
break; | ||
} | ||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES: { | ||
auto* requestedFeatures = (VkPhysicalDeviceBufferDeviceAddressFeatures*)next; | ||
enableFeatures(&_enabledBufferDeviceAddressFeatures.bufferDeviceAddress, | ||
&requestedFeatures->bufferDeviceAddress, | ||
&pdBufferDeviceAddressFeatures.bufferDeviceAddress, 3); | ||
break; | ||
} | ||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT: { | ||
auto* requestedFeatures = (VkPhysicalDeviceBufferDeviceAddressFeaturesEXT*)next; | ||
enableFeatures(&_enabledBufferDeviceAddressFeaturesEXT.bufferDeviceAddress, | ||
&requestedFeatures->bufferDeviceAddress, | ||
&pdBufferDeviceAddressFeaturesEXT.bufferDeviceAddress, 3); | ||
break; | ||
} | ||
default: | ||
break; | ||
} | ||
|
@billhollings This is NOT the correct way to do this. Devices ranging from the A11 to the A12 are able to upgrade to iOS 16, yet do not support Metal 3 and therefore can't support
bufferDeviceAddress
. This was the issue regarding my comment in the original PR for KHR_buffer_device_address. We should instead check for[mtlDevice supportsFamily:MTLGPUFamilyMetal3]
to enable these extensions and their features.