diff options
Diffstat (limited to 'src/gallium/tests/graw')
-rw-r--r-- | src/gallium/tests/graw/clear.c | 16 | ||||
-rw-r--r-- | src/gallium/tests/graw/fs-test.c | 15 | ||||
-rw-r--r-- | src/gallium/tests/graw/gs-test.c | 15 | ||||
-rw-r--r-- | src/gallium/tests/graw/quad-tex.c | 16 | ||||
-rw-r--r-- | src/gallium/tests/graw/shader-leak.c | 15 | ||||
-rw-r--r-- | src/gallium/tests/graw/tri-gs.c | 14 | ||||
-rw-r--r-- | src/gallium/tests/graw/tri-instanced.c | 13 | ||||
-rw-r--r-- | src/gallium/tests/graw/tri.c | 13 | ||||
-rw-r--r-- | src/gallium/tests/graw/vs-test.c | 13 |
9 files changed, 79 insertions, 51 deletions
diff --git a/src/gallium/tests/graw/clear.c b/src/gallium/tests/graw/clear.c index 1ff80cadeec..55cc0087a09 100644 --- a/src/gallium/tests/graw/clear.c +++ b/src/gallium/tests/graw/clear.c @@ -2,6 +2,7 @@ * any utility code, just the graw interface and gallium. */ +#include <stdio.h> #include "state_tracker/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" @@ -48,16 +49,17 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; - window == NULL && formats[i] != PIPE_FORMAT_NONE; - i++) { - - screen = graw_create_window_and_screen(0,0,300,300, + for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) { + screen = graw_create_window_and_screen(0, 0, 300, 300, formats[i], &window); + if (window && screen) + break; + } + if (!screen || !window) { + fprintf(stderr, "Unable to create window\n"); + exit(1); } - if (window == NULL) - exit(2); ctx = screen->context_create(screen, NULL); if (ctx == NULL) diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c index 37be2d0830c..d21eb44e116 100644 --- a/src/gallium/tests/graw/fs-test.c +++ b/src/gallium/tests/graw/fs-test.c @@ -433,15 +433,18 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; - window == NULL && formats[i] != PIPE_FORMAT_NONE; - i++) { - - screen = graw_create_window_and_screen(0,0,WIDTH,HEIGHT, + for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) { + screen = graw_create_window_and_screen(0, 0, 300, 300, formats[i], &window); + if (window && screen) + break; } - + if (!screen || !window) { + fprintf(stderr, "Unable to create window\n"); + exit(1); + } + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c index 812666a8c84..0c65390e109 100644 --- a/src/gallium/tests/graw/gs-test.c +++ b/src/gallium/tests/graw/gs-test.c @@ -497,15 +497,18 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; - window == NULL && formats[i] != PIPE_FORMAT_NONE; - i++) { - - screen = graw_create_window_and_screen(0,0,WIDTH,HEIGHT, + for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) { + screen = graw_create_window_and_screen(0, 0, 300, 300, formats[i], &window); + if (window && screen) + break; } - + if (!screen || !window) { + fprintf(stderr, "Unable to create window\n"); + exit(1); + } + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); diff --git a/src/gallium/tests/graw/quad-tex.c b/src/gallium/tests/graw/quad-tex.c index 952131d765b..58ca639d207 100644 --- a/src/gallium/tests/graw/quad-tex.c +++ b/src/gallium/tests/graw/quad-tex.c @@ -2,6 +2,7 @@ * any utility code, just the graw interface and gallium. */ +#include <stdio.h> #include "state_tracker/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" @@ -303,15 +304,18 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; - window == NULL && formats[i] != PIPE_FORMAT_NONE; - i++) { - - screen = graw_create_window_and_screen(0,0,300,300, + for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) { + screen = graw_create_window_and_screen(0, 0, 300, 300, formats[i], &window); + if (window && screen) + break; } - + if (!screen || !window) { + fprintf(stderr, "Unable to create window\n"); + exit(1); + } + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c index b53f0a046ca..9af76f51ea2 100644 --- a/src/gallium/tests/graw/shader-leak.c +++ b/src/gallium/tests/graw/shader-leak.c @@ -176,15 +176,18 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; - window == NULL && formats[i] != PIPE_FORMAT_NONE; - i++) { - - screen = graw_create_window_and_screen(0,0,300,300, + for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) { + screen = graw_create_window_and_screen(0, 0, 300, 300, formats[i], &window); + if (window && screen) + break; } - + if (!screen || !window) { + fprintf(stderr, "Unable to create window\n"); + exit(1); + } + ctx = screen->context_create(screen, NULL); if (ctx == NULL) exit(3); diff --git a/src/gallium/tests/graw/tri-gs.c b/src/gallium/tests/graw/tri-gs.c index 84ff3e67735..a1a00b32098 100644 --- a/src/gallium/tests/graw/tri-gs.c +++ b/src/gallium/tests/graw/tri-gs.c @@ -2,6 +2,7 @@ * any utility code, just the graw interface and gallium. */ +#include <stdio.h> #include "state_tracker/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" @@ -182,13 +183,16 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; - window == NULL && formats[i] != PIPE_FORMAT_NONE; - i++) { - - screen = graw_create_window_and_screen(0,0,300,300, + for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) { + screen = graw_create_window_and_screen(0, 0, 300, 300, formats[i], &window); + if (window && screen) + break; + } + if (!screen || !window) { + fprintf(stderr, "Unable to create window\n"); + exit(1); } ctx = screen->context_create(screen, NULL); diff --git a/src/gallium/tests/graw/tri-instanced.c b/src/gallium/tests/graw/tri-instanced.c index f33c061b22b..f61d8b9844d 100644 --- a/src/gallium/tests/graw/tri-instanced.c +++ b/src/gallium/tests/graw/tri-instanced.c @@ -234,13 +234,16 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; - window == NULL && formats[i] != PIPE_FORMAT_NONE; - i++) { - - screen = graw_create_window_and_screen(0,0,300,300, + for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) { + screen = graw_create_window_and_screen(0, 0, 300, 300, formats[i], &window); + if (window && screen) + break; + } + if (!screen || !window) { + fprintf(stderr, "Unable to create window\n"); + exit(1); } ctx = screen->context_create(screen, NULL); diff --git a/src/gallium/tests/graw/tri.c b/src/gallium/tests/graw/tri.c index 2742c7c99e0..006d61ca88c 100644 --- a/src/gallium/tests/graw/tri.c +++ b/src/gallium/tests/graw/tri.c @@ -162,13 +162,16 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; - window == NULL && formats[i] != PIPE_FORMAT_NONE; - i++) { - - screen = graw_create_window_and_screen(0,0,300,300, + for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) { + screen = graw_create_window_and_screen(0, 0, 300, 300, formats[i], &window); + if (window && screen) + break; + } + if (!screen || !window) { + fprintf(stderr, "Unable to create window\n"); + exit(1); } ctx = screen->context_create(screen, NULL); diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c index 58908f38a23..1358fa85dfd 100644 --- a/src/gallium/tests/graw/vs-test.c +++ b/src/gallium/tests/graw/vs-test.c @@ -384,13 +384,16 @@ static void init( void ) * Also, no easy way of querying supported formats if the screen * cannot be created first. */ - for (i = 0; - window == NULL && formats[i] != PIPE_FORMAT_NONE; - i++) { - - screen = graw_create_window_and_screen(0,0,WIDTH,HEIGHT, + for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) { + screen = graw_create_window_and_screen(0, 0, 300, 300, formats[i], &window); + if (window && screen) + break; + } + if (!screen || !window) { + fprintf(stderr, "Unable to create window\n"); + exit(1); } ctx = screen->context_create(screen, NULL); |