Merge branch 'gallium-polygon-stipple'
[mesa.git] / src / gallium / tests / trivial / tri.c
index 37c1573051f1da16ee2b18dc612d1539008acda9..656e92ee8861abaa7fe150938777d83e22dcbd66 100644 (file)
@@ -120,7 +120,8 @@ static void init_prog(struct program *p)
                        }
                };
 
-               p->vbuf = pipe_buffer_create(p->screen, PIPE_BIND_VERTEX_BUFFER, sizeof(vertices));
+               p->vbuf = pipe_buffer_create(p->screen, PIPE_BIND_VERTEX_BUFFER,
+                                            PIPE_USAGE_STATIC, sizeof(vertices));
                pipe_buffer_write(p->pipe, p->vbuf, 0, sizeof(vertices), vertices);
        }
 
@@ -152,7 +153,7 @@ static void init_prog(struct program *p)
        p->rasterizer.cull_face = PIPE_FACE_NONE;
        p->rasterizer.gl_rasterization_rules = 1;
 
-       surf_tmpl.format = templat.format;
+       surf_tmpl.format = PIPE_FORMAT_B8G8R8A8_UNORM;
        surf_tmpl.usage = PIPE_BIND_RENDER_TARGET;
        surf_tmpl.u.tex.level = 0;
        surf_tmpl.u.tex.first_layer = 0;
@@ -257,13 +258,13 @@ static void draw(struct program *p)
        /* vertex element data */
        cso_set_vertex_elements(p->cso, 2, p->velem);
 
-       util_draw_vertex_buffer(p->pipe,
+       util_draw_vertex_buffer(p->pipe, p->cso,
                                p->vbuf, 0,
                                PIPE_PRIM_TRIANGLES,
                                3,  /* verts */
                                2); /* attribs/vert */
 
-       p->pipe->flush(p->pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+        p->pipe->flush(p->pipe, NULL);
 
        debug_dump_surface_bmp(p->pipe, "result.bmp", p->framebuffer.cbufs[0]);
 }