<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, May 10, 2017 at 8:26 AM, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jason,<br>
<br>
Humble unrelated question.<br>
<span class=""><br>
On 9 May 2017 at 18:00, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
<br>
> +   if (isl_surf_usage_is_depth(info-<wbr>>usage)) {<br>
> +      if (info->format == ISL_FORMAT_R16_UNORM) {<br>
> +         return isl_extent3d(8, 4, 1);<br>
> +      } else {<br>
> +         return isl_extent3d(4, 4, 1);<br>
> +      }<br>
> +   } else if (isl_surf_usage_is_stencil(<wbr>info->usage)) {<br>
> +      return isl_extent3d(8, 8, 1);<br>
> +   } else if (isl_format_is_compressed(<wbr>info->format)) {<br>
> +      /* Compressed formats all have alignment equal to block size. */<br>
> +      return isl_extent3d(1, 1, 1);<br>
> +   }<br>
<br>
</span>I've seen a handful of constructs like the above.. Is there any reason<br>
to keep the extra else/curly brackets?<br>
Something like the following reads a bit easier yet admittedly I'm not<br>
the person to set the coding style in isl.<br></blockquote><div><br></div><div>Does it?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   if (isl_surf_usage_is_depth(info-<wbr>>usage)) {<br>
<span class="">      if (info->format == ISL_FORMAT_R16_UNORM)<br>
</span>         return isl_extent3d(8, 4, 1);<br>
<br>
      return isl_extent3d(4, 4, 1);<br></blockquote><div><br></div><div>Yeah, I definitely don't like this one.  It really is an if-else so I'd rather writ it that way.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   }<br>
<br>
   if (isl_surf_usage_is_stencil(<wbr>info->usage))<br>
      return isl_extent3d(8, 8, 1);<br>
<span class=""><br>
    /* Compressed formats all have alignment equal to block size. */<br>
</span>    if (isl_format_is_compressed(<wbr>info->format))<br>
      return isl_extent3d(1, 1, 1);<br></blockquote><div><br></div><div>Eh, I don't know if that's actually cleaner or not. <br></div></div><br></div></div>