From e8b187cc92b9b039dcbb6715665ee8ba5d065c6b Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 30 Nov 2023 17:47:11 +0100 Subject: render/gles2: save/restore context when creating/submitting a render pass This is useful for e.g. lazily blitting a texture for readback purposes while rendering. --- include/render/gles2.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/render') diff --git a/include/render/gles2.h b/include/render/gles2.h index 60bf4d17..dffd2059 100644 --- a/include/render/gles2.h +++ b/include/render/gles2.h @@ -15,6 +15,8 @@ #include #include +#include "render/egl.h" + // mesa ships old GL headers that don't include this type, so for distros that use headers from // mesa we need to def it ourselves until they update. // https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23144 @@ -132,6 +134,7 @@ struct wlr_gles2_render_pass { struct wlr_render_pass base; struct wlr_gles2_buffer *buffer; float projection_matrix[9]; + struct wlr_egl_context prev_ctx; struct wlr_gles2_render_timer *timer; }; @@ -164,6 +167,6 @@ void push_gles2_debug_(struct wlr_gles2_renderer *renderer, void pop_gles2_debug(struct wlr_gles2_renderer *renderer); struct wlr_gles2_render_pass *begin_gles2_buffer_pass(struct wlr_gles2_buffer *buffer, - struct wlr_gles2_render_timer *timer); + struct wlr_egl_context *prev_ctx, struct wlr_gles2_render_timer *timer); #endif -- cgit v1.2.3