Improvement: --glx-copy-from-front & benchmark mode

- GLX backend: Add --glx-copy-front, which copies all unmodified regions
  from front buffer to back buffer instead of redrawing the whole
  screen. Unfortunately, probably because glCopyPixels() isn't usually
  well-optimized on graphic cards, this option appears very unstable in
  its effect: Over 20% boost in performance when only 1/4 of the screen
  is modified, but 10% decrease when the whole screen is. Thus, not
  enabled by default.

- GLX backend: Add glx_blur_dst(), to prepare for the background blur
  feature. It currently is capable to modify background in the desired
  way, but the core blur shader is absent. glConvolution2D() seemingly
  relies entirely on CPU and has horrifying performance. I've hesitating
  about whether I should use ARB assembly language or GLSL for the
  shader.

- GLX backend: Invert y-axis GL matrix. It's upside-down previously
  because that's what dcompmgr uses. Seemingly a "normal" y-axis is
  required for glCopyPixels() to operate correctly.

- GLX backend: Fix some GLX_TEXTURE_RECTANGLE compatibility issues.
  Still, not actually tested.

- Add benchmark mode (--benchmark & --benchmark-wid).

- Misc changes.
This commit is contained in:
Richard Grenville
2013-03-19 20:58:55 +08:00
parent a41f05ea92
commit 725bc40a65
3 changed files with 219 additions and 50 deletions

View File

@@ -297,6 +297,7 @@ struct _glx_texture {
GLuint texture;
GLXPixmap glpixmap;
Pixmap pixmap;
GLenum target;
unsigned width;
unsigned height;
unsigned depth;
@@ -341,6 +342,8 @@ typedef struct {
enum backend backend;
/// Whether to avoid using stencil buffer under GLX backend. Might be unsafe.
bool glx_no_stencil;
/// Whether to copy unmodified regions from front buffer.
bool glx_copy_from_front;
/// Whether to try to detect WM windows and mark them as focused.
bool mark_wmwin_focused;
/// Whether to mark override-redirect windows as focused.
@@ -359,6 +362,10 @@ typedef struct {
bool dbus;
/// Path to log file.
char *logpath;
/// Number of cycles to paint in benchmark mode. 0 for disabled.
int benchmark;
/// Window to constantly repaint in benchmark mode. 0 for full-screen.
Window benchmark_wid;
/// Whether to work under synchronized mode for debugging.
bool synchronize;
@@ -1578,6 +1585,9 @@ glx_bind_pixmap(session_t *ps, glx_texture_t **pptex, Pixmap pixmap,
void
glx_release_pixmap(session_t *ps, glx_texture_t *ptex);
void
glx_paint_pre(session_t *ps, XserverRegion *preg);
/**
* Check if a texture is binded, or is binded to the given pixmap.
*/