<div dir="ltr">With modifiers, aren't we going to want to be able to reject an image if the provide bogus stuff?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 6, 2017 at 10:18 AM, Chad Versace <span dir="ltr"><<a href="mailto:chadversary@chromium.org" target="_blank">chadversary@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">make_surface() always returns VK_SUCCESS, so change its return type to<br>
'void'. This simplifies the return-code handling in<br>
anv_image_create_info() and removes a goto.<br>
---<br>
src/intel/vulkan/anv_image.c | 15 ++-------------<br>
1 file changed, 2 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c<br>
index ab92df5d754..8f4fbd56a16 100644<br>
--- a/src/intel/vulkan/anv_image.c<br>
+++ b/src/intel/vulkan/anv_image.c<br>
@@ -137,7 +137,7 @@ add_surface(struct anv_image *image, struct anv_surface *surf)<br>
*<br>
* Exactly one bit must be set in \a aspect.<br>
*/<br>
-static VkResult<br>
+static void<br>
make_surface(const struct anv_device *dev,<br>
struct anv_image *image,<br>
const struct anv_image_create_info *anv_info,<br>
@@ -245,8 +245,6 @@ make_surface(const struct anv_device *dev,<br>
image->aux_usage = ISL_AUX_USAGE_MCS;<br>
}<br>
}<br>
-<br>
- return VK_SUCCESS;<br>
}<br>
<br>
VkResult<br>
@@ -258,7 +256,6 @@ anv_image_create(VkDevice _device,<br>
ANV_FROM_HANDLE(anv_device, device, _device);<br>
const VkImageCreateInfo *base_info = anv_info->vk_info;<br>
struct anv_image *image = NULL;<br>
- VkResult r;<br>
<br>
assert(base_info->sType == VK_STRUCTURE_TYPE_IMAGE_<wbr>CREATE_INFO);<br>
<br>
@@ -288,20 +285,12 @@ anv_image_create(VkDevice _device,<br>
<br>
uint32_t b;<br>
for_each_bit(b, image->aspects) {<br>
- r = make_surface(device, image, anv_info, (1 << b));<br>
- if (r != VK_SUCCESS)<br>
- goto fail;<br>
+ make_surface(device, image, anv_info, (1 << b));<br>
}<br>
<br>
*pImage = anv_image_to_handle(image);<br>
<br>
return VK_SUCCESS;<br>
-<br>
-fail:<br>
- if (image)<br>
- vk_free2(&device->alloc, alloc, image);<br>
-<br>
- return r;<br>
}<br>
<br>
VkResult<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.12.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>