etnaviv: GC7000: Update context reset for ..HALTI5
[mesa.git] / src / gallium / tests / graw / vs-test.c
index 5c7843eb11ad749d3867e500efadb58e36a3b908..e3b50ea8f89d48821fb5569c28979238e266d78e 100644 (file)
@@ -82,6 +82,7 @@ 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(constants);
@@ -100,15 +101,9 @@ static void init_fs_constbuf( void )
 
    u_box_2d(0,0,sizeof(constants),1, &box);
 
-   ctx->transfer_inline_write(ctx,
-                              constbuf,
-                              0,
-                              PIPE_TRANSFER_WRITE,
-                              &box,
-                              constants,
-                              sizeof constants,
-                              sizeof constants);
-
+   ctx->buffer_subdata(ctx, constbuf,
+                       PIPE_TRANSFER_WRITE,
+                       0, sizeof(constants), constants);
 
    pipe_set_constant_buffer(ctx,
                             PIPE_SHADER_VERTEX, 0,
@@ -172,7 +167,7 @@ static void set_vertices( void )
 
    vbuf.stride = sizeof( struct vertex );
    vbuf.buffer_offset = 0;
-   vbuf.buffer = pipe_buffer_create_with_data(ctx,
+   vbuf.buffer.resource = pipe_buffer_create_with_data(ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
                                               PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
@@ -227,7 +222,7 @@ static void draw( void )
    union pipe_color_union clear_color = { {.1,.3,.5,0} };
 
    ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0);
-   util_draw_arrays(ctx, PIPE_PRIM_POINTS, 0, Elements(vertices));
+   util_draw_arrays(ctx, PIPE_PRIM_POINTS, 0, ARRAY_SIZE(vertices));
    ctx->flush(ctx, NULL, 0);
 
    graw_save_surface_to_file(ctx, surf, NULL);
@@ -287,6 +282,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;
@@ -305,14 +301,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:
     */
@@ -396,6 +392,7 @@ static void init( void )
    if (ctx == NULL)
       exit(3);
 
+   memset(&templat, 0, sizeof(templat));
    templat.target = PIPE_TEXTURE_2D;
    templat.format = formats[i];
    templat.width0 = WIDTH;