}
static VkImageUsageFlags
-get_image_usage_for_feats(struct zink_screen *screen, VkFormatFeatureFlags feats, const struct pipe_resource *templ, unsigned bind, bool *need_extended)
+get_image_usage_for_feats(struct zink_screen *screen, VkFormatFeatureFlags2 feats, const struct pipe_resource *templ, unsigned bind, bool *need_extended)
{
VkImageUsageFlags usage = 0;
bool is_planar = util_format_get_num_planes(templ->format) > 1;
}
}
} else {
- VkFormatProperties props = screen->format_props[templ->format];
- VkFormatFeatureFlags feats = tiling == VK_IMAGE_TILING_LINEAR ? props.linearTilingFeatures : props.optimalTilingFeatures;
+ struct zink_format_props props = screen->format_props[templ->format];
+ VkFormatFeatureFlags2 feats = tiling == VK_IMAGE_TILING_LINEAR ? props.linearTilingFeatures : props.optimalTilingFeatures;
if (ici->flags & VK_IMAGE_CREATE_EXTENDED_USAGE_BIT)
feats = UINT32_MAX;
VkImageUsageFlags usage = get_image_usage_for_feats(screen, feats, templ, bind, &need_extended);
}
}
- VkFormatProperties props = screen->format_props[format];
+ struct zink_format_props props = screen->format_props[format];
if (target == PIPE_BUFFER) {
if (bind & PIPE_BIND_VERTEX_BUFFER) {
props3.pNext = props.pNext;
props.pNext = &props3;
VKSCR(GetPhysicalDeviceFormatProperties2)(screen->pdev, format, &props);
- screen->format_props[i] = props.formatProperties;
+ 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_EXT_image_drm_format_modifier && mod_props.drmFormatModifierCount) {
screen->modifier_props[i].pDrmFormatModifierProperties[j] = mod_props.pDrmFormatModifierProperties[j];
}
}
- } else
- VKSCR(GetPhysicalDeviceFormatProperties)(screen->pdev, format, &screen->format_props[i]);
+ } else {
+ VkFormatProperties props = {0};
+ VKSCR(GetPhysicalDeviceFormatProperties)(screen->pdev, format, &props);
+ screen->format_props[i].linearTilingFeatures = props.linearTilingFeatures;
+ screen->format_props[i].optimalTilingFeatures = props.optimalTilingFeatures;
+ screen->format_props[i].bufferFeatures = props.bufferFeatures;
+ }
if (i == PIPE_FORMAT_A8_UNORM && !screen->driver_workarounds.missing_a8_unorm) {
if (!screen->format_props[i].linearTilingFeatures &&
!screen->format_props[i].optimalTilingFeatures &&
VkDrmFormatModifierPropertiesEXT* pDrmFormatModifierProperties;
};
+struct zink_format_props {
+ VkFormatFeatureFlags2 linearTilingFeatures;
+ VkFormatFeatureFlags2 optimalTilingFeatures;
+ VkFormatFeatureFlags2 bufferFeatures;
+};
+
struct zink_screen {
struct pipe_screen base;
bool zink_shader_object_enable;
} driconf;
- VkFormatProperties format_props[PIPE_FORMAT_COUNT];
+ struct zink_format_props format_props[PIPE_FORMAT_COUNT];
struct zink_modifier_prop modifier_props[PIPE_FORMAT_COUNT];
VkExtent2D maxSampleLocationGridSize[5];