setup_vertex0(vertices[3], dstX, dstY + height,
ctx->solid_color);
- return pipe_user_buffer_create(ctx->ctx->screen,
+ return pipe_user_buffer_create(ctx->pipe->screen,
vertices,
sizeof(vertices));
}
setup_vertex1(vertices[3], dstX, dstY + height,
s0, t1);
- return pipe_user_buffer_create(ctx->ctx->screen,
+ return pipe_user_buffer_create(ctx->pipe->screen,
vertices,
sizeof(vertices));
}
setup_vertex1(vertices[3], x0, y1,
s0, t1);
- return pipe_user_buffer_create(ctx->ctx->screen,
+ return pipe_user_buffer_create(ctx->pipe->screen,
vertices,
sizeof(vertices));
}
setup_vertex2(vertices[3], dstX, dstY + height,
st0[0], st0[3], st1[0], st1[3]);
- return pipe_user_buffer_create(ctx->ctx->screen,
+ return pipe_user_buffer_create(ctx->pipe->screen,
vertices,
sizeof(vertices));
}
struct pipe_constant_buffer *cbuf = &exa->vs_const_buffer;
pipe_buffer_reference(&cbuf->buffer, NULL);
- cbuf->buffer = pipe_buffer_create(exa->ctx->screen, 16,
+ cbuf->buffer = pipe_buffer_create(exa->pipe->screen, 16,
PIPE_BUFFER_USAGE_CONSTANT,
param_bytes);
if (cbuf->buffer) {
- pipe_buffer_write(exa->ctx->screen, cbuf->buffer,
+ pipe_buffer_write(exa->pipe->screen, cbuf->buffer,
0, param_bytes, vs_consts);
}
- exa->ctx->set_constant_buffer(exa->ctx, PIPE_SHADER_VERTEX, 0, cbuf);
+ exa->pipe->set_constant_buffer(exa->pipe, PIPE_SHADER_VERTEX, 0, cbuf);
}
struct pipe_constant_buffer *cbuf = &exa->fs_const_buffer;
pipe_buffer_reference(&cbuf->buffer, NULL);
- cbuf->buffer = pipe_buffer_create(exa->ctx->screen, 16,
+ cbuf->buffer = pipe_buffer_create(exa->pipe->screen, 16,
PIPE_BUFFER_USAGE_CONSTANT,
param_bytes);
if (cbuf->buffer) {
- pipe_buffer_write(exa->ctx->screen, cbuf->buffer,
+ pipe_buffer_write(exa->pipe->screen, cbuf->buffer,
0, param_bytes, fs_consts);
}
- exa->ctx->set_constant_buffer(exa->ctx, PIPE_SHADER_FRAGMENT, 0, cbuf);
+ exa->pipe->set_constant_buffer(exa->pipe, PIPE_SHADER_FRAGMENT, 0, cbuf);
}
static void
int srcX, int srcY, int maskX, int maskY,
int dstX, int dstY, int width, int height)
{
- struct pipe_context *pipe = exa->ctx;
+ struct pipe_context *pipe = exa->pipe;
struct pipe_buffer *buf = 0;
if (exa->num_bound_samplers == 0 ) { /* solid fill */
struct exa_pixmap_priv *pixmap,
int x0, int y0, int x1, int y1)
{
- struct pipe_context *pipe = exa->ctx;
+ struct pipe_context *pipe = exa->pipe;
struct pipe_buffer *buf = 0;
float vertices[4][2][4];
setup_vertex0(vertices[3], x0, y1,
exa->solid_color);
- buf = pipe_user_buffer_create(exa->ctx->screen,
+ buf = pipe_user_buffer_create(exa->pipe->screen,
vertices,
sizeof(vertices));
float dx1, float dy1,
float dx2, float dy2)
{
- struct pipe_context *pipe = exa->ctx;
+ struct pipe_context *pipe = exa->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_buffer *buf;
struct pipe_surface *dst_surf = screen->get_tex_surface(
0.0f);
if (buf) {
- util_draw_vertex_buffer(exa->ctx, buf, 0,
+ util_draw_vertex_buffer(exa->pipe, buf, 0,
PIPE_PRIM_TRIANGLE_FAN,
4, /* verts */
2); /* attribs/vert */
if (!priv || !priv->tex)
return FALSE;
- if (exa->ctx->is_texture_referenced(exa->ctx, priv->tex, 0, 0) &
+ if (exa->pipe->is_texture_referenced(exa->pipe, priv->tex, 0, 0) &
PIPE_REFERENCED_FOR_WRITE)
- exa->ctx->flush(exa->ctx, 0, NULL);
+ exa->pipe->flush(exa->pipe, 0, NULL);
transfer = exa->scrn->get_tex_transfer(exa->scrn, priv->tex, 0, 0, 0,
PIPE_TRANSFER_READ, x, y, w, h);
if (priv->map_count++ == 0)
{
- if (exa->ctx->is_texture_referenced(exa->ctx, priv->tex, 0, 0) &
+ if (exa->pipe->is_texture_referenced(exa->pipe, priv->tex, 0, 0) &
PIPE_REFERENCED_FOR_WRITE)
- exa->ctx->flush(exa->ctx, 0, NULL);
+ exa->pipe->flush(exa->pipe, 0, NULL);
priv->map_transfer =
exa->scrn->get_tex_transfer(exa->scrn, priv->tex, 0, 0, 0,
if (alu != GXcopy)
return FALSE;
- if (!exa->ctx)
+ if (!exa->pipe)
return FALSE;
debug_printf(" ExaPrepareSolid(0x%x)\n", fg);
if (!priv->tex || !src_priv->tex)
return FALSE;
- if (!exa->ctx)
+ if (!exa->pipe)
return FALSE;
exa->copy.src = src_priv;
dst_surf = exa->scrn->get_tex_surface(exa->scrn, texture, 0, 0, 0,
PIPE_BUFFER_USAGE_GPU_WRITE);
src_surf = exa_gpu_surface(exa, priv);
- exa->ctx->surface_copy(exa->ctx, dst_surf, 0, 0, src_surf,
- 0, 0, min(width, texture->width[0]),
- min(height, texture->height[0]));
+ exa->pipe->surface_copy(exa->pipe, dst_surf, 0, 0, src_surf,
+ 0, 0, min(width, texture->width[0]),
+ min(height, texture->height[0]));
exa->scrn->tex_surface_destroy(dst_surf);
exa->scrn->tex_surface_destroy(src_surf);
} else if (pPixmap->devPrivate.ptr) {
cso_destroy_context(exa->cso);
}
- if (exa->ctx)
- exa->ctx->destroy(exa->ctx);
+ if (exa->pipe)
+ exa->pipe->destroy(exa->pipe);
exaDriverFini(pScrn->pScreen);
xfree(exa);
}
exa->scrn = ms->screen;
- exa->ctx = ms->api->create_context(ms->api, exa->scrn);
+ exa->pipe = ms->api->create_context(ms->api, exa->scrn);
/* Share context with DRI */
- ms->ctx = exa->ctx;
+ ms->ctx = exa->pipe;
- exa->cso = cso_create_context(exa->ctx);
+ exa->cso = cso_create_context(exa->pipe);
exa->shaders = xorg_shaders_create(exa);
xorg_exa_init_state(exa);
void xorg_exa_flush(struct exa_context *exa, uint pipeFlushFlags,
struct pipe_fence_handle **fence)
{
- exa->ctx->flush(exa->ctx, pipeFlushFlags, fence);
+ exa->pipe->flush(exa->pipe, pipeFlushFlags, fence);
}
void xorg_exa_finish(struct exa_context *exa)
xorg_exa_flush(exa, PIPE_FLUSH_RENDER_CACHE, &fence);
- exa->ctx->screen->fence_finish(exa->ctx->screen, fence, 0);
- exa->ctx->screen->fence_reference(exa->ctx->screen, &fence, NULL);
+ exa->pipe->screen->fence_finish(exa->pipe->screen, fence, 0);
+ exa->pipe->screen->fence_reference(exa->pipe->screen, &fence, NULL);
}
struct exa_context
{
ExaDriverPtr pExa;
- struct pipe_context *ctx;
+ struct pipe_context *pipe;
struct pipe_screen *scrn;
struct cso_context *cso;
struct xorg_shaders *shaders;
struct xorg_shader shader = {0};
void *vs, *fs;
- vs = shader_from_cache(sc->exa->ctx, PIPE_SHADER_VERTEX,
+ vs = shader_from_cache(sc->exa->pipe, PIPE_SHADER_VERTEX,
sc->vs_hash, vs_traits);
- fs = shader_from_cache(sc->exa->ctx, PIPE_SHADER_FRAGMENT,
+ fs = shader_from_cache(sc->exa->pipe, PIPE_SHADER_FRAGMENT,
sc->fs_hash, fs_traits);
debug_assert(vs && fs);