v3dv: implement VK_EXT_separate_stencil_usage
We don't care about the depth/stencil usage other than to determine if an image format is supported for that usage. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16344>
This commit is contained in:
parent
44791ba825
commit
32223ac67f
|
@ -467,7 +467,7 @@ Vulkan 1.2 -- all DONE: anv, vn
|
|||
VK_EXT_host_query_reset DONE (anv, lvp, radv, tu, v3dv, vn)
|
||||
VK_EXT_sampler_filter_minmax DONE (anv/gen9+, lvp, radv, tu, vn)
|
||||
VK_EXT_scalar_block_layout DONE (anv, lvp, radv/gfx7+, tu, vn)
|
||||
VK_EXT_separate_stencil_usage DONE (anv, lvp, radv, tu, vn)
|
||||
VK_EXT_separate_stencil_usage DONE (anv, lvp, radv, tu, v3dv, vn)
|
||||
VK_EXT_shader_viewport_index_layer DONE (anv, lvp, radv, tu, vn)
|
||||
|
||||
Vulkan 1.3 -- all DONE: anv, radv, lvp
|
||||
|
|
|
@ -162,6 +162,7 @@ get_device_extensions(const struct v3dv_physical_device *device,
|
|||
.EXT_pipeline_creation_feedback = true,
|
||||
.EXT_private_data = true,
|
||||
.EXT_provoking_vertex = true,
|
||||
.EXT_separate_stencil_usage = true,
|
||||
.EXT_vertex_attribute_divisor = true,
|
||||
#ifdef ANDROID
|
||||
.ANDROID_native_buffer = true,
|
||||
|
|
|
@ -347,7 +347,13 @@ get_image_format_properties(
|
|||
if (info->flags & VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT)
|
||||
goto unsupported;
|
||||
|
||||
if (info->usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
|
||||
const VkImageStencilUsageCreateInfo *stencil_usage_info =
|
||||
vk_find_struct_const(info->pNext, IMAGE_STENCIL_USAGE_CREATE_INFO);
|
||||
|
||||
VkImageUsageFlags usage =
|
||||
info->usage | (stencil_usage_info ? stencil_usage_info->stencilUsage : 0);
|
||||
|
||||
if (usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) {
|
||||
if (!(format_feature_flags & VK_FORMAT_FEATURE_TRANSFER_SRC_BIT)) {
|
||||
goto unsupported;
|
||||
}
|
||||
|
@ -363,14 +369,14 @@ get_image_format_properties(
|
|||
}
|
||||
}
|
||||
|
||||
if (info->usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
|
||||
if (usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) {
|
||||
if (!(format_feature_flags & VK_FORMAT_FEATURE_TRANSFER_DST_BIT)) {
|
||||
goto unsupported;
|
||||
}
|
||||
}
|
||||
|
||||
if (info->usage & (VK_IMAGE_USAGE_SAMPLED_BIT |
|
||||
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT)) {
|
||||
if (usage & (VK_IMAGE_USAGE_SAMPLED_BIT |
|
||||
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT)) {
|
||||
if (!(format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT)) {
|
||||
goto unsupported;
|
||||
}
|
||||
|
@ -385,19 +391,19 @@ get_image_format_properties(
|
|||
}
|
||||
}
|
||||
|
||||
if (info->usage & VK_IMAGE_USAGE_STORAGE_BIT) {
|
||||
if (usage & VK_IMAGE_USAGE_STORAGE_BIT) {
|
||||
if (!(format_feature_flags & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT)) {
|
||||
goto unsupported;
|
||||
}
|
||||
}
|
||||
|
||||
if (info->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) {
|
||||
if (usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) {
|
||||
if (!(format_feature_flags & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) {
|
||||
goto unsupported;
|
||||
}
|
||||
}
|
||||
|
||||
if (info->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) {
|
||||
if (usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) {
|
||||
if (!(format_feature_flags &
|
||||
VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT)) {
|
||||
goto unsupported;
|
||||
|
@ -535,6 +541,9 @@ v3dv_GetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice,
|
|||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO:
|
||||
external_info = (const void *) s;
|
||||
break;
|
||||
case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO:
|
||||
/* Do nothing, get_image_format_properties() below will handle it */;
|
||||
break;
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT:
|
||||
drm_format_mod_info = (const void *) s;
|
||||
switch (drm_format_mod_info->drmFormatModifier) {
|
||||
|
|
Loading…
Reference in New Issue