[Mesa-dev] [PATCH] st/mesa: Factorize duplicate code in st_update_framebuffer_state()

Marek Olšák maraeo at gmail.com
Tue Feb 20 20:13:39 UTC 2018


Pushed.

Marek

On Thu, Jan 11, 2018 at 2:44 AM, Marek Olšák <maraeo at gmail.com> wrote:
> Reviewed-by: Marek Olšák <marek.olsak at amd.com>
>
> Marek
>
> On Fri, Jan 5, 2018 at 5:49 PM, Guillaume Charifi
> <guillaume.charifi at sfr.fr> wrote:
>> Signed-off-by: Guillaume Charifi <guillaume.charifi at sfr.fr>
>> ---
>>  src/mesa/state_tracker/st_atom_framebuffer.c | 18 +++++-------------
>>  1 file changed, 5 insertions(+), 13 deletions(-)
>>
>> diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
>> index acbe980903..35d0fad37a 100644
>> --- a/src/mesa/state_tracker/st_atom_framebuffer.c
>> +++ b/src/mesa/state_tracker/st_atom_framebuffer.c
>> @@ -172,6 +172,9 @@ st_update_framebuffer_state( struct st_context *st )
>>      * Depth/Stencil renderbuffer/surface.
>>      */
>>     strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
>> +   if (!strb)
>> +      strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
>> +
>>     if (strb) {
>>        if (strb->is_rtt) {
>>           /* rendering to a GL texture, may have to update surface */
>> @@ -180,19 +183,8 @@ st_update_framebuffer_state( struct st_context *st )
>>        framebuffer.zsbuf = strb->surface;
>>        update_framebuffer_size(&framebuffer, strb->surface);
>>     }
>> -   else {
>> -      strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
>> -      if (strb) {
>> -         if (strb->is_rtt) {
>> -            /* rendering to a GL texture, may have to update surface */
>> -            st_update_renderbuffer_surface(st, strb);
>> -         }
>> -         framebuffer.zsbuf = strb->surface;
>> -         update_framebuffer_size(&framebuffer, strb->surface);
>> -      }
>> -      else
>> -         framebuffer.zsbuf = NULL;
>> -   }
>> +   else
>> +      framebuffer.zsbuf = NULL;
>>
>>  #ifdef DEBUG
>>     /* Make sure the resource binding flags were set properly */
>> --
>> 2.14.1
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list