diff options
Diffstat (limited to 'src/gallium/tests/graw/clear.c')
-rw-r--r-- | src/gallium/tests/graw/clear.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/tests/graw/clear.c b/src/gallium/tests/graw/clear.c index ee4581ef1ed..1ff80cadeec 100644 --- a/src/gallium/tests/graw/clear.c +++ b/src/gallium/tests/graw/clear.c @@ -20,6 +20,7 @@ static const int HEIGHT = 300; struct pipe_screen *screen; struct pipe_context *ctx; struct pipe_surface *surf; +struct pipe_resource *tex; static void *window = NULL; static void draw( void ) @@ -31,13 +32,14 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, surf, window); + screen->flush_frontbuffer(screen, tex, 0, 0, window); } static void init( void ) { struct pipe_framebuffer_state fb; - struct pipe_resource *tex, templat; + struct pipe_resource templat; + struct pipe_surface surf_tmpl; int i; /* It's hard to say whether window or screen should be created @@ -66,6 +68,7 @@ static void init( void ) templat.width0 = WIDTH; templat.height0 = HEIGHT; templat.depth0 = 1; + templat.array_size = 1; templat.last_level = 0; templat.nr_samples = 1; templat.bind = (PIPE_BIND_RENDER_TARGET | @@ -76,9 +79,12 @@ static void init( void ) if (tex == NULL) exit(4); - surf = screen->get_tex_surface(screen, tex, 0, 0, 0, - PIPE_BIND_RENDER_TARGET | - PIPE_BIND_DISPLAY_TARGET); + surf_tmpl.format = templat.format; + surf_tmpl.usage = PIPE_BIND_RENDER_TARGET; + surf_tmpl.u.tex.level = 0; + surf_tmpl.u.tex.first_layer = 0; + surf_tmpl.u.tex.last_layer = 0; + surf = ctx->create_surface(ctx, tex, &surf_tmpl); if (surf == NULL) exit(5); |