Update DDL test harness to better match OOP-R
OOP-R, on the gpu thread, creates the DDL, pre-compiles its shaders, draws it, flushes and then deletes the DDL. This process triggered a bug (cf. https://skia-review.googlesource.com/c/skia/+/292818 and crbug.com/1056730). Prior to this CL all the programs were compiled and only at the end was any work flushed - thus it was likely that the bound program would be reset to the correct value when rendering. With this CL, the addition of the flush right before the DDL deletion, makes it more likely that the wrong program will be bound when rendering begins. Change-Id: I60479bd429e132d8652bbffde6c8b71094be6225 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292257 Reviewed-by: Adlai Holler <adlai@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
parent
59d299ba3f
commit
5dbcca5634
@ -1703,7 +1703,8 @@ Result GPUDDLSink::ddlDraw(const Src& src,
|
||||
dstSurface->draw(ddl);
|
||||
});
|
||||
|
||||
// This should be the only explicit flush for the entire DDL draw
|
||||
// This should be the only explicit flush for the entire DDL draw.
|
||||
// TODO: remove the flushes in do_gpu_stuff
|
||||
gpuTaskGroup->add([gpuThreadCtx]() {
|
||||
// We need to ensure all the GPU work is finished so
|
||||
// the following 'deleteAllFromGPU' call will work
|
||||
|
@ -287,6 +287,11 @@ static void do_gpu_stuff(GrContext* context, DDLTileHelper::TileData* tile) {
|
||||
tile->precompile(context);
|
||||
|
||||
tile->draw(context);
|
||||
|
||||
// TODO: remove this flush once DDLs are reffed by the drawing manager
|
||||
context->flushAndSubmit();
|
||||
|
||||
tile->dropDDL();
|
||||
}
|
||||
|
||||
// We expect to have more than one recording thread but just one gpu thread
|
||||
@ -315,6 +320,7 @@ void DDLTileHelper::kickOffThreadedWork(SkTaskGroup* recordingTaskGroup,
|
||||
recordingTaskGroup->add([this] { this->createComposeDDL(); });
|
||||
}
|
||||
|
||||
// Only called from ViaDDL
|
||||
void DDLTileHelper::precompileAndDrawAllTiles(GrContext* context) {
|
||||
for (int i = 0; i < this->numTiles(); ++i) {
|
||||
fTiles[i].precompile(context);
|
||||
@ -322,6 +328,7 @@ void DDLTileHelper::precompileAndDrawAllTiles(GrContext* context) {
|
||||
}
|
||||
}
|
||||
|
||||
// Only called from skpbench
|
||||
void DDLTileHelper::interleaveDDLCreationAndDraw(GrContext* context) {
|
||||
for (int i = 0; i < this->numTiles(); ++i) {
|
||||
fTiles[i].createDDL();
|
||||
@ -329,6 +336,7 @@ void DDLTileHelper::interleaveDDLCreationAndDraw(GrContext* context) {
|
||||
}
|
||||
}
|
||||
|
||||
// Only called from skpbench
|
||||
void DDLTileHelper::drawAllTilesDirectly(GrContext* context) {
|
||||
for (int i = 0; i < this->numTiles(); ++i) {
|
||||
fTiles[i].drawSKPDirectly(context);
|
||||
|
@ -44,6 +44,8 @@ public:
|
||||
// Create the DDL for this tile (i.e., fill in 'fDisplayList').
|
||||
void createDDL();
|
||||
|
||||
void dropDDL() { fDisplayList.reset(); }
|
||||
|
||||
// Precompile all the programs required to draw this tile's DDL
|
||||
void precompile(GrContext*);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user