On 2019/06/06, mathias.froehl...@gmx.net wrote:
> From: Mathias Fröhlich <mathias.froehl...@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.froehl...@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
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to