*/
for (i = 0; i < i915->num_vertex_buffers; i++) {
void *buf
- = pipe->winsys->buffer_map(pipe->winsys,
+ = pipe_buffer_map(pipe->screen,
i915->vertex_buffer[i].buffer,
PIPE_BUFFER_USAGE_CPU_READ);
draw_set_mapped_vertex_buffer(draw, i, buf);
/* Map index buffer, if present */
if (indexBuffer) {
void *mapped_indexes
- = pipe->winsys->buffer_map(pipe->winsys, indexBuffer,
+ = pipe_buffer_map(pipe->screen, indexBuffer,
PIPE_BUFFER_USAGE_CPU_READ);
draw_set_mapped_element_buffer_range(draw, indexSize,
min_index,
* unmap vertex/index buffers
*/
for (i = 0; i < i915->num_vertex_buffers; i++) {
- pipe->winsys->buffer_unmap(pipe->winsys, i915->vertex_buffer[i].buffer);
+ pipe_buffer_unmap(pipe->screen, i915->vertex_buffer[i].buffer);
draw_set_mapped_vertex_buffer(draw, i, NULL);
}
if (indexBuffer) {
- pipe->winsys->buffer_unmap(pipe->winsys, indexBuffer);
+ pipe_buffer_unmap(pipe->screen, indexBuffer);
draw_set_mapped_element_buffer_range(draw, 0, start, start + count - 1, NULL);
}
{
struct i915_vbuf_render *i915_render = i915_vbuf_render(render);
struct i915_context *i915 = i915_render->i915;
- struct pipe_winsys *winsys = i915->pipe.winsys;
+ struct pipe_screen *screen = i915->pipe.screen;
size_t size = (size_t)vertex_size * (size_t)nr_vertices;
/* FIXME: handle failure */
if (i915_render->vbo_size > size + i915_render->vbo_offset && !i915->vbo_flushed) {
} else {
i915->vbo_flushed = 0;
- winsys_buffer_reference(winsys, &i915_render->vbo, NULL);
+ pipe_buffer_reference(screen, &i915_render->vbo, NULL);
}
if (!i915_render->vbo) {
i915_render->vbo_size = MAX2(size, i915_render->vbo_alloc_size);
i915_render->vbo_offset = 0;
- i915_render->vbo = winsys->buffer_create(winsys,
- 64,
- I915_BUFFER_USAGE_LIT_VERTEX,
- i915_render->vbo_size);
- i915_render->vbo_ptr = winsys->buffer_map(winsys,
- i915_render->vbo,
- PIPE_BUFFER_USAGE_CPU_WRITE);
- winsys->buffer_unmap(winsys, i915_render->vbo);
+ i915_render->vbo = pipe_buffer_create(screen,
+ 64,
+ I915_BUFFER_USAGE_LIT_VERTEX,
+ i915_render->vbo_size);
+ i915_render->vbo_ptr = pipe_buffer_map(screen,
+ i915_render->vbo,
+ PIPE_BUFFER_USAGE_CPU_WRITE);
+ pipe_buffer_unmap(screen, i915_render->vbo);
}
i915->vbo = i915_render->vbo;
i915_vbuf_render_create( struct i915_context *i915 )
{
struct i915_vbuf_render *i915_render = CALLOC_STRUCT(i915_vbuf_render);
- struct pipe_winsys *winsys = i915->pipe.winsys;
+ struct pipe_screen *screen = i915->pipe.screen;
i915_render->i915 = i915;
i915_render->vbo_alloc_size = 128 * 4096;
i915_render->vbo_size = i915_render->vbo_alloc_size;
i915_render->vbo_offset = 0;
- i915_render->vbo = winsys->buffer_create(winsys,
- 64,
- I915_BUFFER_USAGE_LIT_VERTEX,
- i915_render->vbo_size);
- i915_render->vbo_ptr = winsys->buffer_map(winsys,
- i915_render->vbo,
- PIPE_BUFFER_USAGE_CPU_WRITE);
- winsys->buffer_unmap(winsys, i915_render->vbo);
+ i915_render->vbo = pipe_buffer_create(screen,
+ 64,
+ I915_BUFFER_USAGE_LIT_VERTEX,
+ i915_render->vbo_size);
+ i915_render->vbo_ptr = pipe_buffer_map(screen,
+ i915_render->vbo,
+ PIPE_BUFFER_USAGE_CPU_WRITE);
+ pipe_buffer_unmap(screen, i915_render->vbo);
return &i915_render->base;
}
#include "util/u_memory.h"
#include "pipe/p_winsys.h"
+#include "pipe/p_inlines.h"
#include "util/u_string.h"
#include "i915_reg.h"
struct pipe_surface *surface,
unsigned flags )
{
- char *map = screen->winsys->buffer_map( screen->winsys, surface->buffer, flags );
+ char *map = pipe_buffer_map( screen, surface->buffer, flags );
if (map == NULL)
return NULL;
i915_surface_unmap(struct pipe_screen *screen,
struct pipe_surface *surface)
{
- screen->winsys->buffer_unmap( screen->winsys, surface->buffer );
+ pipe_buffer_unmap( screen, surface->buffer );
}