summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-04-01 16:38:01 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-04-01 17:46:58 +0100
commite011272fa357fbb22377220fa1d8655d063e4aa0 (patch)
tree705ac6648439bc62e719ef586d30bb0369056a95 /src/gallium
parent38afd1e4452d5ed357cce0d7a604948a9fb563aa (diff)
downloadexternal_mesa3d-e011272fa357fbb22377220fa1d8655d063e4aa0.zip
external_mesa3d-e011272fa357fbb22377220fa1d8655d063e4aa0.tar.gz
external_mesa3d-e011272fa357fbb22377220fa1d8655d063e4aa0.tar.bz2
st/python: Always use softpipe as reference driver.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/python/st_device.c2
-rw-r--r--src/gallium/state_trackers/python/st_hardpipe_winsys.c2
-rw-r--r--src/gallium/state_trackers/python/st_softpipe_winsys.c22
-rw-r--r--src/gallium/state_trackers/python/st_winsys.h2
4 files changed, 17 insertions, 11 deletions
diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c
index 44d65e3..4f227a0 100644
--- a/src/gallium/state_trackers/python/st_device.c
+++ b/src/gallium/state_trackers/python/st_device.c
@@ -85,7 +85,7 @@ st_device_create(boolean hardware)
if (hardware)
screen = st_hardware_screen_create();
else
- screen = st_software_screen_create();
+ screen = st_software_screen_create("softpipe");
screen = trace_screen_create(screen);
if (!screen)
diff --git a/src/gallium/state_trackers/python/st_hardpipe_winsys.c b/src/gallium/state_trackers/python/st_hardpipe_winsys.c
index b141177..c6743db 100644
--- a/src/gallium/state_trackers/python/st_hardpipe_winsys.c
+++ b/src/gallium/state_trackers/python/st_hardpipe_winsys.c
@@ -208,5 +208,5 @@ st_hardware_screen_create(void)
if(st_hardpipe_load())
return pfnGetGalliumScreenMESA();
else
- return st_software_screen_create();
+ return st_software_screen_create(NULL);
}
diff --git a/src/gallium/state_trackers/python/st_softpipe_winsys.c b/src/gallium/state_trackers/python/st_softpipe_winsys.c
index 0a332aa..8584bad 100644
--- a/src/gallium/state_trackers/python/st_softpipe_winsys.c
+++ b/src/gallium/state_trackers/python/st_softpipe_winsys.c
@@ -35,27 +35,29 @@
struct pipe_screen *
-st_software_screen_create(void)
+st_software_screen_create(const char *driver)
{
struct sw_winsys *ws;
- const char *default_driver;
- const char *driver;
struct pipe_screen *screen = NULL;
+ if (!driver) {
+ const char *default_driver;
+
#if defined(HAVE_LLVMPIPE)
- default_driver = "llvmpipe";
+ default_driver = "llvmpipe";
#elif defined(HAVE_SOFTPIPE)
- default_driver = "softpipe";
+ default_driver = "softpipe";
#else
- default_driver = "";
+ default_driver = "";
#endif
+ driver = debug_get_option("GALLIUM_DRIVER", default_driver);
+ }
+
ws = null_sw_create();
if(!ws)
return NULL;
- driver = debug_get_option("GALLIUM_DRIVER", default_driver);
-
#ifdef HAVE_LLVMPIPE
if (strcmp(driver, "llvmpipe") == 0) {
screen = llvmpipe_create_screen(ws);
@@ -68,5 +70,9 @@ st_software_screen_create(void)
}
#endif
+ if (!screen) {
+ ws->destroy(ws);
+ }
+
return screen;
}
diff --git a/src/gallium/state_trackers/python/st_winsys.h b/src/gallium/state_trackers/python/st_winsys.h
index e1a9938..7d4066d 100644
--- a/src/gallium/state_trackers/python/st_winsys.h
+++ b/src/gallium/state_trackers/python/st_winsys.h
@@ -37,7 +37,7 @@ struct pipe_screen *
st_hardware_screen_create(void);
struct pipe_screen *
-st_software_screen_create(void);
+st_software_screen_create(const char *driver);
#endif /* ST_WINSYS_H_ */