[Mesa-dev] [PATCH 3/4] intel: Unobfuscate intel_alloc_renderbuffer_storage

Kenneth Graunke kenneth at whitecape.org
Sun Jun 19 22:36:24 PDT 2011


On 06/19/2011 03:27 PM, Chad Versace wrote:
[snip]
> Yes. I neglected to duplicate that the (!irb->region) check in the S8
> case. I'll add it to the patch.
>
> But, "leaving that check below" is no longer possible due to patch
> 4 --- !irb->region is always false for the wrapped S8_Z24 case. So the
> check must be removed from its dangling position and duplicated in each
> appropriate if-branch.

Ah...that makes sense.

[snip]

> Since the dangling (!irb->region) check must be deleted/duplicated
> anyway, it seemed a good opportunity to clean up the location of
> hiz_region allocation too.
>
> If the hiz allocation remains dangling outside the if-tree, a future
> maintainer may encouter it and confoundingly ask himself "Is it possible
> for the hiz allocation here to accidentally occurr when the else-branch
> is not taken?". There's no harm in making the code easier for him to
> understand.

Might as well...certainly no harm in it.  With the check in the S8 case:

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list