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 <gert.wollny@collabora.com>
Reviewed-by: Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Gert Wollny 4 years ago
parent 05676a0376
commit 57a19772cb
  1. 2
      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 */

Loading…
Cancel
Save