#define ST_CONTEXT_FLAG_ROBUST_ACCESS (1 << 2)
#define ST_CONTEXT_FLAG_RESET_NOTIFICATION_ENABLED (1 << 3)
#define ST_CONTEXT_FLAG_NO_ERROR (1 << 4)
+#define ST_CONTEXT_FLAG_RELEASE_NONE (1 << 5)
/**
* Reasons that context creation might fail.
unsigned allowed_flags = __DRI_CTX_FLAG_DEBUG |
__DRI_CTX_FLAG_FORWARD_COMPATIBLE |
__DRI_CTX_FLAG_NO_ERROR;
- unsigned allowed_attribs = 0;
+ unsigned allowed_attribs = __DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR;
const __DRIbackgroundCallableExtension *backgroundCallable =
screen->sPriv->dri2.backgroundCallable;
if (ctx_config->flags & __DRI_CTX_FLAG_NO_ERROR)
attribs.flags |= ST_CONTEXT_FLAG_NO_ERROR;
+ if ((ctx_config->attribute_mask & __DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR)
+ && (ctx_config->release_behavior == __DRI_CTX_RELEASE_BEHAVIOR_NONE))
+ attribs.flags |= ST_CONTEXT_FLAG_RELEASE_NONE;
+
if (sharedContextPrivate) {
st_share = ((struct dri_context *)sharedContextPrivate)->st;
}
st_install_device_reset_callback(st);
}
+ if (attribs->flags & ST_CONTEXT_FLAG_RELEASE_NONE)
+ st->ctx->Const.ContextReleaseBehavior = GL_NONE;
+
/* need to perform version check */
if (attribs->major > 1 || attribs->minor > 0) {
/* Is the actual version less than the requested version?