aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKevin Lubick <kjlubick@google.com>2019-01-28 12:57:23 +0000
committerKevin Lubick <kjlubick@google.com>2019-01-28 13:03:23 +0000
commit04c1cccaa45e8a96fcc82f027435b50093b935ea (patch)
treeff7581bbf519445028d1c7190dce72b37e54809e /src
parent04ac845bf755da0cf767f2f5fb40f0b1acd49b5e (diff)
downloadskqp-04c1cccaa45e8a96fcc82f027435b50093b935ea.tar.gz
Revert "Avoid checking extension string in GrGLGpu::onResetContext."
This reverts commit a5bc81285ad5017a9368bbe3a106c59e492b1008. Reason for revert: Potentially breaking some Android bots Original change's description: > Avoid checking extension string in GrGLGpu::onResetContext. > > Also, remove support for NV_shader_framebuffer_fetch (no longer listed in > extension registry). > > Change-Id: Icad4ecf057a7e598ce41dd6ee4029cfe0d9488f8 > Reviewed-on: https://skia-review.googlesource.com/c/186873 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> > Auto-Submit: Brian Salomon <bsalomon@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I18a744d62af2edce1bdfdc09e68a86535f62b093 Reviewed-on: https://skia-review.googlesource.com/c/187263 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp15
-rw-r--r--src/gpu/gl/GrGLCaps.h3
-rw-r--r--src/gpu/gl/GrGLDefines.h2
-rw-r--r--src/gpu/gl/GrGLGpu.cpp4
4 files changed, 12 insertions, 12 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 0218317659..04ef735f8d 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -68,7 +68,6 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
fDontSetBaseOrMaxLevelForExternalTextures = false;
fProgramBinarySupport = false;
fSamplerObjectSupport = false;
- fFBFetchRequiresEnablePerSample = false;
fBlitFramebufferFlags = kNoSupport_BlitFramebufferFlag;
fMaxInstancesPerDrawWithoutCrashing = 0;
@@ -709,21 +708,25 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli
GrShaderCaps* shaderCaps = fShaderCaps.get();
shaderCaps->fGLSLGeneration = ctxInfo.glslGeneration();
if (kGLES_GrGLStandard == standard) {
- // fFBFetchRequiresEnablePerSample is not a shader cap but is initialized below to keep it
- // with related FB fetch logic.
if (ctxInfo.hasExtension("GL_EXT_shader_framebuffer_fetch")) {
shaderCaps->fFBFetchNeedsCustomOutput = (version >= GR_GL_VER(3, 0));
shaderCaps->fFBFetchSupport = true;
shaderCaps->fFBFetchColorName = "gl_LastFragData[0]";
shaderCaps->fFBFetchExtensionString = "GL_EXT_shader_framebuffer_fetch";
- fFBFetchRequiresEnablePerSample = false;
- } else if (ctxInfo.hasExtension("GL_ARM_shader_framebuffer_fetch")) {
+ }
+ else if (ctxInfo.hasExtension("GL_NV_shader_framebuffer_fetch")) {
+ // Actually, we haven't seen an ES3.0 device with this extension yet, so we don't know
+ shaderCaps->fFBFetchNeedsCustomOutput = false;
+ shaderCaps->fFBFetchSupport = true;
+ shaderCaps->fFBFetchColorName = "gl_LastFragData[0]";
+ shaderCaps->fFBFetchExtensionString = "GL_NV_shader_framebuffer_fetch";
+ }
+ else if (ctxInfo.hasExtension("GL_ARM_shader_framebuffer_fetch")) {
// The arm extension also requires an additional flag which we will set onResetContext
shaderCaps->fFBFetchNeedsCustomOutput = false;
shaderCaps->fFBFetchSupport = true;
shaderCaps->fFBFetchColorName = "gl_LastFragColorARM";
shaderCaps->fFBFetchExtensionString = "GL_ARM_shader_framebuffer_fetch";
- fFBFetchRequiresEnablePerSample = true;
}
shaderCaps->fUsesPrecisionModifiers = true;
}
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index 4a97e84cf8..1d42f0dd47 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -417,8 +417,6 @@ public:
bool samplerObjectSupport() const { return fSamplerObjectSupport; }
- bool fbFetchRequiresEnablePerSample() const { return fFBFetchRequiresEnablePerSample; }
-
GrPixelConfig validateBackendRenderTarget(const GrBackendRenderTarget&,
SkColorType) const override;
@@ -505,7 +503,6 @@ private:
bool fClearTextureSupport : 1;
bool fProgramBinarySupport : 1;
bool fSamplerObjectSupport : 1;
- bool fFBFetchRequiresEnablePerSample : 1;
// Driver workarounds
bool fDoManualMipmapping : 1;
diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h
index 995dbf3da1..a545e457e8 100644
--- a/src/gpu/gl/GrGLDefines.h
+++ b/src/gpu/gl/GrGLDefines.h
@@ -987,7 +987,7 @@
#define GR_GL_PATH_MODELVIEW 0x1700
/* ARM specific define for MSAA support on framebuffer fetch */
-#define GR_GL_FETCH_PER_SAMPLE 0x8F65
+#define GR_GL_FETCH_PER_SAMPLE_ARM 0x8F65
/* GL_EXT_raster_multisample */
#define GR_GL_RASTER_MULTISAMPLE 0x9327
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index e8bf4f298d..34b27d2136 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -539,10 +539,10 @@ void GrGLGpu::onResetContext(uint32_t resetBits) {
}
if (kGLES_GrGLStandard == this->glStandard() &&
- this->glCaps().fbFetchRequiresEnablePerSample()) {
+ this->hasExtension("GL_ARM_shader_framebuffer_fetch")) {
// The arm extension requires specifically enabling MSAA fetching per sample.
// On some devices this may have a perf hit. Also multiple render targets are disabled
- GL_CALL(Enable(GR_GL_FETCH_PER_SAMPLE));
+ GL_CALL(Enable(GR_GL_FETCH_PER_SAMPLE_ARM));
}
fHWWriteToColor = kUnknown_TriState;
// we only ever use lines in hairline mode