summaryrefslogtreecommitdiff
path: root/src/gallium/tests/graw/shader-leak.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/tests/graw/shader-leak.c')
-rw-r--r--src/gallium/tests/graw/shader-leak.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c
index 0a6c362d17..b53f0a046c 100644
--- a/src/gallium/tests/graw/shader-leak.c
+++ b/src/gallium/tests/graw/shader-leak.c
@@ -28,6 +28,7 @@ static const int HEIGHT = 300;
static struct pipe_screen *screen = NULL;
static struct pipe_context *ctx = NULL;
static struct pipe_surface *surf = NULL;
+static struct pipe_resource *tex = NULL;
static void *window = NULL;
struct vertex {
@@ -155,7 +156,7 @@ static void draw( void )
ctx->delete_fs_state(ctx, fs);
}
- screen->flush_frontbuffer(screen, surf, window);
+ screen->flush_frontbuffer(screen, tex, 0, 0, window);
ctx->destroy(ctx);
exit(0);
@@ -165,7 +166,8 @@ static void draw( void )
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
@@ -203,11 +205,16 @@ static void init( void )
exit(4);
}
- surf = screen->get_tex_surface(screen, tex, 0, 0, 0,
- PIPE_BIND_RENDER_TARGET |
- PIPE_BIND_DISPLAY_TARGET);
- if (surf == NULL)
+ 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) {
+ fprintf(stderr, "Unable to create tex surface!\n");
exit(5);
+ }
memset(&fb, 0, sizeof fb);
fb.nr_cbufs = 1;