Skip to content

Commit

Permalink
Enable some mandatory VK_EXT_descriptor_indexing features.
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
cdavis5e committed Nov 22, 2023
1 parent a7dc8da commit ff21180
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions MoltenVK/MoltenVK/GPUObjects/MVKDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ff21180

Please sign in to comment.