diff options
author | 2016-07-29 08:14:20 -0700 | |
---|---|---|
committer | 2016-07-29 08:14:20 -0700 | |
commit | e0d362929d6569e8737d80dead791c640390e819 (patch) | |
tree | 3943140ef518a4fc3962672a74039cb776f1ef48 /include/gpu | |
parent | 0d9990f052670a8af29e1e775c414810f8fc6e86 (diff) |
Add test configs for instanced rendering
Adds the following configs and enables them on select bots:
glinst, glinst4, glinstdit4, glinst16, glinstdit16,
esinst, esinst4, esinstdit4
Makes general changes to GrContextOptions, GrCaps, etc. to facilitate
this.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2182783004
Review-Url: https://codereview.chromium.org/2182783004
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrCaps.h | 18 | ||||
-rw-r--r-- | include/gpu/GrContextOptions.h | 7 |
2 files changed, 24 insertions, 1 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h index 5086d79be9..0f39a5e485 100644 --- a/include/gpu/GrCaps.h +++ b/include/gpu/GrCaps.h @@ -174,6 +174,21 @@ public: bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; } /** + * Indicates the level of support for gr_instanced::* functionality. A higher level includes + * all functionality from the levels below it. + */ + enum class InstancedSupport { + kNone, + kBasic, + kMultisampled, + kMixedSampled + }; + + InstancedSupport instancedSupport() const { return fInstancedSupport; } + + bool avoidInstancedDrawsToFPTargets() const { return fAvoidInstancedDrawsToFPTargets; } + + /** * Indicates the capabilities of the fixed function blend unit. */ enum BlendEquationSupport { @@ -307,12 +322,15 @@ protected: bool fUseDrawInsteadOfClear : 1; bool fUseDrawInsteadOfPartialRenderTargetWrite : 1; bool fUseDrawInsteadOfAllRenderTargetWrites : 1; + bool fAvoidInstancedDrawsToFPTargets : 1; // ANGLE workaround bool fPreferVRAMUseOverFlushes : 1; bool fSampleShadingSupport : 1; + InstancedSupport fInstancedSupport; + BlendEquationSupport fBlendEquationSupport; uint32_t fAdvBlendEqBlacklist; GR_STATIC_ASSERT(kLast_GrBlendEquation < 32); diff --git a/include/gpu/GrContextOptions.h b/include/gpu/GrContextOptions.h index d5923a3280..b274895a37 100644 --- a/include/gpu/GrContextOptions.h +++ b/include/gpu/GrContextOptions.h @@ -24,7 +24,8 @@ struct GrContextOptions { , fMaxBatchLookback(-1) , fMaxBatchLookahead(-1) , fUseShaderSwizzling(false) - , fDoManualMipmapping(false) {} + , fDoManualMipmapping(false) + , fEnableInstancedRendering(false) {} // Suppress prints for the GrContext. bool fSuppressPrints; @@ -73,6 +74,10 @@ struct GrContextOptions { the driver's implementation (glGenerateMipmap) contains bugs. This requires mipmap level and LOD control (ie desktop or ES3). */ bool fDoManualMipmapping; + + /** Enable instanced rendering as long as all required functionality is supported by the HW. + Instanced rendering is still experimental at this point and disabled by default. */ + bool fEnableInstancedRendering; }; #endif |