diff options
author | Chia-I Wu <[email protected]> | 2010-11-28 03:39:18 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-12-01 11:23:50 +0800 |
commit | ace4539e88f6ef90d8e9fd2f1543eca0ae854b82 (patch) | |
tree | 3249281987fcb8fa69f77ae44c60098b57cb3f05 /src/gallium/state_trackers/vega/renderer.c | |
parent | 635fe3e1927f812a69a68ec3e03d9ab7a2c3a5d9 (diff) |
st/vega: Clean up vg_context fields and functions.
Diffstat (limited to 'src/gallium/state_trackers/vega/renderer.c')
-rw-r--r-- | src/gallium/state_trackers/vega/renderer.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c index 2c5b5df8800..c0d69ee2ba7 100644 --- a/src/gallium/state_trackers/vega/renderer.c +++ b/src/gallium/state_trackers/vega/renderer.c @@ -89,6 +89,7 @@ struct renderer { struct pipe_resource *vs_const_buffer; + struct pipe_vertex_element velems[2]; VGfloat vertices[4][2][4]; void *cached_vs[NUM_RENDERER_VS]; @@ -489,7 +490,7 @@ static void renderer_quad_draw(struct renderer *r) sizeof(r->vertices), PIPE_BIND_VERTEX_BUFFER); if (buf) { - cso_set_vertex_elements(r->cso, 2, r->owner->velems); + cso_set_vertex_elements(r->cso, 2, r->velems); util_draw_vertex_buffer(r->pipe, buf, 0, PIPE_PRIM_TRIANGLE_FAN, Elements(r->vertices), /* verts */ @@ -1091,6 +1092,13 @@ struct renderer * renderer_create(struct vg_context *owner) for (i = 0; i < 4; i++) renderer->vertices[i][0][3] = 1.0f; /* w */ + for (i = 0; i < 2; i++) { + renderer->velems[i].src_offset = i * 4 * sizeof(float); + renderer->velems[i].instance_divisor = 0; + renderer->velems[i].vertex_buffer_index = 0; + renderer->velems[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; + } + renderer->state = RENDERER_STATE_INIT; return renderer; |