#define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
#define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
+/* __DRI_ATTRIB_SWAP_METHOD */
+/* Note that with the exception of __DRI_ATTRIB_SWAP_NONE, we need to define
+ * the same tokens as GLX. This is because old and current X servers will
+ * transmit the driconf value grabbed from the AIGLX driver untranslated as
+ * the GLX fbconfig value. __DRI_ATTRIB_SWAP_NONE is only used by dri drivers
+ * to signal to the dri core that the driconfig is single-buffer.
+ */
+#define __DRI_ATTRIB_SWAP_NONE 0x0000
+#define __DRI_ATTRIB_SWAP_EXCHANGE 0x8061
+#define __DRI_ATTRIB_SWAP_COPY 0x8062
+#define __DRI_ATTRIB_SWAP_UNDEFINED 0x8063
+
/**
* This extension defines the core DRI functionality.
*
boolean mixed_color_depth;
static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML, GLX_SWAP_COPY_OML
+ __DRI_ATTRIB_SWAP_NONE, __DRI_ATTRIB_SWAP_UNDEFINED,
+ __DRI_ATTRIB_SWAP_COPY
};
if (driQueryOptionb(&screen->dev->option_cache, "always_have_depth_buffer")) {
return GL_FALSE;
break;
+ case __DRI_ATTRIB_SWAP_METHOD:
+ if (value == __DRI_ATTRIB_SWAP_EXCHANGE)
+ glxValue = GLX_SWAP_EXCHANGE_OML;
+ else if (value == __DRI_ATTRIB_SWAP_COPY)
+ glxValue = GLX_SWAP_COPY_OML;
+ else
+ glxValue = GLX_SWAP_UNDEFINED_OML;
+
+ if (!scalarEqual(config, attrib, glxValue))
+ return GL_FALSE;
+
+ break;
+
default:
if (!scalarEqual(config, attrib, value))
return GL_FALSE;
modes->transparentIndex = GLX_DONT_CARE;
modes->rgbMode = GL_TRUE;
- if ( db_modes[i] == GLX_NONE ) {
+ if (db_modes[i] == __DRI_ATTRIB_SWAP_NONE) {
modes->doubleBufferMode = GL_FALSE;
- modes->swapMethod = GLX_SWAP_UNDEFINED_OML;
+ modes->swapMethod = __DRI_ATTRIB_SWAP_UNDEFINED;
}
else {
modes->doubleBufferMode = GL_TRUE;
/* GLX_SWAP_COPY_OML is not supported due to page flipping. */
static const GLenum back_buffer_modes[] = {
- GLX_SWAP_UNDEFINED_OML, GLX_NONE,
+ __DRI_ATTRIB_SWAP_UNDEFINED, __DRI_ATTRIB_SWAP_NONE
};
static const uint8_t singlesample_samples[1] = {0};
/* GLX_SWAP_COPY_OML is not supported due to page flipping. */
static const GLenum back_buffer_modes[] = {
- GLX_SWAP_UNDEFINED_OML, GLX_NONE,
+ __DRI_ATTRIB_SWAP_UNDEFINED, __DRI_ATTRIB_SWAP_NONE
};
static const uint8_t singlesample_samples[1] = {0};
};
const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML
+ __DRI_ATTRIB_SWAP_NONE, __DRI_ATTRIB_SWAP_UNDEFINED
};
for (i = 0; i < ARRAY_SIZE(formats); i++) {
MESA_FORMAT_B8G8R8X8_UNORM,
MESA_FORMAT_B8G8R8A8_UNORM
};
- /* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
- * support pageflipping at all.
- */
+
static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML, /*, GLX_SWAP_COPY_OML*/
+ __DRI_ATTRIB_SWAP_NONE, __DRI_ATTRIB_SWAP_UNDEFINED
};
uint8_t depth_bits[4], stencil_bits[4], msaa_samples_array[1];
int color;
* support pageflipping at all.
*/
static const GLenum back_buffer_modes[] = {
- GLX_NONE, GLX_SWAP_UNDEFINED_OML
+ __DRI_ATTRIB_SWAP_NONE, __DRI_ATTRIB_SWAP_UNDEFINED
};
uint8_t depth_bits_array[4];