mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
gallium/tests: fix build after index buffer changes
for some reason, only scons can build these. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
709468a808
commit
479e76bc1f
16 changed files with 32 additions and 32 deletions
|
|
@ -68,7 +68,7 @@ set_vertices(void)
|
|||
|
||||
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_DEFAULT,
|
||||
sizeof(vertices),
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ set_vertices(void)
|
|||
|
||||
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_DEFAULT,
|
||||
sizeof(vertices),
|
||||
|
|
|
|||
|
|
@ -173,7 +173,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),
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ set_vertices(void)
|
|||
|
||||
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_DEFAULT,
|
||||
sizeof(vertices),
|
||||
|
|
|
|||
|
|
@ -235,13 +235,13 @@ static void set_vertices( void )
|
|||
vbuf.stride = sizeof( struct vertex );
|
||||
vbuf.buffer_offset = 0;
|
||||
if (draw_strip) {
|
||||
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_strip),
|
||||
vertices_strip);
|
||||
} else {
|
||||
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),
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ 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_DEFAULT,
|
||||
bytes,
|
||||
|
|
|
|||
|
|
@ -99,7 +99,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),
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ static void set_vertices( void )
|
|||
|
||||
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_DEFAULT,
|
||||
sizeof(vertices),
|
||||
|
|
|
|||
|
|
@ -89,7 +89,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),
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ set_vertices(struct vertex *verts, unsigned num_verts)
|
|||
|
||||
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_DEFAULT,
|
||||
num_verts * sizeof(struct vertex),
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static void set_vertices(void)
|
|||
|
||||
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_DEFAULT,
|
||||
sizeof(vertices),
|
||||
|
|
|
|||
|
|
@ -90,7 +90,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),
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@ static void set_vertices( void )
|
|||
{
|
||||
struct pipe_vertex_element ve[3];
|
||||
struct pipe_vertex_buffer vbuf[2];
|
||||
struct pipe_index_buffer ibuf;
|
||||
void *handle;
|
||||
|
||||
memset(ve, 0, sizeof ve);
|
||||
|
|
@ -133,7 +132,7 @@ static void set_vertices( void )
|
|||
/* vertex data */
|
||||
vbuf[0].stride = sizeof( struct vertex );
|
||||
vbuf[0].buffer_offset = 0;
|
||||
vbuf[0].buffer = pipe_buffer_create_with_data(ctx,
|
||||
vbuf[0].buffer.resource = pipe_buffer_create_with_data(ctx,
|
||||
PIPE_BIND_VERTEX_BUFFER,
|
||||
PIPE_USAGE_DEFAULT,
|
||||
sizeof(vertices),
|
||||
|
|
@ -142,25 +141,13 @@ static void set_vertices( void )
|
|||
/* instance data */
|
||||
vbuf[1].stride = sizeof( inst_data[0] );
|
||||
vbuf[1].buffer_offset = 0;
|
||||
vbuf[1].buffer = pipe_buffer_create_with_data(ctx,
|
||||
vbuf[1].buffer.resource = pipe_buffer_create_with_data(ctx,
|
||||
PIPE_BIND_VERTEX_BUFFER,
|
||||
PIPE_USAGE_DEFAULT,
|
||||
sizeof(inst_data),
|
||||
inst_data);
|
||||
|
||||
ctx->set_vertex_buffers(ctx, 0, 2, vbuf);
|
||||
|
||||
/* index data */
|
||||
ibuf.buffer = pipe_buffer_create_with_data(ctx,
|
||||
PIPE_BIND_INDEX_BUFFER,
|
||||
PIPE_USAGE_DEFAULT,
|
||||
sizeof(indices),
|
||||
indices);
|
||||
ibuf.offset = 0;
|
||||
ibuf.index_size = 2;
|
||||
|
||||
ctx->set_index_buffer(ctx, &ibuf);
|
||||
|
||||
}
|
||||
|
||||
static void set_vertex_shader( void )
|
||||
|
|
@ -203,16 +190,29 @@ static void draw( void )
|
|||
|
||||
ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0);
|
||||
|
||||
|
||||
util_draw_init_info(&info);
|
||||
info.indexed = (draw_elements != 0);
|
||||
info.index_size = draw_elements ? 2 : 0;
|
||||
info.mode = PIPE_PRIM_TRIANGLES;
|
||||
info.start = 0;
|
||||
info.count = 3;
|
||||
/* draw NUM_INST triangles */
|
||||
info.instance_count = NUM_INST;
|
||||
|
||||
/* index data */
|
||||
if (info.index_size) {
|
||||
info.index.resource =
|
||||
pipe_buffer_create_with_data(ctx,
|
||||
PIPE_BIND_INDEX_BUFFER,
|
||||
PIPE_USAGE_DEFAULT,
|
||||
sizeof(indices),
|
||||
indices);
|
||||
}
|
||||
|
||||
ctx->draw_vbo(ctx, &info);
|
||||
|
||||
pipe_resource_reference(&info.index.resource, NULL);
|
||||
|
||||
ctx->flush(ctx, NULL, 0);
|
||||
|
||||
graw_save_surface_to_file(ctx, surf, NULL);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ static void set_vertices( void )
|
|||
|
||||
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_DEFAULT,
|
||||
sizeof(vertices),
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ static void set_vertices( void )
|
|||
|
||||
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_DEFAULT,
|
||||
sizeof(vertices),
|
||||
|
|
|
|||
|
|
@ -167,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),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue