swc->last_command = cmd;
+ swc->num_commands++;
+
return &header[1];
}
swc->hints |= SVGA_HINT_FLAG_CAN_PRE_FLUSH;
+ swc->num_draw_commands++;
+
return PIPE_OK;
}
swc->hints |= SVGA_HINT_FLAG_CAN_PRE_FLUSH;
swc->commit(swc);
+ swc->num_draw_commands++;
return PIPE_OK;
}
swc->hints |= SVGA_HINT_FLAG_CAN_PRE_FLUSH;
swc->commit(swc);
+ swc->num_draw_commands++;
return PIPE_OK;
}
swc->hints |= SVGA_HINT_FLAG_CAN_PRE_FLUSH;
swc->commit(swc);
+ swc->num_draw_commands++;
return PIPE_OK;
}
swc->hints |= SVGA_HINT_FLAG_CAN_PRE_FLUSH;
swc->commit(swc);
+ swc->num_draw_commands++;
return PIPE_OK;
}
swc->hints |= SVGA_HINT_FLAG_CAN_PRE_FLUSH;
swc->commit(swc);
+ swc->num_draw_commands++;
return PIPE_OK;
}
SVGA_QUERY_NUM_SURFACE_VIEWS,
SVGA_QUERY_NUM_GENERATE_MIPMAP,
SVGA_QUERY_NUM_FAILED_ALLOCATIONS,
+ SVGA_QUERY_NUM_COMMANDS_PER_DRAW,
/*SVGA_QUERY_MAX has to be last because it is size of an array*/
SVGA_QUERY_MAX
case SVGA_QUERY_NUM_CONST_BUF_UPDATES:
case SVGA_QUERY_NUM_CONST_UPDATES:
case SVGA_QUERY_NUM_FAILED_ALLOCATIONS:
+ case SVGA_QUERY_NUM_COMMANDS_PER_DRAW:
break;
case SVGA_QUERY_FLUSH_TIME:
case SVGA_QUERY_MAP_BUFFER_TIME:
case SVGA_QUERY_NUM_CONST_BUF_UPDATES:
case SVGA_QUERY_NUM_CONST_UPDATES:
case SVGA_QUERY_NUM_FAILED_ALLOCATIONS:
+ case SVGA_QUERY_NUM_COMMANDS_PER_DRAW:
/* nothing */
break;
default:
case SVGA_QUERY_NUM_SURFACE_VIEWS:
case SVGA_QUERY_NUM_GENERATE_MIPMAP:
case SVGA_QUERY_NUM_FAILED_ALLOCATIONS:
+ case SVGA_QUERY_NUM_COMMANDS_PER_DRAW:
/* nothing */
break;
default:
case SVGA_QUERY_NUM_SURFACE_VIEWS:
case SVGA_QUERY_NUM_GENERATE_MIPMAP:
case SVGA_QUERY_NUM_FAILED_ALLOCATIONS:
+ case SVGA_QUERY_NUM_COMMANDS_PER_DRAW:
/* nothing */
break;
default:
case SVGA_QUERY_NUM_FAILED_ALLOCATIONS:
vresult->u64 = svgascreen->hud.num_failed_allocations;
break;
+ case SVGA_QUERY_NUM_COMMANDS_PER_DRAW:
+ vresult->f = (float) svga->swc->num_commands
+ / (float) svga->swc->num_draw_commands;
+ break;
default:
assert(!"unexpected query type in svga_get_query_result");
}
PIPE_DRIVER_QUERY_TYPE_UINT64),
QUERY("num-failed-allocations", SVGA_QUERY_NUM_FAILED_ALLOCATIONS,
PIPE_DRIVER_QUERY_TYPE_UINT64),
+ QUERY("num-commands-per-draw", SVGA_QUERY_NUM_COMMANDS_PER_DRAW,
+ PIPE_DRIVER_QUERY_TYPE_FLOAT),
};
#undef QUERY
/** The more recent command issued to command buffer */
SVGAFifo3dCmdId last_command;
+
+ /** For HUD queries */
+ uint64_t num_commands;
+ uint64_t num_draw_commands;
};