[Mesa-dev] [PATCH 2/5] st/mesa: use gl_driver_flags::NewFramebufferSRGB
Marek Olšák
maraeo at gmail.com
Mon Jun 5 16:50:23 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
also call st_init_driver_flags when st_context is initialized.
---
src/mesa/state_tracker/st_context.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index c901764..9b803c6 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -308,20 +308,21 @@ st_destroy_context_priv(struct st_context *st, bool destroy_pipe)
st_invalidate_readpix_cache(st);
cso_destroy_context(st->cso_context);
if (st->pipe && destroy_pipe)
st->pipe->destroy(st->pipe);
free( st );
}
+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)
{
struct pipe_screen *screen = pipe->screen;
uint i;
struct st_context *st = ST_CALLOC_STRUCT( st_context );
st->options = *options;
@@ -493,34 +494,38 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe,
if (ctx->Version == 0) {
/* This can happen when a core profile was requested, but the driver
* does not support some features of GL 3.1 or later.
*/
st_destroy_context_priv(st, false);
return NULL;
}
_mesa_initialize_dispatch_tables(ctx);
_mesa_initialize_vbo_vtxfmt(ctx);
+ st_init_driver_flags(st);
return st;
}
-static void st_init_driver_flags(struct gl_driver_flags *f)
+static void st_init_driver_flags(struct st_context *st)
{
+ struct gl_driver_flags *f = &st->ctx->DriverFlags;
+
f->NewArray = ST_NEW_VERTEX_ARRAYS;
f->NewRasterizerDiscard = ST_NEW_RASTERIZER;
f->NewUniformBuffer = ST_NEW_UNIFORM_BUFFER;
f->NewDefaultTessLevels = ST_NEW_TESS_STATE;
f->NewTextureBuffer = ST_NEW_SAMPLER_VIEWS;
f->NewAtomicBuffer = ST_NEW_ATOMIC_BUFFER;
f->NewShaderStorageBuffer = ST_NEW_STORAGE_BUFFER;
f->NewImageUnits = ST_NEW_IMAGE_UNITS;
+ f->NewFramebufferSRGB = ST_NEW_FRAMEBUFFER;
}
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)
{
struct gl_context *ctx;
struct gl_context *shareCtx = share ? share->ctx : NULL;
struct dd_function_table funcs;
@@ -537,22 +542,20 @@ struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
free(ctx);
return NULL;
}
st_debug_init();
if (pipe->screen->get_disk_shader_cache &&
!(ST_DEBUG & DEBUG_TGSI))
ctx->Cache = pipe->screen->get_disk_shader_cache(pipe->screen);
- st_init_driver_flags(&ctx->DriverFlags);
-
/* XXX: need a capability bit in gallium to query if the pipe
* driver prefers DP4 or MUL/MAD for vertex transformation.
*/
if (debug_get_option_mesa_mvp_dp4())
ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS = GL_TRUE;
st = st_create_context_priv(ctx, pipe, options);
if (!st) {
_mesa_destroy_context(ctx);
}
--
2.7.4
More information about the mesa-dev
mailing list