[Mesa-dev] [RFC v5 08/19] egl/x11: Re-allocate buffers if format is suboptimal
Constantine Kharlamov
Hi-Angel at yandex.ru
Wed Nov 8 06:58:24 UTC 2017
[snip]
> @@ -372,10 +372,22 @@ dri3_handle_present_event(struct loader_dri3_drawable *draw,
> switch (ce->mode) {
> case XCB_PRESENT_COMPLETE_MODE_FLIP:
> draw->flipping = true;
> + for (int b = 0; b < sizeof(draw->buffers) / sizeof(draw->buffers[0]); b++) {
> + if (draw->buffers[b])
> + draw->buffers[b]->realloc_suboptimal = true;
> + }
> break;
> case XCB_PRESENT_COMPLETE_MODE_COPY:
> draw->flipping = false;
> break;
> +#if XCB_PRESENT_MAJOR_VERSION > 1 || (XCB_PRESENT_MAJOR_VERSION == 1 && XCB_PRESENT_MINOR_VERSION >= 1)
> + case XCB_PRESENT_COMPLETE_MODE_SUBOPTIMAL_COPY:
> + draw->flipping = false;
> + for (int b = 0; b < sizeof(draw->buffers) / sizeof(draw->buffers[0]); b++) {
> + if (draw->buffers[b])
> + draw->buffers[b]->suboptimal = true;
> + }
> +#endif
Probably worth using "ARRAY_SIZE(draw->buffers)"; ARRAY_SIZE is in util/macros.h
More information about the mesa-dev
mailing list