etnaviv: GC7000: Update context reset for ..HALTI5
[mesa.git] / src / gallium / tests / graw / occlusion-query.c
index a4f13cbdae48ff13aa4b3fd20255367ac25577ee..444b645cacce1bc1c3920591c8f85e2bf96e6909 100644 (file)
@@ -94,13 +94,13 @@ set_vertices(struct vertex *vertices, unsigned bytes)
 
    vbuf.stride = sizeof(struct vertex);
    vbuf.buffer_offset = 0;
-   vbuf.buffer = pipe_buffer_create_with_data(info.ctx,
+   vbuf.buffer.resource = pipe_buffer_create_with_data(info.ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               bytes,
                                               vertices);
 
-   info.ctx->set_vertex_buffers(info.ctx, 1, &vbuf);
+   info.ctx->set_vertex_buffers(info.ctx, 0, 1, &vbuf);
 }
 
 
@@ -169,8 +169,8 @@ draw(void)
                    PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL,
                    &clear_color, 1.0, 0);
 
-   q1 = info.ctx->create_query(info.ctx, PIPE_QUERY_OCCLUSION_COUNTER);
-   q2 = info.ctx->create_query(info.ctx, PIPE_QUERY_OCCLUSION_COUNTER);
+   q1 = info.ctx->create_query(info.ctx, PIPE_QUERY_OCCLUSION_COUNTER, 0);
+   q2 = info.ctx->create_query(info.ctx, PIPE_QUERY_OCCLUSION_COUNTER, 0);
 
    /* draw first, large object */
    set_vertices(obj1_vertices, sizeof(obj1_vertices));
@@ -193,7 +193,7 @@ draw(void)
    if (res2.u64 < expected2_min || res2.u64 > expected2_max)
       printf("  Failure: result2 should be near %d\n", expected2);
 
-   info.ctx->flush(info.ctx, NULL);
+   info.ctx->flush(info.ctx, NULL, 0);
 
    graw_util_flush_front(&info);