typedef struct __GLXDRIcontext __GLXDRIcontext;
typedef struct __GLXDRIdrawable __GLXDRIdrawable;
-#ifdef __DRI2_ROBUSTNESS
#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \
| __DRI_CTX_FLAG_FORWARD_COMPATIBLE \
| __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS)
-#else
-#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \
- | __DRI_CTX_FLAG_FORWARD_COMPATIBLE)
-#endif
struct __GLXDRIscreen {
__GLXscreen base;
__GLXDRIscreen *screen = priv->screen;
CARD64 unused;
-#if __DRI2_FLUSH_VERSION >= 3
if (screen->flush) {
(*screen->flush->flush) (priv->driDrawable);
(*screen->flush->invalidate) (priv->driDrawable);
}
-#else
- if (screen->flush)
- (*screen->flush->flushInvalidate) (priv->driDrawable);
-#endif
if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
__glXdriSwapEvent, drawable) != Success)
return FALSE;
}
-#ifdef __DRI_TEX_BUFFER
-
static int
__glXDRIbindTexImage(__GLXcontext * baseContext,
int buffer, __GLXdrawable * glxPixmap)
if (texBuffer == NULL)
return Success;
-#if __DRI_TEX_BUFFER_VERSION >= 2
if (texBuffer->base.version >= 2 && texBuffer->setTexBuffer2 != NULL) {
(*texBuffer->setTexBuffer2) (context->driContext,
glxPixmap->target,
glxPixmap->format, drawable->driDrawable);
}
else
-#endif
{
texBuffer->setTexBuffer(context->driContext,
glxPixmap->target, drawable->driDrawable);
return Success;
}
-#else
-
-static int
-__glXDRIbindTexImage(__GLXcontext * baseContext,
- int buffer, __GLXdrawable * glxPixmap)
-{
- return Success;
-}
-
-static int
-__glXDRIreleaseTexImage(__GLXcontext * baseContext,
- int buffer, __GLXdrawable * pixmap)
-{
- return Success;
-}
-
-#endif
-
static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
__glXDRIbindTexImage,
__glXDRIreleaseTexImage
*major_ver = 1;
*minor_ver = 0;
-#ifdef __DRI2_ROBUSTNESS
*reset = __DRI_CTX_RESET_NO_NOTIFICATION;
-#else
- (void) reset;
-#endif
for (i = 0; i < num_attribs; i++) {
switch (attribs[i * 2]) {
return False;
}
break;
-#ifdef __DRI2_ROBUSTNESS
case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB:
if (screen->dri2->base.version >= 4) {
*error = BadValue;
return False;
}
break;
-#endif
default:
/* If an unknown attribute is received, fail.
*/
{
context->driContext = NULL;
-#if __DRI_DRI2_VERSION >= 3
if (screen->dri2->base.version >= 3) {
uint32_t ctx_attribs[3 * 2];
unsigned num_ctx_attribs = 0;
ctx_attribs[num_ctx_attribs++] = flags;
}
-#ifdef __DRI2_ROBUSTNESS
if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) {
ctx_attribs[num_ctx_attribs++] =
__DRI_CTX_ATTRIB_RESET_STRATEGY;
ctx_attribs[num_ctx_attribs++] = reset;
}
-#endif
}
context->driContext =
return;
}
-#endif
if (num_attribs != 0) {
*error = BadValue;
static void
__glXDRIinvalidateBuffers(DrawablePtr pDraw, void *priv, XID id)
{
-#if __DRI2_FLUSH_VERSION >= 3
__GLXDRIdrawable *private = priv;
__GLXDRIscreen *screen = private->screen;
if (screen->flush)
(*screen->flush->invalidate) (private->driDrawable);
-#endif
}
static __GLXdrawable *
dri2GetBuffersWithFormat,
};
-#ifdef __DRI_USE_INVALIDATE
static const __DRIuseInvalidateExtension dri2UseInvalidate = {
{__DRI_USE_INVALIDATE, 1}
};
-#endif
static const __DRIextension *loader_extensions[] = {
&systemTimeExtension.base,
&loaderExtension.base,
-#ifdef __DRI_USE_INVALIDATE
&dri2UseInvalidate.base,
-#endif
NULL
};
__glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer");
LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n");
-
-#if __DRI_DRI2_VERSION >= 3
if (screen->dri2->base.version >= 3) {
__glXEnableExtension(screen->glx_enable_bits,
"GLX_ARB_create_context");
LogMessage(X_INFO,
"AIGLX: enabled GLX_EXT_create_context_es2_profile\n");
}
-#endif
if (DRI2HasSwapControl(pScreen)) {
__glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
}
for (i = 0; extensions[i]; i++) {
-#ifdef __DRI_READ_DRAWABLE
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
__glXEnableExtension(screen->glx_enable_bits,
"GLX_SGI_make_current_read");
LogMessage(X_INFO, "AIGLX: enabled GLX_SGI_make_current_read\n");
}
-#endif
-#ifdef __DRI_TEX_BUFFER
if (strcmp(extensions[i]->name, __DRI_TEX_BUFFER) == 0) {
screen->texBuffer = (const __DRItexBufferExtension *) extensions[i];
/* GLX_EXT_texture_from_pixmap is always enabled. */
LogMessage(X_INFO,
"AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects\n");
}
-#endif
-#ifdef __DRI2_FLUSH
if (strcmp(extensions[i]->name, __DRI2_FLUSH) == 0 &&
extensions[i]->version >= 3) {
screen->flush = (__DRI2flushExtension *) extensions[i];
}
-#endif
-#ifdef __DRI2_ROBUSTNESS
if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0 &&
screen->dri2->base.version >= 3) {
__glXEnableExtension(screen->glx_enable_bits,
LogMessage(X_INFO,
"AIGLX: enabled GLX_ARB_create_context_robustness\n");
}
-#endif
/* Ignore unknown extensions */
}