Mesa (master): swrastg: Add SWRAST_NO_PRESENT option to not send updates to X server
Jakob Bornecrantz
wallbraker at kemper.freedesktop.org
Tue Jul 27 20:55:57 UTC 2010
Module: Mesa
Branch: master
Commit: cc09dc2773a729ab361c58ea5fc70ff070d0b1d2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cc09dc2773a729ab361c58ea5fc70ff070d0b1d2
Author: Jakob Bornecrantz <wallbraker at gmail.com>
Date: Mon Jul 26 21:16:05 2010 -0700
swrastg: Add SWRAST_NO_PRESENT option to not send updates to X server
There seem to be a problem with this path and freeglut where
the window wont open if SWRAST_NO_PRESENT is set to true.
---
src/gallium/state_trackers/dri/sw/drisw.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/src/gallium/state_trackers/dri/sw/drisw.c b/src/gallium/state_trackers/dri/sw/drisw.c
index 23e99aa..86297c3 100644
--- a/src/gallium/state_trackers/dri/sw/drisw.c
+++ b/src/gallium/state_trackers/dri/sw/drisw.c
@@ -46,6 +46,8 @@
#include "dri1_helper.h"
#include "drisw.h"
+DEBUG_GET_ONCE_BOOL_OPTION(swrast_no_present, "SWRAST_NO_PRESENT", FALSE);
+static boolean swrast_no_present = FALSE;
static INLINE void
get_drawable_info(__DRIdrawable *dPriv, int *w, int *h)
@@ -95,6 +97,9 @@ drisw_present_texture(__DRIdrawable *dPriv,
struct dri_screen *screen = dri_screen(drawable->sPriv);
struct pipe_surface *psurf;
+ if (swrast_no_present)
+ return;
+
psurf = dri1_get_pipe_surface(drawable, ptex);
if (!psurf)
return;
@@ -215,7 +220,8 @@ drisw_allocate_textures(struct dri_drawable *drawable,
dri_drawable_get_format(drawable, statts[i], &format, &bind);
- if (statts[i] != ST_ATTACHMENT_DEPTH_STENCIL)
+ /* if we don't do any present, no need for display targets */
+ if (statts[i] != ST_ATTACHMENT_DEPTH_STENCIL && !swrast_no_present)
bind |= PIPE_BIND_DISPLAY_TARGET;
if (format == PIPE_FORMAT_NONE)
@@ -261,6 +267,8 @@ drisw_init_screen(__DRIscreen * sPriv)
screen->update_drawable_info = drisw_update_drawable_info;
screen->flush_frontbuffer = drisw_flush_frontbuffer;
+ swrast_no_present = debug_get_option_swrast_no_present();
+
sPriv->private = (void *)screen;
sPriv->extensions = drisw_screen_extensions;
More information about the mesa-commit
mailing list