Revert "Support GL_EXT_draw_buffers"

This reverts commit 77af4ecd35.

Reason for revert: iOS errors and bad images on Gold

Original change's description:
> Support GL_EXT_draw_buffers
> 
> Change-Id: I078aa7c42de4368602b0ef43bd7e18efbfd1e049
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212182
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com

Change-Id: Ib8759d4a1009f9a8774365a699e211834d634cff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212264
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2019-05-06 20:07:20 +00:00 committed by Skia Commit-Bot
parent 77af4ecd35
commit a9aaef0c99
8 changed files with 6 additions and 56 deletions

View File

@ -187,11 +187,6 @@ sk_sp<const GrGLInterface> GrGLMakeAssembledGLESInterface(void *ctx, GrGLGetProc
if (glVer >= GR_GL_VER(3,0)) {
GET_PROC(DrawBuffers);
} else if (extensions.has("GL_EXT_draw_buffers")) {
GET_PROC_SUFFIX(DrawBuffers, EXT);
}
if (glVer >= GR_GL_VER(3,0)) {
GET_PROC(ReadBuffer);
}

View File

@ -194,7 +194,6 @@ sk_sp<const GrGLInterface> GrGLMakeAssembledGLInterface(void *ctx, GrGLGetProc g
}
GET_PROC(DrawBuffers);
GET_PROC(ReadBuffer);
if (glVer >= GR_GL_VER(4,0)) {

View File

@ -169,9 +169,6 @@ sk_sp<const GrGLInterface> GrGLMakeAssembledWebGLInterface(void *ctx, GrGLGetPro
if (glVer >= GR_GL_VER(2,0)) {
GET_PROC(DrawBuffers);
}
if (glVer >= GR_GL_VER(2,0)) {
GET_PROC(ReadBuffer);
}

View File

@ -323,15 +323,6 @@ void GrGLCaps::init(const GrContextOptions& contextOptions,
fSupportsAHardwareBufferImages = true;
#endif
if (GR_IS_GR_GL(standard)) {
fDrawBuffersSupport = true;
} else if (GR_IS_GR_GL_ES(standard)) {
fDrawBuffersSupport = (version >= GR_GL_VER(3, 0)) ||
ctxInfo.hasExtension("GL_EXT_draw_buffers");
} else if (GR_IS_GR_WEBGL(standard)) {
fDrawBuffersSupport = version >= GR_GL_VER(2, 0);
}
/**************************************************************************
* GrShaderCaps fields
**************************************************************************/

View File

@ -419,8 +419,6 @@ public:
bool fbFetchRequiresEnablePerSample() const { return fFBFetchRequiresEnablePerSample; }
bool drawBuffersSupport() const { return fDrawBuffersSupport; }
GrPixelConfig validateBackendRenderTarget(const GrBackendRenderTarget&,
SkColorType) const override;
@ -509,7 +507,6 @@ private:
bool fProgramBinarySupport : 1;
bool fSamplerObjectSupport : 1;
bool fFBFetchRequiresEnablePerSample : 1;
bool fDrawBuffersSupport : 1;
// Driver workarounds
bool fDoManualMipmapping : 1;

View File

@ -3124,22 +3124,13 @@ void GrGLGpu::onResetTextureBindings() {
void GrGLGpu::flushColorWrite(bool writeColor) {
if (!writeColor) {
if (kNo_TriState != fHWWriteToColor) {
if (this->glCaps().drawBuffersSupport()) {
const GrGLenum drawBuffer = GR_GL_NONE;
GL_CALL(DrawBuffers(1, &drawBuffer));
} else {
GL_CALL(ColorMask(GR_GL_FALSE, GR_GL_FALSE, GR_GL_FALSE, GR_GL_FALSE));
}
GL_CALL(ColorMask(GR_GL_FALSE, GR_GL_FALSE,
GR_GL_FALSE, GR_GL_FALSE));
fHWWriteToColor = kNo_TriState;
}
} else {
if (kYes_TriState != fHWWriteToColor) {
if (this->glCaps().drawBuffersSupport()) {
const GrGLenum drawBuffer = GR_GL_COLOR_ATTACHMENT0;
GL_CALL(DrawBuffers(1, &drawBuffer));
} else {
GL_CALL(ColorMask(GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE));
}
GL_CALL(ColorMask(GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE, GR_GL_TRUE));
fHWWriteToColor = kYes_TriState;
}
}

View File

@ -218,23 +218,13 @@ bool GrGLInterface::validate() const {
}
}
if (GR_IS_GR_GL(fStandard) ||
(GR_IS_GR_GL_ES(fStandard) && (
(glVer >= GR_GL_VER(3,0)) ||
fExtensions.has("GL_EXT_draw_buffers"))) ||
(GR_IS_GR_WEBGL(fStandard) && (
(glVer >= GR_GL_VER(2,0))))) {
if (!fFunctions.fDrawBuffers) {
RETURN_FALSE_INTERFACE;
}
}
if (GR_IS_GR_GL(fStandard) ||
(GR_IS_GR_GL_ES(fStandard) && (
(glVer >= GR_GL_VER(3,0)))) ||
(GR_IS_GR_WEBGL(fStandard) && (
(glVer >= GR_GL_VER(2,0))))) {
if (!fFunctions.fReadBuffer) {
if (!fFunctions.fDrawBuffers ||
!fFunctions.fReadBuffer) {
RETURN_FALSE_INTERFACE;
}
}

View File

@ -136,22 +136,12 @@
]
},
{ // ES 3.0 has glDrawBuffers but not glDrawBuffer
"GL": [{"ext": "<core>"}],
"GLES": [{"min_version": [3, 0], "ext": "<core>"},
{/* else if */ "ext": "GL_EXT_draw_buffers"}],
"WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
"functions": [
"DrawBuffers",
]
},
{ // ES 2.0 w/GL_EXT_draw_buffers has glDrawBuffers but not glReadBuffer
"GL": [{"ext": "<core>"}],
"GLES": [{"min_version": [3, 0], "ext": "<core>"}],
"WebGL": [{"min_version": [2, 0], "ext": "<core>"}],
"functions": [
"ReadBuffer",
"DrawBuffers", "ReadBuffer",
]
},