diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-26 17:09:45 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-26 17:19:06 +0100 |
commit | 96804c74f8f0d19fc1b9db467cf050f4934fe83b (patch) | |
tree | 60b83b51da8a895daa1c37cdb804d6b7a74996a4 /test | |
parent | f306cd557ef263ff5057e413c335cc75bc0f7895 (diff) |
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'test')
-rw-r--r-- | test/dri2-swap.c | 20 |
1 files changed, 11 insertions, 9 deletions
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; |