boolean new_vbuf = FALSE;
boolean new_ibuf = FALSE;
+ SVGA_STATS_TIME_PUSH(svga_sws(svga),
+ SVGA_STATS_TIME_VBUFRENDERALLOCVERT);
+
if (svga_render->vertex_size != vertex_size)
svga->swtnl.new_vdecl = TRUE;
svga_render->vertex_size = (size_t)vertex_size;
if (svga->swtnl.new_vdecl)
svga_render->vdecl_offset = svga_render->vbuf_offset;
+ SVGA_STATS_TIME_POP(svga_sws(svga));
+
return TRUE;
}
{
struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
struct svga_context *svga = svga_render->svga;
+ void * retPtr = NULL;
+
+ SVGA_STATS_TIME_PUSH(svga_sws(svga),
+ SVGA_STATS_TIME_VBUFRENDERMAPVERT);
if (svga_render->vbuf) {
char *ptr = (char*)pipe_buffer_map(&svga->pipe,
&svga_render->vbuf_transfer);
if (ptr) {
svga_render->vbuf_ptr = ptr;
- return ptr + svga_render->vbuf_offset;
+ retPtr = ptr + svga_render->vbuf_offset;
}
else {
svga_render->vbuf_ptr = NULL;
svga_render->vbuf_transfer = NULL;
- return NULL;
+ retPtr = NULL;
}
}
else {
/* we probably ran out of memory when allocating the vertex buffer */
- return NULL;
+ retPtr = NULL;
}
+
+ SVGA_STATS_TIME_POP(svga_sws(svga));
+ return retPtr;
}
static void
unsigned offset, length;
size_t used = svga_render->vertex_size * ((size_t)max_index + 1);
+ SVGA_STATS_TIME_PUSH(svga_sws(svga),
+ SVGA_STATS_TIME_VBUFRENDERUNMAPVERT);
+
offset = svga_render->vbuf_offset + svga_render->vertex_size * min_index;
length = svga_render->vertex_size * (max_index + 1 - min_index);
svga_render->min_index = min_index;
svga_render->max_index = max_index;
svga_render->vbuf_used = MAX2(svga_render->vbuf_used, used);
+
+ SVGA_STATS_TIME_POP(svga_sws(svga));
}
static void
if (!svga->swtnl.new_vdecl)
return;
+ SVGA_STATS_TIME_PUSH(svga_sws(svga),
+ SVGA_STATS_TIME_VBUFSUBMITSTATE);
+
memcpy(vdecl, svga_render->vdecl, sizeof(vdecl));
/* flush the hw state */
}
svga->swtnl.new_vdecl = FALSE;
+ SVGA_STATS_TIME_POP(svga_sws(svga));
}
static void
const unsigned start_instance = 0;
const unsigned instance_count = 1;
+ SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_VBUFDRAWARRAYS);
+
/* off to hardware */
svga_vbuf_submit_state(svga_render);
svga->swtnl.new_vbuf = TRUE;
assert(ret == PIPE_OK);
}
+ SVGA_STATS_TIME_POP(svga_sws(svga));
}
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_resource_reference(&svga_render->ibuf, NULL);
svga->swtnl.new_vbuf = TRUE;
assert(ret == PIPE_OK);
}
-
svga_render->ibuf_offset += size;
+
+ SVGA_STATS_TIME_POP(svga_sws(svga));
}