Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gfx/drivers/gl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -8650,6 +8650,10 @@ static void *gl2_init(const video_info_t *video)
if (gl->desktop_xr)
gl->desktop_xr->window_interval = interval;
#endif
#ifdef GL2_VIEWS
/* get_flags reads it before the first frame too */
gl2_views_publish(gl);
#endif

/* Init leaves the core's context current for context_reset on this
* thread; when the wrapper's ring will drive the core, the main
Expand Down
33 changes: 33 additions & 0 deletions samples/gfx/threaded_video/threaded_video_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6704,6 +6704,35 @@ static void lane_pacing_flag_follows_wrapper(void)
fprintf(stderr, "[pass] pacing-flag lane\n");
}

#if defined(HAVE_OPENGL) && defined(HAVE_GLSL)
/* gl2 reports views from its init as its frames do: a frame laid out
* before its first draw took views and windows for gone */
static void lane_gl2_views_from_init(void)
{
unsigned had = failures;
gfx_ctx_flags_t flags;
bool at_init;

set_threaded_via_setting(false);
run_frames(2);
expect_wrapper(false, "gl2 views lane");
video_driver_reinit(DRIVER_VIDEO_MASK | DRIVER_INPUT_MASK);
flags.flags = 0;
video_context_driver_get_flags(&flags);
at_init = BIT32_GET(flags.flags, GFX_CTX_FLAGS_VIDEO_VIEWS) != 0;
run_frames(2);
flags.flags = 0;
video_context_driver_get_flags(&flags);
CHECK(at_init == (BIT32_GET(flags.flags, GFX_CTX_FLAGS_VIDEO_VIEWS) != 0),
"gl2 views lane: views %d from init, %d after a frame",
at_init ? 1 : 0,
(int)BIT32_GET(flags.flags, GFX_CTX_FLAGS_VIDEO_VIEWS));

if (failures == had)
fprintf(stderr, "[pass] gl2 views-from-init lane\n");
}
#endif

/* ------------------------------------------------------------------ */
/* Lane: zero-copy with the ring full */
/* A driver whose present blocks for longer than a display period - */
Expand Down Expand Up @@ -12134,6 +12163,10 @@ int main(int argc, char *argv[])
#if defined(HAVE_OPENGL) && defined(HAVE_GL_TEXTURE_LEND)
if (real_driver() && !strcmp(getenv("HARNESS_VIDEO_DRIVER"), "gl"))
lane_gl2_linear();
#endif
#if defined(HAVE_OPENGL) && defined(HAVE_GLSL)
if (real_driver() && !strcmp(getenv("HARNESS_VIDEO_DRIVER"), "gl"))
lane_gl2_views_from_init();
#endif
if (real_driver())
lane_surface_4k();
Expand Down
Loading