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);
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,
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),
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);
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;
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:
*/
if (ctx == NULL)
exit(3);
+ memset(&templat, 0, sizeof(templat));
templat.target = PIPE_TEXTURE_2D;
templat.format = formats[i];
templat.width0 = WIDTH;