From 57a19772cb942ed4b46a0a65047e41b0e3dfcdd9 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 20 Jan 2021 10:08:04 +0100 Subject: [PATCH] vrend: Add parent context reference to sub-contexts When we want to pass sub contexts directly to the function to avoid having to de-reference the context pointer all the time there are rare cases when we need the pointer to the parent context (e.g. for error reporting). For these cases we need to be able to get the parent context. Signed-off-by: Gert Wollny Reviewed-by: Reviewed-by: Chia-I Wu --- src/vrend_renderer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index a8d2e33..c2df2c7 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -663,6 +663,7 @@ struct vrend_sub_context { int prim_mode; bool drawing; + struct vrend_context *parent; }; struct vrend_untyped_resource { @@ -10574,6 +10575,7 @@ void vrend_renderer_create_sub_ctx(struct vrend_context *ctx, int sub_ctx_id) ctx_params.major_ver = vrend_state.gl_major_ver; ctx_params.minor_ver = vrend_state.gl_minor_ver; sub->gl_context = vrend_clicbs->create_gl_context(0, &ctx_params); + sub->parent = ctx; vrend_clicbs->make_current(sub->gl_context); /* enable if vrend_renderer_init function has done it as well */