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 | 25 | ||||
-rw-r--r-- | src/gallium/tests/graw/gs-test.c | 25 | ||||
-rw-r--r-- | src/gallium/tests/graw/quad-tex.c | 20 | ||||
-rw-r--r-- | src/gallium/tests/graw/shader-leak.c | 19 | ||||
-rw-r--r-- | src/gallium/tests/graw/tri-gs.c | 16 | ||||
-rw-r--r-- | src/gallium/tests/graw/tri-instanced.c | 16 | ||||
-rw-r--r-- | src/gallium/tests/graw/tri.c | 18 | ||||
-rw-r--r-- | src/gallium/tests/graw/vs-test.c | 23 |
9 files changed, 114 insertions, 64 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); diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c index 19af83fda88..37be2d0830c 100644 --- a/src/gallium/tests/graw/fs-test.c +++ b/src/gallium/tests/graw/fs-test.c @@ -119,6 +119,7 @@ static void init_fs_constbuf( void ) templat.width0 = sizeof(constants1); templat.height0 = 1; templat.depth0 = 1; + templat.array_size = 1; templat.last_level = 0; templat.nr_samples = 1; templat.bind = PIPE_BIND_CONSTANT_BUFFER; @@ -139,7 +140,7 @@ static void init_fs_constbuf( void ) ctx->transfer_inline_write(ctx, constbuf1, - u_subresource(0,0), + 0, PIPE_TRANSFER_WRITE, &box, constants1, @@ -156,7 +157,7 @@ static void init_fs_constbuf( void ) ctx->transfer_inline_write(ctx, constbuf2, - u_subresource(0,0), + 0, PIPE_TRANSFER_WRITE, &box, constants2, @@ -280,7 +281,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, surf, window); + screen->flush_frontbuffer(screen, rttex, 0, 0, window); } #define SIZE 16 @@ -340,6 +341,7 @@ static void init_tex( void ) templat.width0 = SIZE; templat.height0 = SIZE; templat.depth0 = 1; + templat.array_size = 1; templat.last_level = 0; templat.nr_samples = 1; templat.bind = PIPE_BIND_SAMPLER_VIEW; @@ -354,7 +356,7 @@ static void init_tex( void ) ctx->transfer_inline_write(ctx, samptex, - u_subresource(0,0), + 0, PIPE_TRANSFER_WRITE, &box, tex2d, @@ -368,7 +370,7 @@ static void init_tex( void ) struct pipe_transfer *t; uint32_t *ptr; t = pipe_get_transfer(ctx, samptex, - 0, 0, 0, /* face, level, zslice */ + 0, 0, /* level, layer */ PIPE_TRANSFER_READ, 0, 0, SIZE, SIZE); /* x, y, width, height */ @@ -387,8 +389,6 @@ static void init_tex( void ) memset(&sv_template, 0, sizeof sv_template); sv_template.format = samptex->format; sv_template.texture = samptex; - sv_template.first_level = 0; - sv_template.last_level = 0; sv_template.swizzle_r = 0; sv_template.swizzle_g = 1; sv_template.swizzle_b = 2; @@ -424,6 +424,7 @@ static void init( void ) { struct pipe_framebuffer_state fb; struct pipe_resource templat; + struct pipe_surface surf_tmpl; int i; /* It's hard to say whether window or screen should be created @@ -450,6 +451,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 | @@ -460,9 +462,12 @@ static void init( void ) if (rttex == NULL) exit(4); - surf = screen->get_tex_surface(screen, rttex, 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, rttex, &surf_tmpl); if (surf == NULL) exit(5); diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c index ef29f134980..812666a8c84 100644 --- a/src/gallium/tests/graw/gs-test.c +++ b/src/gallium/tests/graw/gs-test.c @@ -156,6 +156,7 @@ static void init_fs_constbuf( void ) templat.width0 = sizeof(constants1); templat.height0 = 1; templat.depth0 = 1; + templat.array_size = 1; templat.last_level = 0; templat.nr_samples = 1; templat.bind = PIPE_BIND_CONSTANT_BUFFER; @@ -172,7 +173,7 @@ static void init_fs_constbuf( void ) ctx->transfer_inline_write(ctx, constbuf1, - u_subresource(0,0), + 0, PIPE_TRANSFER_WRITE, &box, constants1, @@ -189,7 +190,7 @@ static void init_fs_constbuf( void ) ctx->transfer_inline_write(ctx, constbuf2, - u_subresource(0,0), + 0, PIPE_TRANSFER_WRITE, &box, constants2, @@ -344,7 +345,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, surf, window); + screen->flush_frontbuffer(screen, rttex, 0, 0, window); } #define SIZE 16 @@ -404,6 +405,7 @@ static void init_tex( void ) templat.width0 = SIZE; templat.height0 = SIZE; templat.depth0 = 1; + templat.array_size = 1; templat.last_level = 0; templat.nr_samples = 1; templat.bind = PIPE_BIND_SAMPLER_VIEW; @@ -418,7 +420,7 @@ static void init_tex( void ) ctx->transfer_inline_write(ctx, samptex, - u_subresource(0,0), + 0, PIPE_TRANSFER_WRITE, &box, tex2d, @@ -432,7 +434,7 @@ static void init_tex( void ) struct pipe_transfer *t; uint32_t *ptr; t = pipe_get_transfer(ctx, samptex, - 0, 0, 0, /* face, level, zslice */ + 0, 0, /* level, layer */ PIPE_TRANSFER_READ, 0, 0, SIZE, SIZE); /* x, y, width, height */ @@ -451,8 +453,6 @@ static void init_tex( void ) memset(&sv_template, 0, sizeof sv_template); sv_template.format = samptex->format; sv_template.texture = samptex; - sv_template.first_level = 0; - sv_template.last_level = 0; sv_template.swizzle_r = 0; sv_template.swizzle_g = 1; sv_template.swizzle_b = 2; @@ -488,6 +488,7 @@ static void init( void ) { struct pipe_framebuffer_state fb; struct pipe_resource templat; + struct pipe_surface surf_tmpl; int i; /* It's hard to say whether window or screen should be created @@ -514,6 +515,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 | @@ -524,9 +526,12 @@ static void init( void ) if (rttex == NULL) exit(4); - surf = screen->get_tex_surface(screen, rttex, 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, rttex, &surf_tmpl); if (surf == NULL) exit(5); diff --git a/src/gallium/tests/graw/quad-tex.c b/src/gallium/tests/graw/quad-tex.c index 35eade939e6..952131d765b 100644 --- a/src/gallium/tests/graw/quad-tex.c +++ b/src/gallium/tests/graw/quad-tex.c @@ -151,7 +151,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, surf, window); + screen->flush_frontbuffer(screen, rttex, 0, 0, window); } #define SIZE 16 @@ -211,6 +211,7 @@ static void init_tex( void ) templat.width0 = SIZE; templat.height0 = SIZE; templat.depth0 = 1; + templat.array_size = 1; templat.last_level = 0; templat.nr_samples = 1; templat.bind = PIPE_BIND_SAMPLER_VIEW; @@ -225,7 +226,7 @@ static void init_tex( void ) ctx->transfer_inline_write(ctx, samptex, - u_subresource(0,0), + 0, PIPE_TRANSFER_WRITE, &box, tex2d, @@ -239,7 +240,7 @@ static void init_tex( void ) struct pipe_transfer *t; uint32_t *ptr; t = pipe_get_transfer(ctx, samptex, - 0, 0, 0, /* face, level, zslice */ + 0, 0, /* level, layer */ PIPE_TRANSFER_READ, 0, 0, SIZE, SIZE); /* x, y, width, height */ @@ -258,8 +259,6 @@ static void init_tex( void ) memset(&sv_template, 0, sizeof sv_template); sv_template.format = samptex->format; sv_template.texture = samptex; - sv_template.first_level = 0; - sv_template.last_level = 0; sv_template.swizzle_r = 0; sv_template.swizzle_g = 1; sv_template.swizzle_b = 2; @@ -295,6 +294,7 @@ static void init( void ) { struct pipe_framebuffer_state fb; struct pipe_resource templat; + struct pipe_surface surf_tmpl; int i; /* It's hard to say whether window or screen should be created @@ -321,6 +321,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 | @@ -331,9 +332,12 @@ static void init( void ) if (rttex == NULL) exit(4); - surf = screen->get_tex_surface(screen, rttex, 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, rttex, &surf_tmpl); if (surf == NULL) exit(5); diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c index 0a6c362d172..b53f0a046ca 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; diff --git a/src/gallium/tests/graw/tri-gs.c b/src/gallium/tests/graw/tri-gs.c index 731c4e10cfd..84ff3e67735 100644 --- a/src/gallium/tests/graw/tri-gs.c +++ b/src/gallium/tests/graw/tri-gs.c @@ -23,6 +23,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 { @@ -164,14 +165,15 @@ static void draw( void ) util_draw_arrays(ctx, PIPE_PRIM_TRIANGLES, 0, 3); ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, 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 @@ -198,6 +200,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 | @@ -208,9 +211,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); diff --git a/src/gallium/tests/graw/tri-instanced.c b/src/gallium/tests/graw/tri-instanced.c index 76443811629..f33c061b22b 100644 --- a/src/gallium/tests/graw/tri-instanced.c +++ b/src/gallium/tests/graw/tri-instanced.c @@ -27,6 +27,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 { @@ -216,14 +217,15 @@ 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 @@ -250,6 +252,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 | @@ -260,9 +263,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); diff --git a/src/gallium/tests/graw/tri.c b/src/gallium/tests/graw/tri.c index 025a1470dc9..2742c7c99e0 100644 --- a/src/gallium/tests/graw/tri.c +++ b/src/gallium/tests/graw/tri.c @@ -25,6 +25,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 { @@ -144,14 +145,15 @@ 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 @@ -180,6 +182,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 | @@ -192,11 +195,14 @@ static void init( void ) 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) { - fprintf(stderr, "Unable to get tex surface!\n"); + fprintf(stderr, "Unable to create tex surface!\n"); exit(5); } diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c index 440c40bdcda..58908f38a23 100644 --- a/src/gallium/tests/graw/vs-test.c +++ b/src/gallium/tests/graw/vs-test.c @@ -87,6 +87,7 @@ static void init_fs_constbuf( void ) templat.width0 = sizeof(constants); templat.height0 = 1; templat.depth0 = 1; + templat.array_size = 1; templat.last_level = 0; templat.nr_samples = 1; templat.bind = PIPE_BIND_CONSTANT_BUFFER; @@ -101,7 +102,7 @@ static void init_fs_constbuf( void ) ctx->transfer_inline_write(ctx, constbuf, - u_subresource(0,0), + 0, PIPE_TRANSFER_WRITE, &box, constants, @@ -231,7 +232,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, surf, window); + screen->flush_frontbuffer(screen, rttex, 0, 0, window); } #define SIZE 16 @@ -291,6 +292,7 @@ static void init_tex( void ) templat.width0 = SIZE; templat.height0 = SIZE; templat.depth0 = 1; + templat.array_size = 1; templat.last_level = 0; templat.nr_samples = 1; templat.bind = PIPE_BIND_SAMPLER_VIEW; @@ -305,7 +307,7 @@ static void init_tex( void ) ctx->transfer_inline_write(ctx, samptex, - u_subresource(0,0), + 0, PIPE_TRANSFER_WRITE, &box, tex2d, @@ -319,7 +321,7 @@ static void init_tex( void ) struct pipe_transfer *t; uint32_t *ptr; t = pipe_get_transfer(ctx, samptex, - 0, 0, 0, /* face, level, zslice */ + 0, 0, /* level, layer */ PIPE_TRANSFER_READ, 0, 0, SIZE, SIZE); /* x, y, width, height */ @@ -338,8 +340,6 @@ static void init_tex( void ) memset(&sv_template, 0, sizeof sv_template); sv_template.format = samptex->format; sv_template.texture = samptex; - sv_template.first_level = 0; - sv_template.last_level = 0; sv_template.swizzle_r = 0; sv_template.swizzle_g = 1; sv_template.swizzle_b = 2; @@ -375,6 +375,7 @@ static void init( void ) { struct pipe_framebuffer_state fb; struct pipe_resource templat; + struct pipe_surface surf_tmpl; int i; /* It's hard to say whether window or screen should be created @@ -401,6 +402,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 | @@ -411,9 +413,12 @@ static void init( void ) if (rttex == NULL) exit(4); - surf = screen->get_tex_surface(screen, rttex, 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, rttex, &surf_tmpl); if (surf == NULL) exit(5); |