diff --git a/include/fbx.h b/include/fbx.h
index c3a64256..994b3117 100644
a
|
b
|
typedef struct |
55 | 55 | |
56 | 56 | |
57 | 57 | /* Pixel formats */ |
58 | | #define FBX_FORMATS 7 |
59 | | enum { FBX_RGB, FBX_RGBA, FBX_BGR, FBX_BGRA, FBX_ABGR, FBX_ARGB, FBX_INDEX }; |
| 58 | #define FBX_FORMATS 8 |
| 59 | enum { FBX_RGB, FBX_RGBA, FBX_BGR, FBX_BGRA, FBX_ABGR, FBX_ARGB, FBX_r210, FBX_INDEX }; |
60 | 60 | |
61 | 61 | static const int fbx_ps[FBX_FORMATS]= |
62 | | { 3, 4, 3, 4, 4, 4, 1 }; |
| 62 | { 3, 4, 3, 4, 4, 4, 4, 1 }; |
63 | 63 | static const int fbx_bgr[FBX_FORMATS]= |
64 | | { 0, 0, 1, 1, 1, 0, 0 }; |
| 64 | { 0, 0, 1, 1, 1, 0, 0, 0 }; |
65 | 65 | static const int fbx_alphafirst[FBX_FORMATS]= |
66 | | { 0, 0, 0, 0, 1, 1, 0 }; |
| 66 | { 0, 0, 0, 0, 1, 1, 0, 0 }; |
67 | 67 | static const int fbx_roffset[FBX_FORMATS]= |
68 | | { 0, 0, 2, 2, 3, 1, 0 }; |
| 68 | { 0, 0, 2, 2, 3, 1, 0, 0 }; |
69 | 69 | static const int fbx_goffset[FBX_FORMATS]= |
70 | | { 1, 1, 1, 1, 2, 2, 0 }; |
| 70 | { 1, 1, 1, 1, 2, 2, 1, 0 }; |
71 | 71 | static const int fbx_boffset[FBX_FORMATS]= |
72 | | { 2, 2, 0, 0, 1, 3, 0 }; |
| 72 | { 2, 2, 0, 0, 1, 3, 2, 0 }; |
73 | 73 | |
74 | 74 | |
75 | 75 | typedef struct _fbx_struct |
diff --git a/server/VirtualDrawable.cpp b/server/VirtualDrawable.cpp
index 2604440f..58955ed3 100644
a
|
b
|
void VirtualDrawable::OGLDrawable::setVisAttribs(void) |
118 | 118 | { |
119 | 119 | if(glxvisual::visAttrib3D(config, GLX_STEREO)) |
120 | 120 | stereo=true; |
121 | | int pixelsize=glxvisual::visAttrib3D(config, GLX_RED_SIZE) |
| 121 | int pixelsize_noalpha=glxvisual::visAttrib3D(config, GLX_RED_SIZE) |
122 | 122 | +glxvisual::visAttrib3D(config, GLX_GREEN_SIZE) |
123 | | +glxvisual::visAttrib3D(config, GLX_BLUE_SIZE) |
| 123 | +glxvisual::visAttrib3D(config, GLX_BLUE_SIZE); |
| 124 | int pixelsize=pixelsize_noalpha |
124 | 125 | +glxvisual::visAttrib3D(config, GLX_ALPHA_SIZE); |
125 | 126 | |
126 | | if(pixelsize==32) |
| 127 | if(pixelsize_noalpha==30) |
| 128 | { |
| 129 | format=GL_RGB10_A2; |
| 130 | } |
| 131 | else if(pixelsize==32) |
127 | 132 | { |
128 | 133 | #ifdef GL_BGRA_EXT |
129 | 134 | if(littleendian()) format=GL_BGRA_EXT; |
… |
… |
static const char *formatString(int format) |
319 | 324 | #endif |
320 | 325 | case GL_RED: case GL_GREEN: case GL_BLUE: |
321 | 326 | return "COMPONENT"; |
| 327 | case GL_RGB10_A2: |
| 328 | return "r210"; |
322 | 329 | default: |
323 | 330 | return "????"; |
324 | 331 | } |
… |
… |
void VirtualDrawable::readPixels(GLint x, GLint y, GLint width, GLint pitch, |
433 | 440 | while(e!=GL_NO_ERROR) e=_glGetError(); // Clear previous error |
434 | 441 | profReadback.startFrame(); |
435 | 442 | if(usePBO) t0=getTime(); |
436 | | _glReadPixels(x, y, width, height, format, GL_UNSIGNED_BYTE, |
| 443 | int type = GL_UNSIGNED_BYTE; |
| 444 | if(oglDraw->getFormat()==GL_RGB10_A2) { |
| 445 | type = GL_UNSIGNED_INT_2_10_10_10_REV; |
| 446 | } |
| 447 | _glReadPixels(x, y, width, height, format, type, |
437 | 448 | usePBO? NULL:bits); |
438 | 449 | |
439 | 450 | if(usePBO) |
diff --git a/server/faker-glx.cpp b/server/faker-glx.cpp
index d5b27ffe..bf8a6984 100644
a
|
b
|
static VisualID matchVisual(Display *dpy, GLXFBConfig config) |
187 | 187 | glxvisual::visAttrib3D(config, GLX_STEREO), 0); |
188 | 188 | // Failing that, we try to find a 24-bit TrueColor mono visual. |
189 | 189 | if(!vid) |
190 | | vid=glxvisual::matchVisual2D(dpy, screen, 24, TrueColor, 0, 0, 0); |
| 190 | vid=glxvisual::matchVisual2D(dpy, screen, 24, TrueColor, 0, 0, 0); |
191 | 191 | } |
192 | 192 | if(vid) cfghash.add(dpy, config, vid); |
193 | 193 | return vid; |
… |
… |
XVisualInfo *glXChooseVisual(Display *dpy, int screen, int *attrib_list) |
437 | 437 | if(vtemp) |
438 | 438 | { |
439 | 439 | if(vtemp->depth==32) depth=32; |
| 440 | if(vtemp->depth==30) depth=30; |
440 | 441 | XFree(vtemp); |
441 | 442 | } |
442 | 443 | |
diff --git a/util/fbx.c b/util/fbx.c
index 2aed8e59..92b7935c 100644
a
|
b
|
static int errorLine=-1; |
28 | 28 | static FILE *warningFile=NULL; |
29 | 29 | |
30 | 30 | static const int fbx_rmask[FBX_FORMATS]= |
31 | | { 0x0000FF, 0x0000FF, 0xFF0000, 0xFF0000, 0x0000FF, 0xFF0000, 0 }; |
| 31 | { 0x0000FF, 0x0000FF, 0xFF0000, 0xFF0000, 0x0000FF, 0xFF0000, 0x3FF00000, 0 }; |
32 | 32 | static const int fbx_gmask[FBX_FORMATS]= |
33 | | { 0x00FF00, 0x00FF00, 0x00FF00, 0x00FF00, 0x00FF00, 0x00FF00, 0 }; |
| 33 | { 0x00FF00, 0x00FF00, 0x00FF00, 0x00FF00, 0x00FF00, 0x00FF00, 0x000ffc00, 0 }; |
34 | 34 | static const int fbx_bmask[FBX_FORMATS]= |
35 | | { 0xFF0000, 0xFF0000, 0x0000FF, 0x0000FF, 0xFF0000, 0x0000FF, 0 }; |
| 35 | { 0xFF0000, 0xFF0000, 0x0000FF, 0x0000FF, 0xFF0000, 0x0000FF, 0x000003ff, 0 }; |
36 | 36 | static const char *formatName[FBX_FORMATS]= |
37 | | { "RGB", "RGBA", "BGR", "BGRA", "ABGR", "ARGB", "INDEX" }; |
| 37 | { "RGB", "RGBA", "BGR", "BGRA", "ABGR", "ARGB", "r210", "INDEX" }; |
38 | 38 | |
39 | 39 | |
40 | 40 | #if defined(_WIN32) |