mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-12 07:28:18 +02:00
zink: stopped the use of VkFormatProperties3 if the reported API is less than 1.3 or VK_KHR_format_feature_flags2 not present.
The MoltenVK (time of writing) only implements Vulkan 1.2 APIs and no `VK_KHR_format_feature_flags2` device extension. This means VkFormatProperties3 is not supported, and is left blank when used in `populate_format_props()`. If non-1.3 is detected then the same values are read from the `VkFormatProperties2` `props` location. Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28259>
This commit is contained in:
parent
d0015ebbab
commit
7e1e0c6824
2 changed files with 23 additions and 9 deletions
|
|
@ -322,7 +322,8 @@ EXTENSIONS = [
|
|||
features=True,
|
||||
conditions=["$feats.shaderDemoteToHelperInvocation"]),
|
||||
Extension("VK_KHR_shader_float_controls",
|
||||
alias="float_controls")
|
||||
alias="float_controls"),
|
||||
Extension("VK_KHR_format_feature_flags2"),
|
||||
]
|
||||
|
||||
# constructor: Versions(device_version(major, minor, patch), struct_version(major, minor))
|
||||
|
|
|
|||
|
|
@ -2229,15 +2229,28 @@ retry:
|
|||
props.pNext = &mod_props;
|
||||
}
|
||||
VkFormatProperties3 props3 = {0};
|
||||
props3.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3;
|
||||
props3.pNext = props.pNext;
|
||||
props.pNext = &props3;
|
||||
if (screen->info.have_KHR_format_feature_flags2 || screen->info.have_vulkan13) {
|
||||
props3.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3;
|
||||
props3.pNext = props.pNext;
|
||||
props.pNext = &props3;
|
||||
}
|
||||
|
||||
VKSCR(GetPhysicalDeviceFormatProperties2)(screen->pdev, format, &props);
|
||||
screen->format_props[i].linearTilingFeatures = props3.linearTilingFeatures;
|
||||
screen->format_props[i].optimalTilingFeatures = props3.optimalTilingFeatures;
|
||||
screen->format_props[i].bufferFeatures = props3.bufferFeatures;
|
||||
if (props3.linearTilingFeatures & VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV)
|
||||
screen->format_props[i].linearTilingFeatures |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT;
|
||||
|
||||
if (screen->info.have_KHR_format_feature_flags2 || screen->info.have_vulkan13) {
|
||||
screen->format_props[i].linearTilingFeatures = props3.linearTilingFeatures;
|
||||
screen->format_props[i].optimalTilingFeatures = props3.optimalTilingFeatures;
|
||||
screen->format_props[i].bufferFeatures = props3.bufferFeatures;
|
||||
|
||||
if (props3.linearTilingFeatures & VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV)
|
||||
screen->format_props[i].linearTilingFeatures |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT;
|
||||
} else {
|
||||
// MoltenVk is 1.2 API
|
||||
screen->format_props[i].linearTilingFeatures = props.formatProperties.linearTilingFeatures;
|
||||
screen->format_props[i].optimalTilingFeatures = props.formatProperties.optimalTilingFeatures;
|
||||
screen->format_props[i].bufferFeatures = props.formatProperties.bufferFeatures;
|
||||
}
|
||||
|
||||
if (screen->info.have_EXT_image_drm_format_modifier && mod_props.drmFormatModifierCount) {
|
||||
screen->modifier_props[i].drmFormatModifierCount = mod_props.drmFormatModifierCount;
|
||||
screen->modifier_props[i].pDrmFormatModifierProperties = ralloc_array(screen, VkDrmFormatModifierPropertiesEXT, mod_props.drmFormatModifierCount);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue