gl-renderer: Skip non-dummy rbs in get_dummy_renderbuffer()

No backends currently create FBO or dma-buf renderbuffers on outputs
associated to a window. This is theoretically possible though and
should be allowed by the GL renderer. This commit prevents
output_get_dummy_renderbuffer() from mixing up renderbuffer types.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
This commit is contained in:
Loïc Molinari 2024-08-03 16:13:12 +02:00
parent 47035a776c
commit 2bfaac0f5c

View file

@ -2183,15 +2183,17 @@ output_get_dummy_renderbuffer(struct weston_output *output)
int max_buffers;
wl_list_for_each(rb, &go->renderbuffer_list, link) {
/* Count dummy renderbuffers, age them, */
count++;
rb->age++;
/* find the one with buffer_age to return, */
if (rb->age == buffer_age)
ret = rb;
/* and the oldest one in case we decide to reuse it. */
if (!oldest_rb || rb->age > oldest_rb->age)
oldest_rb = rb;
if (rb->type == RENDERBUFFER_DUMMY) {
/* Count dummy renderbuffers, age them, */
count++;
rb->age++;
/* find the one with buffer_age to return, */
if (rb->age == buffer_age)
ret = rb;
/* and the oldest one in case we decide to reuse it. */
if (!oldest_rb || rb->age > oldest_rb->age)
oldest_rb = rb;
}
}
/* If a renderbuffer of correct age was found, return it, */