Add control of manual mipmapping to GrContextOptions
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2054623003 Committed: https://skia.googlesource.com/skia/+/97e398d98928f9497063594ebe633efe2d0f4968 Review-Url: https://codereview.chromium.org/2054623003
This commit is contained in:
parent
7e73108a37
commit
9a3fbf7e55
@ -23,7 +23,8 @@ struct GrContextOptions {
|
||||
, fDrawBatchBounds(false)
|
||||
, fMaxBatchLookback(-1)
|
||||
, fMaxBatchLookahead(-1)
|
||||
, fUseShaderSwizzling(false) {}
|
||||
, fUseShaderSwizzling(false)
|
||||
, fDoManualMipmapping(false) {}
|
||||
|
||||
// Suppress prints for the GrContext.
|
||||
bool fSuppressPrints;
|
||||
@ -67,6 +68,11 @@ struct GrContextOptions {
|
||||
/** Force us to do all swizzling manually in the shader and don't rely on extensions to do
|
||||
swizzling. */
|
||||
bool fUseShaderSwizzling;
|
||||
|
||||
/** Construct mipmaps manually, via repeated downsampling draw-calls. This is used when
|
||||
the driver's implementation (glGenerateMipmap) contains bugs. This requires mipmap
|
||||
level and LOD control (ie desktop or ES3). */
|
||||
bool fDoManualMipmapping;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -551,7 +551,8 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
|
||||
// glGenerateMipmap. Our implementation requires mip-level sampling control. Additionally,
|
||||
// it can be much slower (especially on mobile GPUs), so we opt-in only when necessary:
|
||||
if (fMipMapLevelAndLodControlSupport &&
|
||||
((kIntel_GrGLVendor == ctxInfo.vendor()) ||
|
||||
(contextOptions.fDoManualMipmapping ||
|
||||
(kIntel_GrGLVendor == ctxInfo.vendor()) ||
|
||||
(kNVIDIA_GrGLDriver == ctxInfo.driver() && isMAC) ||
|
||||
(kATI_GrGLVendor == ctxInfo.vendor()))) {
|
||||
fDoManualMipmapping = true;
|
||||
|
Loading…
Reference in New Issue
Block a user