diff options
author | joshualitt <joshualitt@chromium.org> | 2015-08-07 08:11:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-07 08:11:19 -0700 |
commit | ca1f07eb5f976a39845721b434b780c5a705f3d9 (patch) | |
tree | 363aaeb3e04ba3d1fca11a8597cc2d9daaf3b41a /src/gpu/GrReorderCommandBuilder.cpp | |
parent | f1595185e3855580b881c3d9c05344695d019030 (diff) |
Add Batch logging
BUG=skia:
Review URL: https://codereview.chromium.org/1276913002
Diffstat (limited to 'src/gpu/GrReorderCommandBuilder.cpp')
-rw-r--r-- | src/gpu/GrReorderCommandBuilder.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/gpu/GrReorderCommandBuilder.cpp b/src/gpu/GrReorderCommandBuilder.cpp index 90953b047b..c7b5f97da4 100644 --- a/src/gpu/GrReorderCommandBuilder.cpp +++ b/src/gpu/GrReorderCommandBuilder.cpp @@ -25,6 +25,26 @@ GrTargetCommands::Cmd* GrReorderCommandBuilder::recordDrawBatch(State* state, Gr int i = 0; batch->setPipeline(state->getPipeline()); GrRenderTarget* rt = state->getPipeline()->getRenderTarget(); + + GrBATCH_INFO("Re-Recording (%s, B%u)\n" + "\tRenderTarget %p\n" + "\tBounds (%f, %f, %f, %f)\n", + batch->name(), + batch->uniqueID(), rt, + batch->bounds().fLeft, batch->bounds().fRight, + batch->bounds().fTop, batch->bounds().fBottom); +#if GR_BATCH_SPEW + SkDebugf("\tColorStages:\n"); + for (int i = 0; i < state->getPipeline()->numColorFragmentStages(); i++) { + SkDebugf("\t\t%s\n", state->getPipeline()->getColorStage(i).processor()->name()); + } + SkDebugf("\tCoverageStages:\n"); + for (int i = 0; i < state->getPipeline()->numCoverageFragmentStages(); i++) { + SkDebugf("\t\t%s\n", state->getPipeline()->getCoverageStage(i).processor()->name()); + } + SkDebugf("\tXP: %s\n", state->getPipeline()->getXferProcessor()->name()); +#endif + GrBATCH_INFO("\tOutcome:\n"); if (!this->cmdBuffer()->empty()) { GrTargetCommands::CmdBuffer::ReverseIter reverseIter(*this->cmdBuffer()); @@ -33,14 +53,20 @@ GrTargetCommands::Cmd* GrReorderCommandBuilder::recordDrawBatch(State* state, Gr DrawBatch* previous = static_cast<DrawBatch*>(reverseIter.get()); if (previous->fBatch->pipeline()->getRenderTarget() != rt) { + GrBATCH_INFO("\t\tBreaking because of (%s, B%u) Rendertarget\n", + previous->fBatch->name(), previous->fBatch->uniqueID()); break; } // We cannot continue to search backwards if the render target changes if (previous->fBatch->combineIfPossible(batch)) { + GrBATCH_INFO("\t\tCombining with (%s, B%u)\n", + previous->fBatch->name(), previous->fBatch->uniqueID()); return NULL; } if (intersect(previous->fBatch->bounds(), batch->bounds())) { + GrBATCH_INFO("\t\tIntersects with (%s, B%u)\n", + previous->fBatch->name(), previous->fBatch->uniqueID()); break; } } else if (Cmd::kClear_CmdType == reverseIter->type()) { @@ -48,20 +74,35 @@ GrTargetCommands::Cmd* GrReorderCommandBuilder::recordDrawBatch(State* state, Gr // We cannot continue to search backwards if the render target changes if (previous->renderTarget() != rt) { + GrBATCH_INFO("\t\tBreaking because of Clear's Rendertarget change\n"); break; } // We set the color to illegal if we are doing a discard. if (previous->fColor == GrColor_ILLEGAL || intersect(batch->bounds(), previous->fRect)) { + GrBATCH_INFO("\t\tBreaking because of Clear intersection\n"); break; } } else { + GrBATCH_INFO("\t\tBreaking because of other %08x\n", reverseIter->type()); // TODO temporary until we can navigate the other types of commands break; } } while (reverseIter.previous() && ++i < kMaxLookback); +#if GR_BATCH_SPEW + if (!reverseIter.get()) { + GrBATCH_INFO("\t\tNo more commands to try and batch with\n"); + } else if (i >= kMaxLookback) { + GrBATCH_INFO("\t\tReached max lookback %d\n", i); + } +#endif + } +#if GR_BATCH_SPEW + else { + GrBATCH_INFO("\t\tBreaking because empty command buffer\n"); } +#endif return GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), DrawBatch, (state, batch, this->batchTarget())); |