diff options
author | Jason Ekstrand <[email protected]> | 2015-09-17 12:36:23 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-09-17 17:44:20 -0700 |
commit | 3b8aa26b8eedc415d93bc4f2099d39736e5249b2 (patch) | |
tree | 0cb0ea0851aa9b8b725f2f4f2829fe6f1d3f84e1 /src/vulkan/anv_formats.c | |
parent | b5f6889648488d735e920a630917ffa17ff3691f (diff) |
anv/formats: Properly report depth-stencil formats
Diffstat (limited to 'src/vulkan/anv_formats.c')
-rw-r--r-- | src/vulkan/anv_formats.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/src/vulkan/anv_formats.c b/src/vulkan/anv_formats.c index f5d00a0f8ff..516281f2274 100644 --- a/src/vulkan/anv_formats.c +++ b/src/vulkan/anv_formats.c @@ -265,25 +265,30 @@ VkResult anv_GetPhysicalDeviceFormatProperties( if (format->surface_format == UNSUPPORTED) goto unsupported; - info = &surface_formats[format->surface_format]; - if (!info->exists) - goto unsupported; - uint32_t linear = 0, tiled = 0; - if (info->sampling <= gen) { - linear |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT; - tiled |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT; - } - if (info->render_target <= gen) { - linear |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT; - tiled |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT; - } - if (info->alpha_blend <= gen) { - linear |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT; - tiled |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT; - } - if (info->input_vb <= gen) { - linear |= VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT; + if (anv_format_is_depth_or_stencil(format)) { + tiled |= VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT; + } else { + /* The surface_formats table only contains color formats */ + info = &surface_formats[format->surface_format]; + if (!info->exists) + goto unsupported; + + if (info->sampling <= gen) { + linear |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT; + tiled |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT; + } + if (info->render_target <= gen) { + linear |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT; + tiled |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT; + } + if (info->alpha_blend <= gen) { + linear |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT; + tiled |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT; + } + if (info->input_vb <= gen) { + linear |= VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT; + } } pFormatProperties->linearTilingFeatures = linear; |