mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
gallium/auxiliary: implement sw_probe_wrapped (v2)
Implement pipe_loader_sw_probe_wrapped which allows to use the wrapped
software renderer backend when using the pipe loader.
v2: - remove unneeded ifdef
- use GALLIUM_PIPE_LOADER_WINSYS_LIBS
- check for CALLOC_STRUCT
thanks to Emil Velikov
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
(cherry picked from commit e23d63cffd)
This commit is contained in:
parent
8d6963f005
commit
7bbf0836c8
3 changed files with 36 additions and 1 deletions
|
|
@ -58,7 +58,8 @@ GALLIUM_WINSYS_CFLAGS = \
|
||||||
|
|
||||||
|
|
||||||
GALLIUM_PIPE_LOADER_WINSYS_LIBS = \
|
GALLIUM_PIPE_LOADER_WINSYS_LIBS = \
|
||||||
$(top_builddir)/src/gallium/winsys/sw/null/libws_null.la
|
$(top_builddir)/src/gallium/winsys/sw/null/libws_null.la \
|
||||||
|
$(top_builddir)/src/gallium/winsys/sw/wrapper/libwsw.la
|
||||||
|
|
||||||
if HAVE_DRISW
|
if HAVE_DRISW
|
||||||
GALLIUM_PIPE_LOADER_WINSYS_LIBS += \
|
GALLIUM_PIPE_LOADER_WINSYS_LIBS += \
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,17 @@ pipe_loader_sw_probe_null(struct pipe_loader_device **devs);
|
||||||
int
|
int
|
||||||
pipe_loader_sw_probe(struct pipe_loader_device **devs, int ndev);
|
pipe_loader_sw_probe(struct pipe_loader_device **devs, int ndev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a software device wrapped atop another device.
|
||||||
|
*
|
||||||
|
* This function is platform-specific.
|
||||||
|
*
|
||||||
|
* \sa pipe_loader_probe
|
||||||
|
*/
|
||||||
|
boolean
|
||||||
|
pipe_loader_sw_probe_wrapped(struct pipe_loader_device **dev,
|
||||||
|
struct pipe_screen *screen);
|
||||||
|
|
||||||
#ifdef HAVE_PIPE_LOADER_DRM
|
#ifdef HAVE_PIPE_LOADER_DRM
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include "util/u_dl.h"
|
#include "util/u_dl.h"
|
||||||
#include "sw/dri/dri_sw_winsys.h"
|
#include "sw/dri/dri_sw_winsys.h"
|
||||||
#include "sw/null/null_sw_winsys.h"
|
#include "sw/null/null_sw_winsys.h"
|
||||||
|
#include "sw/wrapper/wrapper_sw_winsys.h"
|
||||||
#ifdef HAVE_PIPE_LOADER_XLIB
|
#ifdef HAVE_PIPE_LOADER_XLIB
|
||||||
/* Explicitly wrap the header to ease build without X11 headers */
|
/* Explicitly wrap the header to ease build without X11 headers */
|
||||||
#include "sw/xlib/xlib_sw_winsys.h"
|
#include "sw/xlib/xlib_sw_winsys.h"
|
||||||
|
|
@ -140,6 +141,28 @@ pipe_loader_sw_probe(struct pipe_loader_device **devs, int ndev)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean
|
||||||
|
pipe_loader_sw_probe_wrapped(struct pipe_loader_device **dev,
|
||||||
|
struct pipe_screen *screen)
|
||||||
|
{
|
||||||
|
struct pipe_loader_sw_device *sdev = CALLOC_STRUCT(pipe_loader_sw_device);
|
||||||
|
|
||||||
|
if (!sdev)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
sdev->base.type = PIPE_LOADER_DEVICE_SOFTWARE;
|
||||||
|
sdev->base.driver_name = "swrast";
|
||||||
|
sdev->base.ops = &pipe_loader_sw_ops;
|
||||||
|
sdev->ws = wrapper_sw_winsys_wrap_pipe_screen(screen);
|
||||||
|
|
||||||
|
if (!sdev->ws) {
|
||||||
|
FREE(sdev);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
*dev = &sdev->base;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pipe_loader_sw_release(struct pipe_loader_device **dev)
|
pipe_loader_sw_release(struct pipe_loader_device **dev)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue