summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vega/renderer.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-05-11 16:38:13 +0200
committerMarek Olšák <[email protected]>2012-05-11 16:38:13 +0200
commitbb4c5d72d7c7cb1d9e7016e2c07c36875f30011a (patch)
tree153444ff535900f82ae63b5af8ccd09fb2f063af /src/gallium/state_trackers/vega/renderer.c
parent96956dc5076fc03b9290368ca90e3f3b870ee613 (diff)
parent8dd3e341b337ca2d22bcc0e7548a78a6c36ca77d (diff)
Merge branch 'gallium-userbuf'
Conflicts: src/gallium/docs/source/screen.rst src/gallium/drivers/nv50/nv50_state.c src/gallium/include/pipe/p_defines.h src/mesa/state_tracker/st_draw.c
Diffstat (limited to 'src/gallium/state_trackers/vega/renderer.c')
-rw-r--r--src/gallium/state_trackers/vega/renderer.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c
index add1eec0038..23ec14ab84c 100644
--- a/src/gallium/state_trackers/vega/renderer.c
+++ b/src/gallium/state_trackers/vega/renderer.c
@@ -179,7 +179,7 @@ static void renderer_set_mvp(struct renderer *renderer,
pipe_buffer_write(renderer->pipe, cbuf,
0, sizeof(consts), consts);
}
- renderer->pipe->set_constant_buffer(renderer->pipe,
+ pipe_set_constant_buffer(renderer->pipe,
PIPE_SHADER_VERTEX, 0, cbuf);
memcpy(cur, mvp, sizeof(*mvp));
@@ -478,7 +478,7 @@ static void renderer_set_custom_fs(struct renderer *renderer,
const_buffer_len);
pipe_buffer_write(renderer->pipe, cbuf, 0,
const_buffer_len, const_buffer);
- renderer->pipe->set_constant_buffer(renderer->pipe,
+ pipe_set_constant_buffer(renderer->pipe,
PIPE_SHADER_FRAGMENT, 0, cbuf);
renderer->fs_cbuf = cbuf;
@@ -566,20 +566,9 @@ static void renderer_quad_texcoord(struct renderer *r,
*/
static void renderer_quad_draw(struct renderer *r)
{
- struct pipe_resource *buf;
-
- buf = pipe_user_buffer_create(r->pipe->screen,
- r->vertices,
- sizeof(r->vertices),
- PIPE_BIND_VERTEX_BUFFER);
- if (buf) {
- util_draw_vertex_buffer(r->pipe, r->cso, buf, 0,
- PIPE_PRIM_TRIANGLE_FAN,
- Elements(r->vertices), /* verts */
- Elements(r->vertices[0])); /* attribs/vert */
-
- pipe_resource_reference(&buf, NULL);
- }
+ util_draw_user_vertex_buffer(r->cso, r->vertices, PIPE_PRIM_TRIANGLE_FAN,
+ Elements(r->vertices), /* verts */
+ Elements(r->vertices[0])); /* attribs/vert */
}
/**
@@ -1054,7 +1043,7 @@ void renderer_polygon_stencil(struct renderer *renderer,
cso_set_vertex_buffers(renderer->cso, 1, vbuf);
if (!renderer->u.polygon_stencil.manual_two_sides) {
- util_draw_arrays(renderer->pipe, mode, start, count);
+ cso_draw_arrays(renderer->cso, mode, start, count);
}
else {
struct pipe_rasterizer_state raster;
@@ -1069,7 +1058,7 @@ void renderer_polygon_stencil(struct renderer *renderer,
cso_set_rasterizer(renderer->cso, &raster);
cso_set_depth_stencil_alpha(renderer->cso, &dsa);
- util_draw_arrays(renderer->pipe, mode, start, count);
+ cso_draw_arrays(renderer->cso, mode, start, count);
/* back */
raster.cull_face = PIPE_FACE_FRONT;
@@ -1077,7 +1066,7 @@ void renderer_polygon_stencil(struct renderer *renderer,
cso_set_rasterizer(renderer->cso, &raster);
cso_set_depth_stencil_alpha(renderer->cso, &dsa);
- util_draw_arrays(renderer->pipe, mode, start, count);
+ cso_draw_arrays(renderer->cso, mode, start, count);
}
}