diff options
author | Timothy Arceri <[email protected]> | 2017-04-08 10:22:16 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-04-10 10:55:34 +1000 |
commit | 3387f66cab058d5e3bfa5fee5d8a9ea5c8ce9568 (patch) | |
tree | bf208d264e02bc62022ee2698acda49120571d13 /src | |
parent | c35567544009cc1d17f03b4308bd3e8c5658f8f5 (diff) |
i965: take ownership rather than adding reference for new renderbuffers
This avoids locking in the reference calls and fixes a leak after the
RefCount initialisation was change from 0 to 1.
Fixes: 32141e53d1520 (mesa: tidy up renderbuffer RefCount initialisation)
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 811a9c5a867..e2b70dbb819 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -1158,11 +1158,11 @@ intelCreateBuffer(__DRIscreen *dri_screen, /* setup the hardware-based renderbuffers */ rb = intel_create_renderbuffer(rgbFormat, num_samples); - _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &rb->Base.Base); + _mesa_add_renderbuffer_without_ref(fb, BUFFER_FRONT_LEFT, &rb->Base.Base); if (mesaVis->doubleBufferMode) { rb = intel_create_renderbuffer(rgbFormat, num_samples); - _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &rb->Base.Base); + _mesa_add_renderbuffer_without_ref(fb, BUFFER_BACK_LEFT, &rb->Base.Base); } /* @@ -1176,10 +1176,11 @@ intelCreateBuffer(__DRIscreen *dri_screen, if (screen->devinfo.has_hiz_and_separate_stencil) { rb = intel_create_private_renderbuffer(MESA_FORMAT_Z24_UNORM_X8_UINT, num_samples); - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base); + _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, &rb->Base.Base); rb = intel_create_private_renderbuffer(MESA_FORMAT_S_UINT8, num_samples); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base); + _mesa_add_renderbuffer_without_ref(fb, BUFFER_STENCIL, + &rb->Base.Base); } else { /* * Use combined depth/stencil. Note that the renderbuffer is @@ -1187,7 +1188,7 @@ intelCreateBuffer(__DRIscreen *dri_screen, */ rb = intel_create_private_renderbuffer(MESA_FORMAT_Z24_UNORM_S8_UINT, num_samples); - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base); + _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, &rb->Base.Base); _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base); } } @@ -1195,7 +1196,7 @@ intelCreateBuffer(__DRIscreen *dri_screen, assert(mesaVis->stencilBits == 0); rb = intel_create_private_renderbuffer(MESA_FORMAT_Z_UNORM16, num_samples); - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base); + _mesa_add_renderbuffer_without_ref(fb, BUFFER_DEPTH, &rb->Base.Base); } else { assert(mesaVis->depthBits == 0); |