From 74d40c68dc379877c76e4bf3b766bd627bdbf09f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 20 Dec 2021 15:24:03 +1000 Subject: [PATCH] mesa/ctx: store screen pointer in ctx as well This is actually useful to have. Reviewed-by: Kristian H. Kristensen Part-of: --- src/mesa/main/mtypes.h | 1 + src/mesa/state_tracker/st_context.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 08afbd3..2b27a56 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3543,6 +3543,7 @@ struct gl_context /*@{*/ struct vbo_context vbo_context; struct st_context *st; + struct pipe_screen *screen; struct pipe_context *pipe; struct st_config_options *st_opts; struct cso_context *cso_context; diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index b25d5b1..4266671 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -877,6 +877,8 @@ st_create_context(gl_api api, struct pipe_context *pipe, memset(ctx, 0, sizeof(*ctx)); ctx->pipe = pipe; + ctx->screen = pipe->screen; + if (!_mesa_initialize_context(ctx, api, visual, shareCtx, &funcs)) { align_free(ctx); return NULL; -- 2.7.4