~compiz-team/compiz/0.9.11

« back to all changes in this revision

Viewing changes to plugins/opengl/include/opengl/opengl.h

  • Committer: CI Train Bot
  • Author(s): Stephen M. Webb
  • Date: 2015-01-22 14:51:41 UTC
  • mfrom: (3869.1.2 lp-269904-trusty)
  • Revision ID: ci-train-bot@canonical.com-20150122145141-m6fpm6djd2s54try
Use the GL_EXT_x11_sync_object OpenGL extension to synchronize updates with X11 to avoid unrefreshed parts of the screen on Nvidia hardware. Fixes: #269904
Approved by: Christopher Townsend

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <EGL/eglext.h>
37
37
#else
38
38
#include <GL/gl.h>
 
39
#include <GL/glext.h>
39
40
#include <GL/glx.h>
 
41
#include <inttypes.h>
40
42
 
41
43
/* Some implementations have not yet given a definition
42
44
 * to GLX_BACK_BUFFER_AGE_EXT but this is the token as defined
117
119
#define GLX_FRONT_LEFT_EXT                 0x20DE
118
120
#endif
119
121
 
 
122
#ifndef GL_ARB_sync
 
123
# ifndef GL_ES_VERSION_2_0
 
124
typedef struct __GLsync *GLsync;
 
125
typedef int64_t GLint64;
 
126
typedef uint64_t GLuint64;
 
127
typedef intptr_t GLintptr;
 
128
# endif
 
129
 
 
130
# ifdef GL_APPLE_sync
 
131
#  define GL_TIMEOUT_IGNORED               GL_TIMEOUT_IGNORED_APPLE
 
132
#  define GL_ALREADY_SIGNALED              GL_ALREADY_SIGNALED_APPLE
 
133
#  define GL_TIMEOUT_EXPIRED               GL_TIMEOUT_EXPIRED_APPLE
 
134
#  define GL_CONDITION_SATISFIED           GL_CONDITION_SATISFIED_APPLE
 
135
#  define GL_WAIT_FAILED                   GL_WAIT_FAILED_APPLE
 
136
#  define GL_SYNC_GPU_COMMANDS_COMPLETE    GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE
 
137
#  define GL_SYNC_STATUS                   GL_SYNC_STATUS _APPLE
 
138
#  define GL_SIGNALED                      GL_SIGNALED_APPLE
 
139
# else
 
140
#  define GL_TIMEOUT_IGNORED               0xFFFFFFFFFFFFFFFFull
 
141
#  define GL_ALREADY_SIGNALED              0x911A
 
142
#  define GL_TIMEOUT_EXPIRED               0x911B
 
143
#  define GL_CONDITION_SATISFIED           0x911C
 
144
#  define GL_WAIT_FAILED                   0x911D
 
145
#  define GL_SYNC_GPU_COMMANDS_COMPLETE    0x9117
 
146
#  define GL_SYNC_STATUS                   0x9114
 
147
#  define GL_SIGNALED                      0x9119
 
148
# endif
 
149
#endif
 
150
 
 
151
#ifndef GL_EXT_x11_sync_object
 
152
#define GL_SYNC_X11_FENCE_EXT              0x90E1
 
153
#endif
 
154
 
120
155
namespace GL {
121
156
    #ifdef USE_GLES
122
157
    typedef EGLImageKHR (*EGLCreateImageKHRProc)  (EGLDisplay dpy,
320
355
                                           GLsizei width,
321
356
                                           GLsizei height);
322
357
 
 
358
    typedef GLsync (*GLFenceSyncProc) (GLenum condition, GLbitfield flags);
 
359
    typedef void (*GLDeleteSyncProc) (GLsync sync);
 
360
    typedef GLenum (*GLClientWaitSyncProc) (GLsync sync,
 
361
                                        GLbitfield flags,
 
362
                                        GLuint64 timeout);
 
363
    typedef void (*GLWaitSyncProc) (GLsync sync,
 
364
                                GLbitfield flags,
 
365
                                GLuint64 timeout);
 
366
    typedef void (*GLGetSyncivProc) (GLsync sync,
 
367
                                 GLenum pname,
 
368
                                 GLsizei bufSize,
 
369
                                 GLsizei *length,
 
370
                                 GLint *values);
 
371
 
 
372
    typedef GLsync (*GLImportSyncProc) (GLenum external_sync_type,
 
373
                                    GLintptr external_sync,
 
374
                                    GLbitfield flags);
 
375
 
323
376
 
324
377
    /* GL_ARB_shader_objects */
325
378
    #ifndef USE_GLES
519
572
 
520
573
#endif
521
574
 
 
575
    extern GLFenceSyncProc      fenceSync;
 
576
    extern GLDeleteSyncProc     deleteSync;
 
577
    extern GLClientWaitSyncProc clientWaitSync;
 
578
    extern GLWaitSyncProc       waitSync;
 
579
    extern GLGetSyncivProc      getSynciv;
 
580
 
 
581
    extern GLImportSyncProc importSync;
 
582
 
522
583
    extern bool  textureFromPixmap;
523
584
    extern bool  textureRectangle;
524
585
    extern bool  textureNonPowerOfTwo;
538
599
    extern GLint maxTextureUnits;
539
600
    extern bool  bufferAge;
540
601
 
 
602
    extern bool  sync;
 
603
    extern bool  xToGLSync;
 
604
 
541
605
    extern bool canDoSaturated;
542
606
    extern bool canDoSlightlySaturated;
543
607