summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2017-11-03 16:42:16 -0700
committerChad Versace <[email protected]>2017-11-09 16:01:59 -0800
commit7bb4387105491e9efd4c412002fb4a6e72a4ceda (patch)
tree651702154c43ce921e01fa1f0b26124eb9936d35 /src
parent3ee7f4bc2f56f7c9c23de52fbe77125deef6be86 (diff)
anv: Refactor anv_get_format_plane() - explicit unsupported
The same local variable, 'plane_format', was returned on success *and* failure. Be more explicit in distinguishing the two cases: return 'plane_format' on success and return 'unsupported' on failure. This simplifies the diff in upcoming patches for VK_EXT_image_drm_format_modifier. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/vulkan/anv_formats.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 25d34fcadc1..810f26cc750 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -412,17 +412,17 @@ anv_get_format_plane(const struct gen_device_info *devinfo, VkFormat vk_format,
VkImageAspectFlagBits aspect, VkImageTiling tiling)
{
const struct anv_format *format = anv_get_format(vk_format);
- struct anv_format_plane plane_format = {
+ const struct anv_format_plane unsupported = {
.isl_format = ISL_FORMAT_UNSUPPORTED,
};
if (format == NULL)
- return plane_format;
+ return unsupported;
uint32_t plane = anv_image_aspect_to_plane(vk_format_aspects(vk_format), aspect);
- plane_format = format->planes[plane];
+ struct anv_format_plane plane_format = format->planes[plane];
if (plane_format.isl_format == ISL_FORMAT_UNSUPPORTED)
- return plane_format;
+ return unsupported;
if (aspect & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) {
assert(vk_format_aspects(vk_format) &