Disable the LoggingDeadline. Uncomment if you want to use it.

This commit is contained in:
Henrik Rydgard 2013-01-12 11:33:04 +01:00
parent 6a3dd792a5
commit 6c9d28205d
2 changed files with 13 additions and 14 deletions

View File

@ -45,7 +45,7 @@ const GLuint glprim[8] = {
};
TransformDrawEngine::TransformDrawEngine()
: numVerts(0),
: collectedVerts(0),
lastVType(-1),
curVbo_(0),
shaderManager_(0) {
@ -615,9 +615,9 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
bool useVBO = g_Config.bUseVBO;
if (useVBO) {
char title[64];
sprintf(title, "upload %i verts for sw", indexGen.VertexCount());
LoggingDeadline deadline(title, 5);
//char title[64];
//sprintf(title, "upload %i verts for sw", indexGen.VertexCount());
//LoggingDeadline deadline(title, 5);
glBindBuffer(GL_ARRAY_BUFFER, vbo_[curVbo_]);
glBufferData(GL_ARRAY_BUFFER, vertexSize * numTrans, drawBuffer, GL_DYNAMIC_DRAW);
drawBuffer = 0; // so that the calls use offsets instead.
@ -662,7 +662,7 @@ void TransformDrawEngine::SubmitPrim(void *verts, void *inds, int prim, int vert
gpuStats.numDrawCalls++;
gpuStats.numVertsTransformed += vertexCount;
indexGen.SetIndex(numVerts);
indexGen.SetIndex(collectedVerts);
int indexLowerBound, indexUpperBound;
// If vtype has changed, setup the vertex decoder.
// TODO: Simply cache the setup decoders instead.
@ -672,8 +672,8 @@ void TransformDrawEngine::SubmitPrim(void *verts, void *inds, int prim, int vert
}
// Decode the verts and apply morphing
dec.DecodeVerts(decoded + numVerts * (int)dec.GetDecVtxFmt().stride, verts, inds, prim, vertexCount, &indexLowerBound, &indexUpperBound);
numVerts += indexUpperBound - indexLowerBound + 1;
dec.DecodeVerts(decoded + collectedVerts * (int)dec.GetDecVtxFmt().stride, verts, inds, prim, vertexCount, &indexLowerBound, &indexUpperBound);
collectedVerts += indexUpperBound - indexLowerBound + 1;
if (bytesRead)
*bytesRead = vertexCount * dec.VertexSize();
@ -747,19 +747,18 @@ void TransformDrawEngine::Flush() {
LinkedShader *program = shaderManager_->ApplyShader(prim);
DEBUG_LOG(G3D, "Flush prim %i! %i verts in one go", prim, numVerts);
DEBUG_LOG(G3D, "Flush prim %i! %i verts in one go", prim, collectedVerts);
bool useVBO = g_Config.bUseVBO;
if (CanUseHardwareTransform(prim)) {
char title[64];
sprintf(title, "upload %i verts for hw", indexGen.VertexCount());
LoggingDeadline deadline(title, 5);
if (useVBO) {
//char title[64];
//sprintf(title, "upload %i verts for hw", indexGen.VertexCount());
//LoggingDeadline deadline(title, 5);
glBindBuffer(GL_ARRAY_BUFFER, vbo_[curVbo_]);
glBufferData(GL_ARRAY_BUFFER, dec.GetDecVtxFmt().stride * indexGen.MaxIndex(), decoded, GL_DYNAMIC_DRAW);
}
deadline.End();
SetupDecFmtForDraw(program, dec.GetDecVtxFmt(), useVBO ? 0 : decoded);
// If there's only been one primitive type, and it's either TRIANGLES, LINES or POINTS,
// there is no need for the index buffer we built. We can then use glDrawArrays instead
@ -791,5 +790,5 @@ void TransformDrawEngine::Flush() {
}
indexGen.Reset();
numVerts = 0;
collectedVerts = 0;
}

View File

@ -47,7 +47,7 @@ private:
// Vertex collector state
IndexGenerator indexGen;
int numVerts;
int collectedVerts;
// Vertex collector buffers
VertexDecoder dec;