From e0d362929d6569e8737d80dead791c640390e819 Mon Sep 17 00:00:00 2001 From: csmartdalton Date: Fri, 29 Jul 2016 08:14:20 -0700 Subject: 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 --- include/gpu/GrCaps.h | 18 ++++++++++++++++++ include/gpu/GrContextOptions.h | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'include/gpu') 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 @@ -173,6 +173,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. */ @@ -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 -- cgit v1.2.3