#include "util/u_memory.h"
#include "util/u_bitmask.h"
#include "util/u_upload_mgr.h"
+#include "os/os_time.h"
#include "svga_context.h"
#include "svga_screen.h"
unsigned shader, i;
/* free any alternate rasterizer states used for point sprite */
- for (i = 0; i < Elements(svga->rasterizer_no_cull); i++) {
+ for (i = 0; i < ARRAY_SIZE(svga->rasterizer_no_cull); i++) {
if (svga->rasterizer_no_cull[i]) {
pipe->delete_rasterizer_state(pipe, svga->rasterizer_no_cull[i]);
}
pipe_resource_reference(&svga->polygon_stipple.texture, NULL);
/* free HW constant buffers */
- for (shader = 0; shader < Elements(svga->state.hw_draw.constbuf); shader++) {
+ for (shader = 0; shader < ARRAY_SIZE(svga->state.hw_draw.constbuf); shader++) {
pipe_resource_reference(&svga->state.hw_draw.constbuf[shader], NULL);
}
/* free user's constant buffers */
for (shader = 0; shader < PIPE_SHADER_TYPES; ++shader) {
- for (i = 0; i < Elements(svga->curr.constbufs[shader]); ++i) {
+ for (i = 0; i < ARRAY_SIZE(svga->curr.constbufs[shader]); ++i) {
pipe_resource_reference(&svga->curr.constbufs[shader][i].buffer, NULL);
}
}
svga->const0_upload = u_upload_create(&svga->pipe,
CONST0_UPLOAD_DEFAULT_SIZE,
- CONST0_UPLOAD_ALIGNMENT,
- PIPE_BIND_CONSTANT_BUFFER);
+ PIPE_BIND_CONSTANT_BUFFER,
+ PIPE_USAGE_STREAM);
if (!svga->const0_upload)
goto cleanup;
sizeof(svga->state.hw_draw.default_constbuf_size));
memset(svga->state.hw_draw.enabled_constbufs, 0,
sizeof(svga->state.hw_draw.enabled_constbufs));
+ svga->state.hw_draw.ib = NULL;
/* Create a no-operation blend state which we will bind whenever the
* requested blend state is impossible (e.g. due to having an integer
{
struct svga_screen *svgascreen = svga_screen(svga->pipe.screen);
struct pipe_fence_handle *fence = NULL;
+ uint64_t t0;
svga->curr.nr_fbs = 0;
*/
svga_context_flush_buffers(svga);
+ svga->hud.command_buffer_size +=
+ svga->swc->get_command_buffer_size(svga->swc);
+
/* Flush pending commands to hardware:
*/
+ t0 = os_time_get();
svga->swc->flush(svga->swc, &fence);
+ svga->hud.flush_time += (os_time_get() - t0);
svga->hud.num_flushes++;