summaryrefslogtreecommitdiff
path: root/src/gallium/tests/graw/tri.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/tests/graw/tri.c')
-rw-r--r--src/gallium/tests/graw/tri.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gallium/tests/graw/tri.c b/src/gallium/tests/graw/tri.c
index 2742c7c99e..30ead999a4 100644
--- a/src/gallium/tests/graw/tri.c
+++ b/src/gallium/tests/graw/tri.c
@@ -93,7 +93,6 @@ static void set_vertices( void )
vbuf.stride = sizeof( struct vertex );
- vbuf.max_index = sizeof(vertices) / vbuf.stride;
vbuf.buffer_offset = 0;
vbuf.buffer = screen->user_buffer_create(screen,
vertices,
@@ -141,7 +140,7 @@ static void draw( void )
ctx->clear(ctx, PIPE_CLEAR_COLOR, clear_color, 0, 0);
util_draw_arrays(ctx, PIPE_PRIM_TRIANGLES, 0, 3);
- ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+ ctx->flush(ctx, NULL);
graw_save_surface_to_file(ctx, surf, NULL);
@@ -162,13 +161,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);