st/mesa: Add support for KHR_no_error flag

Add a new context flag and plumb it through the various layers of the
context creation code to set up dispatch tables for the no-error mode.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Grigori Goronzy
2017-06-29 04:39:22 +02:00
parent 7299e82fa4
commit 2bbe235053
5 changed files with 18 additions and 5 deletions

View File

@@ -289,7 +289,7 @@ static void st_init_driver_flags(struct st_context *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;
@@ -370,6 +370,9 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
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);
@@ -536,7 +539,8 @@ static void st_init_driver_flags(struct st_context *st)
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;
@@ -567,7 +571,7 @@ struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
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);
}