[Mesa-dev] [PATCH 1/2] swrast: Avoid creating front buffers with __DRI_SWRAST_LOADER < 3.

Emil Velikov emil.l.velikov at gmail.com
Mon Jun 17 17:35:10 UTC 2019


On 2019/06/06, Mathias.Froehlich at gmx.net wrote:
> From: Mathias Fröhlich <mathias.froehlich at web.de>
> 
> Align classic swrast with galliums software renderer with respect
> to front buffer creation.
> In case of front buffers swrast uses the __DRI_SWRAST_LOADER extensions
> getImage/putImage callbacks to keep the front buffer in sync between
> the X server and the mesa software rendering. Gallium sofware rasterizers
> only allocates front buffers if the __DRI_SWRAST_LOADER extension version
> is >= 3. By that the getImage/putImage NULL pointers of the recent
> EGL_platform_device, which announces __DRI_SWRAST_LOADER version 1, are
> never called and thus this combination works fine.
> The change makes classic swrast work together with EGL_platform_device
> by using the same __DRI_SWRAST_LOADER version check than egl.
> For reference see drisw_allocate_textures in
> src/gallium/state_trackers/dri/drisw.c.
> 
> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
> ---
>  src/mesa/drivers/dri/swrast/swrast.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
> index 8e8d6bd628e..832a45f1d88 100644
> --- a/src/mesa/drivers/dri/swrast/swrast.c
> +++ b/src/mesa/drivers/dri/swrast/swrast.c
> @@ -572,7 +572,10 @@ dri_create_buffer(__DRIscreen * sPriv,
>      _mesa_initialize_window_framebuffer(fb, visual);
> 
>      /* add front renderbuffer */
> -    frontrb = swrast_new_renderbuffer(visual, dPriv, GL_TRUE);
> +    if (sPriv->swrast_loader->base.version >= 3)
> +       frontrb = swrast_new_renderbuffer(visual, dPriv, GL_TRUE);
> +    else
> +       frontrb = swrast_new_renderbuffer(visual, dPriv, GL_FALSE);
>      _mesa_attach_and_own_rb(fb, BUFFER_FRONT_LEFT, &frontrb->Base.Base);
> 
Doubt I'll be able to look at the classic swrast, anytime soon. Sorry :-\

-Emil


More information about the mesa-dev mailing list