[Mesa-dev] [PATCH 9/9] mesa: replace for loop with bitshifting in supported_buffer_bitmask()

Brian Paul brianp at vmware.com
Wed Feb 24 01:11:58 UTC 2016


On 02/23/2016 05:57 PM, Rob Clark wrote:
> On Tue, Feb 23, 2016 at 6:45 PM, Brian Paul <brianp at vmware.com> wrote:
>> ---
>>   src/mesa/main/buffers.c | 5 +----
>>   1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
>> index 70c2a21..6a6584e 100644
>> --- a/src/mesa/main/buffers.c
>> +++ b/src/mesa/main/buffers.c
>> @@ -58,10 +58,7 @@ supported_buffer_bitmask(const struct gl_context *ctx,
>>
>>      if (_mesa_is_user_fbo(fb)) {
>>         /* A user-created renderbuffer */
>> -      GLuint i;
>> -      for (i = 0; i < ctx->Const.MaxColorAttachments; i++) {
>> -         mask |= (BUFFER_BIT_COLOR0 << i);
>> -      }
>> +      mask = ((1 << ctx->Const.MaxColorAttachments) - 1 ) << BUFFER_COLOR0;
>
>                                                            ^
> was that extra space after the '- 1' intended?

No, I'll fix that before pushing.  Thanks for the reviews!

-Brian


>  Not an expert on the
> various coding conventions of different parts of the code, but figured
> I should check.  With that changed or not,
>
> Reviewed-by: Rob Clark <robdclark at gmail.com>
>
>>      }
>>      else {
>>         /* A window system framebuffer */
>> --
>> 1.9.1
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=BQIBaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=QZ26cQweBF5W_bPczi215oUVE-sf7xtyC1Ip0LDMrhw&s=NVUj5UlRlqXECNT5qhzr8Mc90TzZiqrWe2YnF6ZkRp0&e=



More information about the mesa-dev mailing list