[Mesa-dev] [PATCH] i965: Change the order of conditions tested in if

Anuj Phogat anuj.phogat at gmail.com
Wed May 6 15:03:35 PDT 2015


On Wed, May 6, 2015 at 2:19 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Wed, Apr 15, 2015 at 11:46 AM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
>> Reduces the number of conditions tested in if to one in case of
>> non-integer formats. Makes no functional changes.
>>
>> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
>> ---
>>  src/mesa/drivers/dri/i965/brw_surface_formats.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c
>> index 7261c01..f04bac5 100644
>> --- a/src/mesa/drivers/dri/i965/brw_surface_formats.c
>> +++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c
>> @@ -683,9 +683,10 @@ brw_render_target_supported(struct brw_context *brw,
>>      * available to fake it like we do for XRGB8888.  Force them to being
>>      * unsupported.
>>      */
>> -   if ((rb->_BaseFormat != GL_RGBA &&
>> +   if (_mesa_is_format_integer_color(format) &&
>> +       (rb->_BaseFormat != GL_RGBA &&
>>         rb->_BaseFormat != GL_RG &&
>> -       rb->_BaseFormat != GL_RED) && _mesa_is_format_integer_color(format))
>> +       rb->_BaseFormat != GL_RED))
>
> While you're modifying this line, remove the tab.
>
and I also removed the unnecessary braces around rb->_BaseFormat
checks.

> Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list