summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/tests/graw/gs-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/gallium/tests/graw/gs-test.c')
-rw-r--r--lib/mesa/src/gallium/tests/graw/gs-test.c50
1 files changed, 18 insertions, 32 deletions
diff --git a/lib/mesa/src/gallium/tests/graw/gs-test.c b/lib/mesa/src/gallium/tests/graw/gs-test.c
index b685323fe..46042c68a 100644
--- a/lib/mesa/src/gallium/tests/graw/gs-test.c
+++ b/lib/mesa/src/gallium/tests/graw/gs-test.c
@@ -149,8 +149,8 @@ static float constants2[] =
static void init_fs_constbuf( void )
{
struct pipe_resource templat;
- struct pipe_box box;
+ memset(&templat, 0, sizeof(templat));
templat.target = PIPE_BUFFER;
templat.format = PIPE_FORMAT_R8_UNORM;
templat.width0 = sizeof(constants1);
@@ -169,34 +169,18 @@ static void init_fs_constbuf( void )
exit(4);
{
- u_box_2d(0,0,sizeof(constants1),1, &box);
-
- ctx->transfer_inline_write(ctx,
- constbuf1,
- 0,
- PIPE_TRANSFER_WRITE,
- &box,
- constants1,
- sizeof constants1,
- sizeof constants1);
-
+ ctx->buffer_subdata(ctx, constbuf1,
+ PIPE_TRANSFER_WRITE,
+ 0, sizeof(constants1), constants1);
pipe_set_constant_buffer(ctx,
PIPE_SHADER_GEOMETRY, 0,
constbuf1);
}
{
- u_box_2d(0,0,sizeof(constants2),1, &box);
-
- ctx->transfer_inline_write(ctx,
- constbuf2,
- 0,
- PIPE_TRANSFER_WRITE,
- &box,
- constants2,
- sizeof constants2,
- sizeof constants2);
-
+ ctx->buffer_subdata(ctx, constbuf2,
+ PIPE_TRANSFER_WRITE,
+ 0, sizeof(constants2), constants2);
pipe_set_constant_buffer(ctx,
PIPE_SHADER_GEOMETRY, 1,
@@ -400,6 +384,7 @@ static void init_tex( void )
tex2d[1][1][3] = 255;
#endif
+ memset(&templat, 0, sizeof(templat));
templat.target = PIPE_TEXTURE_2D;
templat.format = PIPE_FORMAT_B8G8R8A8_UNORM;
templat.width0 = SIZE;
@@ -418,14 +403,14 @@ static void init_tex( void )
u_box_2d(0,0,SIZE,SIZE, &box);
- ctx->transfer_inline_write(ctx,
- samptex,
- 0,
- PIPE_TRANSFER_WRITE,
- &box,
- tex2d,
- sizeof tex2d[0],
- sizeof tex2d);
+ ctx->texture_subdata(ctx,
+ samptex,
+ 0,
+ PIPE_TRANSFER_WRITE,
+ &box,
+ tex2d,
+ sizeof tex2d[0],
+ sizeof tex2d);
/* Possibly read back & compare against original data:
*/
@@ -505,10 +490,11 @@ static void init( void )
exit(1);
}
- ctx = screen->context_create(screen, NULL);
+ ctx = screen->context_create(screen, NULL, 0);
if (ctx == NULL)
exit(3);
+ memset(&templat, 0, sizeof(templat));
templat.target = PIPE_TEXTURE_2D;
templat.format = formats[i];
templat.width0 = WIDTH;