Bug 699025 - Don't try to use more multisampling samples than is supported by the GL - r=jgilbert

This fixes "WebGL is broken unless I set webgl.msaa-level=0" issues.
This commit is contained in:
Benoit Jacob 2011-11-03 10:50:39 -04:00
parent 94f1f84173
commit 3160e12587
2 changed files with 7 additions and 2 deletions

View File

@ -1037,8 +1037,11 @@ GLContext::ResizeOffscreenFBO(const gfxIntSize& aSize, const bool aUseReadFBO, c
const int stencil = mCreationFormat.stencil;
int samples = mCreationFormat.samples;
if (!SupportsFramebufferMultisample() || aDisableAA)
samples = 0;
GLint maxSamples = 0;
if (SupportsFramebufferMultisample() && !aDisableAA)
fGetIntegerv(LOCAL_GL_MAX_SAMPLES, &maxSamples);
samples = NS_MIN(samples, maxSamples);
const bool useDrawMSFBO = (samples > 0);

View File

@ -3040,6 +3040,8 @@ typedef ptrdiff_t GLintptr;
#define LOCAL_GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
#define LOCAL_GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
#define LOCAL_GL_MAX_SAMPLES 0x8D57
#define LOCAL_GL_GUILTY_CONTEXT_RESET_ARB 0x8253
#define LOCAL_GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
#define LOCAL_GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255