From 96804c74f8f0d19fc1b9db467cf050f4934fe83b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 26 Jun 2012 17:09:45 +0100 Subject: test: FakeFront rules Oh my, I just once again rediscovered the copy on every flip due to the requirement for keeping FakeFront uptodate for reads after a SwapBuffers. Signed-off-by: Chris Wilson --- test/dri2-swap.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'test/dri2-swap.c') diff --git a/test/dri2-swap.c b/test/dri2-swap.c index 5da3c727..e592cd8e 100644 --- a/test/dri2-swap.c +++ b/test/dri2-swap.c @@ -73,14 +73,11 @@ static double elapsed(const struct timespec *start, } static void run(Display *dpy, int width, int height, + unsigned int *attachments, int nattachments, const char *name) { Window win; XSetWindowAttributes attr; - unsigned int attachments[] = { - DRI2BufferFrontLeft, - DRI2BufferBackLeft, - }; int count; DRI2Buffer *buffers; struct timespec start, end; @@ -100,10 +97,9 @@ static void run(Display *dpy, int width, int height, DRI2CreateDrawable(dpy, win); - count = 2; buffers = DRI2GetBuffers(dpy, win, &width, &height, - attachments, count, &count); - if (count != 2) + attachments, nattachments, &count); + if (count != nattachments) return; xsync(dpy, win); @@ -146,6 +142,10 @@ int main(void) { Display *dpy; int width, height, fd; + unsigned int attachments[] = { + DRI2BufferBackLeft, + DRI2BufferFrontLeft, + }; dpy = XOpenDisplay (NULL); if (dpy == NULL) @@ -157,11 +157,13 @@ int main(void) width = WidthOfScreen(DefaultScreenOfDisplay(dpy)); height = HeightOfScreen(DefaultScreenOfDisplay(dpy)); - run(dpy, width, height, "fullscreen"); + run(dpy, width, height, attachments, 1, "fullscreen"); + run(dpy, width, height, attachments, 2, "fullscreen (with front)"); width /= 2; height /= 2; - run(dpy, width, height, "windowed"); + run(dpy, width, height, attachments, 1, "windowed"); + run(dpy, width, height, attachments, 2, "windowed (with front)"); return 0; -- cgit v1.2.3