Remove GR_GL_IGNORE_ES3_MSAA.s
R=jvanverth@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/140933005 git-svn-id: http://skia.googlecode.com/svn/trunk@13115 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
58c0fa37ba
commit
92b7884e88
@ -170,15 +170,6 @@
|
||||
#define GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE 0
|
||||
#endif
|
||||
|
||||
// We now have a separate GrGLInterface function pointer entry for the IMG/EXT version of
|
||||
// glRenderbufferStorageMultisampled. However, Chrome is setting the one we now use for
|
||||
// ES3 MSAA to point to the IMG/EXT function. This macro exists to make Skia ignore the
|
||||
// ES3 MSAA and instead use the IMG/EXT version with the old function pointer entry. It will
|
||||
// be removed as soon as Chrome is updated to set the new function pointer.
|
||||
#if !defined(GR_GL_IGNORE_ES3_MSAA)
|
||||
#define GR_GL_IGNORE_ES3_MSAA 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* There is a strange bug that occurs on Macs with NVIDIA GPUs. We don't
|
||||
* fully understand it. When (element) array buffers are continually
|
||||
|
@ -220,7 +220,6 @@ public:
|
||||
GLPtr<GrGLReadPixelsProc> fReadPixels;
|
||||
GLPtr<GrGLRenderbufferStorageProc> fRenderbufferStorage;
|
||||
|
||||
#if !GR_GL_IGNORE_ES3_MSAA
|
||||
// On OpenGL ES there are multiple incompatible extensions that add support for MSAA
|
||||
// and ES3 adds MSAA support to the standard. On an ES3 driver we may still use the
|
||||
// older extensions for performance reasons or due to ES3 driver bugs. We want the function
|
||||
@ -239,7 +238,7 @@ public:
|
||||
GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2EXT;
|
||||
// GL_APPLE_framebuffer_multisample
|
||||
GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisampleES2APPLE;
|
||||
#endif
|
||||
|
||||
// This is used to store the pointer for GL_ARB/EXT/ANGLE/CHROMIUM_framebuffer_multisample or
|
||||
// the standard function in ES3+ or GL 3.0+.
|
||||
GLPtr<GrGLRenderbufferStorageMultisampleProc> fRenderbufferStorageMultisample;
|
||||
|
@ -465,7 +465,7 @@ void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
|
||||
fMSFBOType = kES_EXT_MsToTexture_MSFBOType;
|
||||
} else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture")) {
|
||||
fMSFBOType = kES_IMG_MsToTexture_MSFBOType;
|
||||
} else if (!GR_GL_IGNORE_ES3_MSAA && ctxInfo.version() >= GR_GL_VER(3,0)) {
|
||||
} else if (ctxInfo.version() >= GR_GL_VER(3,0)) {
|
||||
fMSFBOType = GrGLCaps::kES_3_0_MSFBOType;
|
||||
} else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) {
|
||||
// chrome's extension is equivalent to the EXT msaa
|
||||
|
@ -328,25 +328,6 @@ bool GrGLInterface::validate() const {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#if GR_GL_IGNORE_ES3_MSAA
|
||||
if (extensions.has("GL_CHROMIUM_framebuffer_multisample")) {
|
||||
if (NULL == fRenderbufferStorageMultisample ||
|
||||
NULL == fBlitFramebuffer) {
|
||||
return false;
|
||||
}
|
||||
} else if (extensions.has("GL_APPLE_framebuffer_multisample")) {
|
||||
if (NULL == fRenderbufferStorageMultisample ||
|
||||
NULL == fResolveMultisampleFramebuffer) {
|
||||
return false;
|
||||
}
|
||||
} else if (extensions.has("GL_IMG_multisampled_render_to_texture") ||
|
||||
extensions.has("GL_EXT_multisampled_render_to_texture")) {
|
||||
if (NULL == fRenderbufferStorageMultisample ||
|
||||
NULL == fFramebufferTexture2DMultisample) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (glVer >= GR_GL_VER(3,0) || extensions.has("GL_CHROMIUM_framebuffer_multisample")) {
|
||||
if (NULL == fRenderbufferStorageMultisample ||
|
||||
NULL == fBlitFramebuffer) {
|
||||
@ -366,7 +347,6 @@ bool GrGLInterface::validate() const {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// On ES buffer mapping is an extension. On Desktop
|
||||
|
@ -714,13 +714,6 @@ static bool renderbuffer_storage_msaa(GrGLContext& ctx,
|
||||
int width, int height) {
|
||||
CLEAR_ERROR_BEFORE_ALLOC(ctx.interface());
|
||||
SkASSERT(GrGLCaps::kNone_MSFBOType != ctx.caps()->msFBOType());
|
||||
#if GR_GL_IGNORE_ES3_MSAA
|
||||
GL_ALLOC_CALL(ctx.interface(),
|
||||
RenderbufferStorageMultisample(GR_GL_RENDERBUFFER,
|
||||
sampleCount,
|
||||
format,
|
||||
width, height));
|
||||
#else
|
||||
switch (ctx.caps()->msFBOType()) {
|
||||
case GrGLCaps::kDesktop_ARB_MSFBOType:
|
||||
case GrGLCaps::kDesktop_EXT_MSFBOType:
|
||||
@ -750,7 +743,6 @@ static bool renderbuffer_storage_msaa(GrGLContext& ctx,
|
||||
GrCrash("Shouldn't be here if we don't support multisampled renderbuffers.");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface()));;
|
||||
}
|
||||
|
||||
|
@ -147,56 +147,35 @@ static const GrGLInterface* create_es_interface(GrGLVersion version,
|
||||
interface->fDeleteRenderbuffers = glDeleteRenderbuffers;
|
||||
interface->fFramebufferRenderbuffer = glFramebufferRenderbuffer;
|
||||
interface->fFramebufferTexture2D = glFramebufferTexture2D;
|
||||
#if GR_GL_IGNORE_ES3_MSAA
|
||||
|
||||
if (version >= GR_GL_VER(3,0)) {
|
||||
#if GL_ES_VERSION_3_0
|
||||
interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisample;
|
||||
interface->fBlitFramebuffer = glBlitFramebuffer;
|
||||
#else
|
||||
interface->fRenderbufferStorageMultisample = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisample");
|
||||
interface->fBlitFramebuffer = (GrGLBlitFramebufferProc) eglGetProcAddress("glBlitFramebuffer");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (extensions.has("GL_EXT_multisampled_render_to_texture")) {
|
||||
#if GL_EXT_multisampled_render_to_texture
|
||||
interface->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleEXT;
|
||||
interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleEXT;
|
||||
interface->fRenderbufferStorageMultisampleES2EXT = glRenderbufferStorageMultisampleEXT;
|
||||
#else
|
||||
interface->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DMultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleEXT");
|
||||
interface->fRenderbufferStorageMultisample = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleEXT");
|
||||
interface->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleEXT");
|
||||
#endif
|
||||
} else if (extensions.has("GL_IMG_multisampled_render_to_texture")) {
|
||||
#if GL_IMG_multisampled_render_to_texture
|
||||
interface->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleIMG;
|
||||
interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisampleIMG;
|
||||
interface->fRenderbufferStorageMultisampleES2EXT = glRenderbufferStorageMultisampleIMG;
|
||||
#else
|
||||
interface->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DMultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleIMG");
|
||||
interface->fRenderbufferStorageMultisample = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleIMG");
|
||||
interface->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleIMG");
|
||||
#endif
|
||||
}
|
||||
|
||||
#else // GR_GL_IGNORE_ES3_MSAA
|
||||
|
||||
if (version >= GR_GL_VER(3,0)) {
|
||||
#if GL_ES_VERSION_3_0
|
||||
interface->fRenderbufferStorageMultisample = glRenderbufferStorageMultisample;
|
||||
interface->fBlitFramebuffer = glBlitFramebuffer;
|
||||
#else
|
||||
interface->fRenderbufferStorageMultisample = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisample");
|
||||
interface->fBlitFramebuffer = (GrGLBlitFramebufferProc) eglGetProcAddress("glBlitFramebuffer");
|
||||
#endif
|
||||
}
|
||||
if (extensions.has("GL_EXT_multisampled_render_to_texture")) {
|
||||
#if GL_EXT_multisampled_render_to_texture
|
||||
interface->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleEXT;
|
||||
interface->fRenderbufferStorageMultisampleES2EXT = glRenderbufferStorageMultisampleEXT;
|
||||
#else
|
||||
interface->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DMultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleEXT");
|
||||
interface->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleEXT");
|
||||
#endif
|
||||
} else if (extensions.has("GL_IMG_multisampled_render_to_texture")) {
|
||||
#if GL_IMG_multisampled_render_to_texture
|
||||
interface->fFramebufferTexture2DMultisample = glFramebufferTexture2DMultisampleIMG;
|
||||
interface->fRenderbufferStorageMultisampleES2EXT = glRenderbufferStorageMultisampleIMG;
|
||||
#else
|
||||
interface->fFramebufferTexture2DMultisample = (GrGLFramebufferTexture2DMultisampleProc) eglGetProcAddress("glFramebufferTexture2DMultisampleIMG");
|
||||
interface->fRenderbufferStorageMultisampleES2EXT = (GrGLRenderbufferStorageMultisampleProc) eglGetProcAddress("glRenderbufferStorageMultisampleIMG");
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // GR_GL_IGNORE_ES3_MSAA
|
||||
interface->fGenFramebuffers = glGenFramebuffers;
|
||||
interface->fGenRenderbuffers = glGenRenderbuffers;
|
||||
interface->fGetFramebufferAttachmentParameteriv = glGetFramebufferAttachmentParameteriv;
|
||||
|
Loading…
Reference in New Issue
Block a user