[Mesa-dev] [PATCH] mesa: Allow glReadBuffer(GL_NONE) for winsys framebuffers.

Paul Berry stereotype441 at gmail.com
Wed Dec 19 17:46:17 PST 2012


On 19 December 2012 16:36, Ian Romanick <idr at freedesktop.org> wrote:

> On 12/19/2012 01:07 PM, Paul Berry wrote:
>
>> Previously, Mesa code assumed that glReadBuffer(GL_NONE) was only
>> valid for user-created framebuffer objects.  However, the spec is
>> quite clear that is should also be valid for the default framebuffer.
>>  From section 18.2.1 ("Obtaining Pixels from the Framebuffer") of the
>> GL 4.3 spec:
>>
>>      "When READ_FRAMEBUFFER_BINDING is zero, i.e. the default
>>      framebuffer, src must be one of the values listed in table 17.4,
>>      including NONE."
>>
>> Similar language exists in the GLES 3.0 spec, and in desktop GL all
>> the way back to ARB_framebuffer_object.
>>
>> Partially fixes GLES3 conformance test "CoverageES30.test".
>>
>
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
>
> Candidate for stable branches?


Yes, good point.  I'll add that annotation before I push it.


>
>
>  ---
>>   src/mesa/main/buffers.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
>> index 76f0d46..d10a573 100644
>> --- a/src/mesa/main/buffers.c
>> +++ b/src/mesa/main/buffers.c
>> @@ -532,8 +532,8 @@ _mesa_ReadBuffer(GLenum buffer)
>>      if (MESA_VERBOSE & VERBOSE_API)
>>         _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(**
>> buffer));
>>
>> -   if (_mesa_is_user_fbo(fb) && buffer == GL_NONE) {
>> -      /* This is legal for user-created framebuffer objects */
>> +   if (buffer == GL_NONE) {
>> +      /* This is legal--it means that no buffer should be bound for
>> reading. */
>>         srcBuffer = -1;
>>      }
>>      else {
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121219/83c6d014/attachment-0001.html>


More information about the mesa-dev mailing list