static const struct vertex_info *
-svga_vbuf_render_get_vertex_info( struct vbuf_render *render )
+svga_vbuf_render_get_vertex_info(struct vbuf_render *render)
{
struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
struct svga_context *svga = svga_render->svga;
static boolean
-svga_vbuf_render_allocate_vertices( struct vbuf_render *render,
- ushort vertex_size,
- ushort nr_vertices )
+svga_vbuf_render_allocate_vertices(struct vbuf_render *render,
+ ushort vertex_size,
+ ushort nr_vertices)
{
struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
struct svga_context *svga = svga_render->svga;
new_ibuf = new_vbuf = TRUE;
svga->swtnl.new_vbuf = FALSE;
- if (svga_render->vbuf_size < svga_render->vbuf_offset + svga_render->vbuf_used + size)
+ if (svga_render->vbuf_size
+ < svga_render->vbuf_offset + svga_render->vbuf_used + size)
new_vbuf = TRUE;
if (new_vbuf)
PIPE_BIND_VERTEX_BUFFER,
PIPE_USAGE_STREAM,
svga_render->vbuf_size);
- if(!svga_render->vbuf) {
+ if (!svga_render->vbuf) {
svga_context_flush(svga, NULL);
assert(!svga_render->vbuf);
svga_render->vbuf = pipe_buffer_create(screen,
return TRUE;
}
+
static void *
-svga_vbuf_render_map_vertices( struct vbuf_render *render )
+svga_vbuf_render_map_vertices(struct vbuf_render *render)
{
struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
struct svga_context *svga = svga_render->svga;
return retPtr;
}
+
static void
-svga_vbuf_render_unmap_vertices( struct vbuf_render *render,
- ushort min_index,
- ushort max_index )
+svga_vbuf_render_unmap_vertices(struct vbuf_render *render,
+ ushort min_index,
+ ushort max_index)
{
struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
struct svga_context *svga = svga_render->svga;
}
pipe_buffer_flush_mapped_range(&svga->pipe,
- svga_render->vbuf_transfer,
- offset, length);
+ svga_render->vbuf_transfer,
+ offset, length);
pipe_buffer_unmap(&svga->pipe, svga_render->vbuf_transfer);
svga_render->min_index = min_index;
svga_render->max_index = max_index;
SVGA_STATS_TIME_POP(svga_sws(svga));
}
+
static void
-svga_vbuf_render_set_primitive( struct vbuf_render *render,
- enum pipe_prim_type prim )
+svga_vbuf_render_set_primitive(struct vbuf_render *render,
+ enum pipe_prim_type prim)
{
struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
svga_render->prim = prim;
}
+
static void
-svga_vbuf_submit_state( struct svga_vbuf_render *svga_render )
+svga_vbuf_submit_state(struct svga_vbuf_render *svga_render)
{
struct svga_context *svga = svga_render->svga;
SVGA3dVertexDecl vdecl[PIPE_MAX_ATTRIBS];
svga_hwtnl_set_fillmode(svga->hwtnl, PIPE_POLYGON_MODE_FILL);
}
else {
- svga_hwtnl_set_flatshade( svga->hwtnl,
+ svga_hwtnl_set_flatshade(svga->hwtnl,
svga->curr.rast->templ.flatshade ||
svga->state.hw_draw.fs->uses_flat_interp,
- svga->curr.rast->templ.flatshade_first );
+ svga->curr.rast->templ.flatshade_first);
svga_hwtnl_set_fillmode(svga->hwtnl, svga->curr.rast->hw_fillmode);
}
SVGA_STATS_TIME_POP(svga_sws(svga));
}
+
static void
-svga_vbuf_render_draw_arrays( struct vbuf_render *render,
- unsigned start, uint nr )
+svga_vbuf_render_draw_arrays(struct vbuf_render *render,
+ unsigned start, uint nr)
{
struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
struct svga_context *svga = svga_render->svga;
- unsigned bias = (svga_render->vbuf_offset - svga_render->vdecl_offset) / svga_render->vertex_size;
+ unsigned bias = (svga_render->vbuf_offset - svga_render->vdecl_offset)
+ / svga_render->vertex_size;
enum pipe_error ret = PIPE_OK;
/* instancing will already have been resolved at this point by 'draw' */
const unsigned start_instance = 0;
* altered some of our state behind our backs. Testcase:
* redbook/polys.c
*/
- svga_update_state_retry( svga, SVGA_STATE_HW_DRAW );
+ svga_update_state_retry(svga, SVGA_STATE_HW_DRAW);
- ret = svga_hwtnl_draw_arrays(svga->hwtnl, svga_render->prim, start + bias, nr,
- start_instance, instance_count);
+ ret = svga_hwtnl_draw_arrays(svga->hwtnl, svga_render->prim, start + bias,
+ nr, start_instance, instance_count);
if (ret != PIPE_OK) {
svga_context_flush(svga, NULL);
ret = svga_hwtnl_draw_arrays(svga->hwtnl, svga_render->prim,
static void
-svga_vbuf_render_draw_elements( struct vbuf_render *render,
+svga_vbuf_render_draw_elements(struct vbuf_render *render,
const ushort *indices,
uint nr_indices)
{
struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
struct svga_context *svga = svga_render->svga;
struct pipe_screen *screen = svga->pipe.screen;
- int bias = (svga_render->vbuf_offset - svga_render->vdecl_offset) / svga_render->vertex_size;
+ int bias = (svga_render->vbuf_offset - svga_render->vdecl_offset)
+ / svga_render->vertex_size;
boolean ret;
size_t size = 2 * nr_indices;
/* instancing will already have been resolved at this point by 'draw' */
const unsigned start_instance = 0;
const unsigned instance_count = 1;
- assert(( svga_render->vbuf_offset - svga_render->vdecl_offset) % svga_render->vertex_size == 0);
-
+ assert((svga_render->vbuf_offset - svga_render->vdecl_offset)
+ % svga_render->vertex_size == 0);
+
SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_VBUFDRAWELEMENTS);
if (svga_render->ibuf_size < svga_render->ibuf_offset + size)
}
pipe_buffer_write_nooverlap(&svga->pipe, svga_render->ibuf,
- svga_render->ibuf_offset, 2 * nr_indices, indices);
+ svga_render->ibuf_offset, 2 * nr_indices,
+ indices);
/* off to hardware */
svga_vbuf_submit_state(svga_render);
* altered some of our state behind our backs. Testcase:
* redbook/polys.c
*/
- svga_update_state_retry( svga, SVGA_STATE_HW_DRAW );
+ svga_update_state_retry(svga, SVGA_STATE_HW_DRAW);
ret = svga_hwtnl_draw_range_elements(svga->hwtnl,
svga_render->ibuf,
svga_render->min_index,
svga_render->max_index,
svga_render->prim,
- svga_render->ibuf_offset / 2, nr_indices,
+ svga_render->ibuf_offset / 2,
+ nr_indices,
start_instance, instance_count);
- if(ret != PIPE_OK) {
+ if (ret != PIPE_OK) {
svga_context_flush(svga, NULL);
ret = svga_hwtnl_draw_range_elements(svga->hwtnl,
svga_render->ibuf,
static void
-svga_vbuf_render_release_vertices( struct vbuf_render *render )
+svga_vbuf_render_release_vertices(struct vbuf_render *render)
{
}
static void
-svga_vbuf_render_destroy( struct vbuf_render *render )
+svga_vbuf_render_destroy(struct vbuf_render *render)
{
struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
* Create a new primitive render.
*/
struct vbuf_render *
-svga_vbuf_render_create( struct svga_context *svga )
+svga_vbuf_render_create(struct svga_context *svga)
{
struct svga_vbuf_render *svga_render = CALLOC_STRUCT(svga_vbuf_render);