diff options
author | Robert Phillips <robertphillips@google.com> | 2018-02-07 17:08:21 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-08 12:36:29 +0000 |
commit | 4150eea6c49ecec882a8d3e1c61d6a25fcd1e905 (patch) | |
tree | 21b7089d6745f769be88f8f3d9a127d521ff48be /include | |
parent | 1f1bb9c0b8d5f50ac74716e6961a6c92f1d373d8 (diff) |
Move control of explicit GPU resource allocation to GrContextOptions
Change-Id: Ic284acc79bab5936f0007d5ae5fb1e7a9929e2af
Reviewed-on: https://skia-review.googlesource.com/104880
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrContextOptions.h | 13 | ||||
-rw-r--r-- | include/private/GrOpList.h | 41 |
2 files changed, 28 insertions, 26 deletions
diff --git a/include/gpu/GrContextOptions.h b/include/gpu/GrContextOptions.h index 492a2d9b26..0cf4553ac9 100644 --- a/include/gpu/GrContextOptions.h +++ b/include/gpu/GrContextOptions.h @@ -141,6 +141,19 @@ struct GrContextOptions { Enable fUseDrawInsteadOfGLClear = Enable::kDefault; /** + * Allow Ganesh to explicitly allocate resources at flush time rather than incrementally while + * drawing. This will eventually just be the way it is but, for now, it is optional. + */ + bool fExplicitlyAllocateGPUResources = false; + + /** + * Allow Ganesh to sort the opLists prior to allocating resources. This is an optional + * behavior that is only relevant when 'fExplicitlyAllocateGPUResources' is enabled. + * Eventually this will just be what is done and will not be optional. + */ + bool fSortRenderTargets = false; + + /** * Disables correctness workarounds that are enabled for particular GPUs, OSes, or drivers. * This does not affect code path choices that are made for perfomance reasons nor does it * override other GrContextOption settings. diff --git a/include/private/GrOpList.h b/include/private/GrOpList.h index c9abd6d4e5..f183081bde 100644 --- a/include/private/GrOpList.h +++ b/include/private/GrOpList.h @@ -14,17 +14,6 @@ #include "SkRefCnt.h" #include "SkTDArray.h" - -// Turn on/off the explicit distribution of GPU resources at flush time -#ifndef SK_DISABLE_EXPLICIT_GPU_RESOURCE_ALLOCATION - #define SK_DISABLE_EXPLICIT_GPU_RESOURCE_ALLOCATION -#endif - -// Turn on/off the sorting of opLists at flush time -#ifndef SK_DISABLE_RENDER_TARGET_SORTING - #define SK_DISABLE_RENDER_TARGET_SORTING -#endif - class GrAuditTrail; class GrCaps; class GrOpFlushState; @@ -111,7 +100,7 @@ public: void setStencilLoadOp(GrLoadOp loadOp) { fStencilLoadOp = loadOp; } protected: - SkDEBUGCODE(bool isInstantiated() const;) + bool isInstantiated() const; GrSurfaceProxyRef fTarget; GrAuditTrail* fAuditTrail; @@ -154,26 +143,26 @@ private: } struct TopoSortTraits { - static void Output(GrOpList* dt, int /* index */) { - dt->setFlag(GrOpList::kWasOutput_Flag); + static void Output(GrOpList* opList, int /* index */) { + opList->setFlag(GrOpList::kWasOutput_Flag); } - static bool WasOutput(const GrOpList* dt) { - return dt->isSetFlag(GrOpList::kWasOutput_Flag); + static bool WasOutput(const GrOpList* opList) { + return opList->isSetFlag(GrOpList::kWasOutput_Flag); } - static void SetTempMark(GrOpList* dt) { - dt->setFlag(GrOpList::kTempMark_Flag); + static void SetTempMark(GrOpList* opList) { + opList->setFlag(GrOpList::kTempMark_Flag); } - static void ResetTempMark(GrOpList* dt) { - dt->resetFlag(GrOpList::kTempMark_Flag); + static void ResetTempMark(GrOpList* opList) { + opList->resetFlag(GrOpList::kTempMark_Flag); } - static bool IsTempMarked(const GrOpList* dt) { - return dt->isSetFlag(GrOpList::kTempMark_Flag); + static bool IsTempMarked(const GrOpList* opList) { + return opList->isSetFlag(GrOpList::kTempMark_Flag); } - static int NumDependencies(const GrOpList* dt) { - return dt->fDependencies.count(); + static int NumDependencies(const GrOpList* opList) { + return opList->fDependencies.count(); } - static GrOpList* Dependency(GrOpList* dt, int index) { - return dt->fDependencies[index]; + static GrOpList* Dependency(GrOpList* opList, int index) { + return opList->fDependencies[index]; } }; |