#define ST_CONTEXT_FLAG_FORWARD_COMPATIBLE (1 << 1)
#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)
/**
* Reasons that context creation might fail.
if (notify_reset)
attribs.flags |= ST_CONTEXT_FLAG_RESET_NOTIFICATION_ENABLED;
+ if (flags & __DRI_CTX_FLAG_NO_ERROR)
+ attribs.flags |= ST_CONTEXT_FLAG_NO_ERROR;
+
if (sharedContextPrivate) {
st_share = ((struct dri_context *)sharedContextPrivate)->st;
}
static struct st_context *
st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
- const struct st_config_options *options)
+ const struct st_config_options *options, bool no_error)
{
struct pipe_screen *screen = pipe->screen;
uint i;
ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
+ if (no_error)
+ ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR;
+
st->has_stencil_export =
screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT);
st->has_shader_model3 = screen->get_param(screen, PIPE_CAP_SM3);
struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
const struct gl_config *visual,
struct st_context *share,
- const struct st_config_options *options)
+ const struct st_config_options *options,
+ bool no_error)
{
struct gl_context *ctx;
struct gl_context *shareCtx = share ? share->ctx : NULL;
if (debug_get_option_mesa_mvp_dp4())
ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = GL_TRUE;
- st = st_create_context_priv(ctx, pipe, options);
+ st = st_create_context_priv(ctx, pipe, options, no_error);
if (!st) {
_mesa_destroy_context(ctx);
}
st_create_context(gl_api api, struct pipe_context *pipe,
const struct gl_config *visual,
struct st_context *share,
- const struct st_config_options *options);
+ const struct st_config_options *options,
+ bool no_error);
extern void
st_destroy_context(struct st_context *st);
struct pipe_context *pipe;
struct gl_config mode;
gl_api api;
+ bool no_error = false;
unsigned ctx_flags = PIPE_CONTEXT_PREFER_THREADED;
if (!(stapi->profile_mask & (1 << attribs->profile)))
if (attribs->flags & ST_CONTEXT_FLAG_ROBUST_ACCESS)
ctx_flags |= PIPE_CONTEXT_ROBUST_BUFFER_ACCESS;
+ if (attribs->flags & ST_CONTEXT_FLAG_NO_ERROR)
+ no_error = true;
+
pipe = smapi->screen->context_create(smapi->screen, NULL, ctx_flags);
if (!pipe) {
*error = ST_CONTEXT_ERROR_NO_MEMORY;
}
st_visual_to_context_mode(&attribs->visual, &mode);
- st = st_create_context(api, pipe, &mode, shared_ctx, &attribs->options);
+ st = st_create_context(api, pipe, &mode, shared_ctx, &attribs->options, no_error);
if (!st) {
*error = ST_CONTEXT_ERROR_NO_MEMORY;
pipe->destroy(pipe);