Add additional profiler checkpoints

This commit is contained in:
Luke Benstead 2019-03-25 16:06:08 +00:00
parent 70feea6c6f
commit 4355d0f224
2 changed files with 26 additions and 1 deletions

View File

@ -849,11 +849,18 @@ static void generate(SubmissionTarget* target, const GLenum mode, const GLsizei
const Vertex* end;
if(!indices) {
profiler_push(__func__);
_readPositionData(first, count, _glSubmissionTargetStart(target));
profiler_checkpoint("positions");
_readDiffuseData(first, count, _glSubmissionTargetStart(target));
profiler_checkpoint("diffuse");
if(doTexture) _readUVData(first, count, _glSubmissionTargetStart(target));
if(doLighting) _readNormalData(first, count, target);
if(doTexture && doMultitexture) _readSTData(first, count, target);
profiler_checkpoint("others");
it = _glSubmissionTargetStart(target);
end = _glSubmissionTargetEnd(target);
@ -862,6 +869,8 @@ static void generate(SubmissionTarget* target, const GLenum mode, const GLsizei
(it++)->flags = PVR_CMD_VERTEX;
}
profiler_checkpoint("flags");
// Drawing arrays
switch(mode) {
case GL_TRIANGLES:
@ -879,6 +888,9 @@ static void generate(SubmissionTarget* target, const GLenum mode, const GLsizei
default:
assert(0 && "Not Implemented");
}
profiler_checkpoint("quads");
profiler_pop();
} else {
const IndexParseFunc indexFunc = _calcParseIndexFunc(type);
it = _glSubmissionTargetStart(target);

View File

@ -9,6 +9,7 @@
#include "../include/gl.h"
#include "../include/glext.h"
#include "profiler.h"
#include "private.h"
@ -174,6 +175,8 @@ void APIENTRY glNormal3fv(const GLfloat* v) {
}
void APIENTRY glEnd() {
profiler_push(__func__);
IMMEDIATE_MODE_ACTIVE = GL_FALSE;
GLboolean vertexArrayEnabled, colorArrayEnabled, normalArrayEnabled;
@ -189,6 +192,8 @@ void APIENTRY glEnd() {
AttribPointer uvptr = *_glGetUVAttribPointer();
AttribPointer stptr = *_glGetSTAttribPointer();
profiler_checkpoint("prep");
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
@ -210,14 +215,20 @@ void APIENTRY glEnd() {
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, ST_COORDS.data);
profiler_checkpoint("client_state");
glDrawArrays(ACTIVE_POLYGON_MODE, 0, VERTICES.size / 3);
profiler_checkpoint("draw_arrays");
aligned_vector_clear(&VERTICES);
aligned_vector_clear(&COLOURS);
aligned_vector_clear(&UV_COORDS);
aligned_vector_clear(&ST_COORDS);
aligned_vector_clear(&NORMALS);
profiler_checkpoint("clear");
*_glGetVertexAttribPointer() = vptr;
*_glGetDiffuseAttribPointer() = dptr;
*_glGetNormalAttribPointer() = nptr;
@ -248,6 +259,8 @@ void APIENTRY glEnd() {
glClientActiveTextureARB((GLuint) activeTexture);
profiler_checkpoint("restore");
profiler_pop();
}
void APIENTRY glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) {