From ff21180909f122eaaaed958f1c0b59589b10c17b Mon Sep 17 00:00:00 2001 From: Chip Davis Date: Sun, 19 Nov 2023 18:50:08 -0800 Subject: [PATCH] Enable some mandatory `VK_EXT_descriptor_indexing` features. These features must be supported if the extension or `descriptorIndexing` features is. Conversely, disable the extension and the feature if we cannot support the features. Fixes `dEQP-VK.info.device_mandatory_features`. --- MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm index 0dd865f23..7d61f2e97 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm @@ -128,9 +128,9 @@ .shaderInputAttachmentArrayDynamicIndexing = _metalFeatures.arrayOfTextures, .shaderUniformTexelBufferArrayDynamicIndexing = _metalFeatures.arrayOfTextures, .shaderStorageTexelBufferArrayDynamicIndexing = _metalFeatures.arrayOfTextures, - .shaderUniformBufferArrayNonUniformIndexing = false, + .shaderUniformBufferArrayNonUniformIndexing = true, .shaderSampledImageArrayNonUniformIndexing = _metalFeatures.arrayOfTextures && _metalFeatures.arrayOfSamplers, - .shaderStorageBufferArrayNonUniformIndexing = false, + .shaderStorageBufferArrayNonUniformIndexing = true, .shaderStorageImageArrayNonUniformIndexing = _metalFeatures.arrayOfTextures, .shaderInputAttachmentArrayNonUniformIndexing = _metalFeatures.arrayOfTextures, .shaderUniformTexelBufferArrayNonUniformIndexing = _metalFeatures.arrayOfTextures, @@ -2402,7 +2402,7 @@ mvkClear(&_vulkan12FeaturesNoExt); // Start with everything cleared _vulkan12FeaturesNoExt.samplerMirrorClampToEdge = _metalFeatures.samplerMirrorClampToEdge; _vulkan12FeaturesNoExt.drawIndirectCount = false; - _vulkan12FeaturesNoExt.descriptorIndexing = true; + _vulkan12FeaturesNoExt.descriptorIndexing = _metalFeatures.arrayOfTextures && _metalFeatures.arrayOfSamplers; _vulkan12FeaturesNoExt.samplerFilterMinmax = false; _vulkan12FeaturesNoExt.shaderOutputViewportIndex = _features.multiViewport; _vulkan12FeaturesNoExt.shaderOutputLayer = _metalFeatures.layeredRendering; @@ -3199,6 +3199,9 @@ static uint32_t mvkGetEntryProperty(io_registry_entry_t entry, CFStringRef prope pWritableExtns->vk_KHR_fragment_shader_barycentric.enabled = false; pWritableExtns->vk_NV_fragment_shader_barycentric.enabled = false; } + if (!_metalFeatures.arrayOfTextures || !_metalFeatures.arrayOfSamplers) { + pWritableExtns->vk_EXT_descriptor_indexing.enabled = false; + } // The relevant functions are not available if not built with Xcode 14. #if MVK_XCODE_14