[Mesa-dev] [PATCH 7/8] mesa: fix assertion in _mesa_drawbuffers()

Brian Paul brianp at vmware.com
Mon Aug 11 05:23:55 PDT 2014


I disagree.  The assertion is doing sanity checking on all the buffer 
masks for buffer index > 0.

-Brian

On 08/10/2014 10:55 PM, Popov, Pavel E wrote:
> I also suggest removing the assertion "ASSERT(_mesa_bitcount(destMask[buf]) == 1);". It's no longer needed with this patch.
> - Pavel
>
> -----Original Message-----
> From: mesa-dev [mailto:mesa-dev-bounces at lists.freedesktop.org] On Behalf Of Brian Paul
> Sent: Monday, August 11, 2014 5:51 AM
> To: Roland Scheidegger; mesa-dev at lists.freedesktop.org
> Cc: 10.2
> Subject: Re: [Mesa-dev] [PATCH 7/8] mesa: fix assertion in _mesa_drawbuffers()
>
> On 08/08/2014 07:43 PM, Roland Scheidegger wrote:
>> Am 08.08.2014 23:20, schrieb Brian Paul:
>>> Fixes failed assertion when _mesa_update_draw_buffers() was called
>>> with GL_DRAW_BUFFER == GL_FRONT_AND_BACK.  The piglit gl30basic hit
>>> this.
>>>
>>> Cc: "10.2" <mesa-stable at lists.freedesktop.org>
>>> ---
>>>    src/mesa/main/buffers.c |    5 +++--
>>>    1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index
>>> b13a7af..6b4fac9 100644
>>> --- a/src/mesa/main/buffers.c
>>> +++ b/src/mesa/main/buffers.c
>>> @@ -494,10 +494,11 @@ _mesa_drawbuffers(struct gl_context *ctx, GLuint n, const GLenum *buffers,
>>>       }
>>>
>>>       /*
>>> -    * If n==1, destMask[0] may have up to four bits set.
>>> +    * destMask[0] may have up to four bits set
>>> +    * (ex: glDrawBuffer(GL_FRONT_AND_BACK)).
>>>        * Otherwise, destMask[x] can only have one bit set.
>>>        */
>>> -   if (n == 1) {
>>> +   if (_mesa_bitcount(destMask[0]) > 1) {
>>>          GLuint count = 0, destMask0 = destMask[0];
>>>          while (destMask0) {
>>>             GLint bufIndex = ffs(destMask0) - 1;
>>>
>>
>> Hmm I don't understand how that could fail. Either you have a winsys
>> fbo, in which case n has to be 1, or you have a user fbo, in which
>> case you can only have the single color_buffer_x bits.
>> What am I missing here?
>
> It happened when called from _mesa_update_draw_buffers() where n = MaxDrawBuffers (8) and the user had previously called glDrawBuffer(GL_FRONT_AND_BACK).  This could only happen during a
> MakeCurrent() operation.
>
> -Brian
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/mesa-dev&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=8s0tnpi92XX27gSuBvQ6bnHTBl4UBbUw%2FRW83II9fPY%3D%0A&s=04d85ff38e6c0c3b7c51a048fc995c818462beb77ecb2541dca182c171a26b31
>



More information about the mesa-dev mailing list