From 8220184a72e249809991d6fb25061edfc06d8a6d Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Sun, 3 Mar 2024 09:56:06 -0500 Subject: [PATCH] wlr_scene: Assert that buffer returned from swapchain is the right size --- types/scene/wlr_scene.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c index 59b992df..79fd717f 100644 --- a/types/scene/wlr_scene.c +++ b/types/scene/wlr_scene.c @@ -1686,8 +1686,9 @@ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output, .output = scene_output, }; + int resolution_width, resolution_height; output_pending_resolution(output, state, - &render_data.trans_width, &render_data.trans_height); + &resolution_width, &resolution_height); if (state->committed & WLR_OUTPUT_STATE_TRANSFORM) { if (render_data.transform != state->transform) { @@ -1705,6 +1706,8 @@ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output, render_data.scale = state->scale; } + render_data.trans_width = resolution_width; + render_data.trans_height = resolution_height; wlr_output_transform_coords(render_data.transform, &render_data.trans_width, &render_data.trans_height); @@ -1800,6 +1803,8 @@ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output, return false; } + assert(buffer->width == resolution_width && buffer->height == resolution_height); + if (timer) { timer->render_timer = wlr_render_timer_create(output->renderer);