mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
egl/haiku: Fix potential crash if double buffering is disabled
* Don't assume the existence of the back buffer in swap_buffers Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23556>
This commit is contained in:
parent
2089fc8188
commit
4b48d377ba
1 changed files with 6 additions and 2 deletions
|
|
@ -213,10 +213,12 @@ haiku_swap_buffers(_EGLDisplay *disp, _EGLSurface *surf)
|
|||
struct pipe_screen *screen = hgl_dpy->disp->fscreen->screen;
|
||||
|
||||
struct hgl_buffer* buffer = hgl_surf->fb;
|
||||
auto &backBuffer = buffer->textures[ST_ATTACHMENT_BACK_LEFT];
|
||||
auto &frontBuffer = buffer->textures[ST_ATTACHMENT_FRONT_LEFT];
|
||||
auto &backBuffer = buffer->textures[ST_ATTACHMENT_BACK_LEFT];
|
||||
|
||||
st->pipe->flush_resource(st->pipe, backBuffer);
|
||||
// Inform ST of a flush if double buffering is used
|
||||
if (backBuffer != NULL)
|
||||
st->pipe->flush_resource(st->pipe, backBuffer);
|
||||
|
||||
_mesa_glthread_finish(st->ctx);
|
||||
|
||||
|
|
@ -235,6 +237,8 @@ haiku_swap_buffers(_EGLDisplay *disp, _EGLSurface *surf)
|
|||
p_atomic_inc(&buffer->base.stamp);
|
||||
}
|
||||
|
||||
// XXX: right front / back if BGL_STEREO?
|
||||
|
||||
update_size(buffer);
|
||||
|
||||
return EGL_TRUE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue